Git Product home page Git Product logo

autogenwebdemo's Introduction

Autogen with FastApi backend and React frontend

This is a simple implementation of Autogen Agents using FastApi as backend and a frontend client using React

  1. FastApi Backend: A FastApi application running autogen.
  2. Webapp: React webapp using websocket to communicate with FastApi.

Running demo

  1. Clone this repo
git clone https://github.com/bonadio/autogenwebdemo.git
cd autogenwebdemo
  1. Configure backend

Configure python deps

cd backend
pip install -r ./requirements.txt 

Add your Openai key to .env inside src folder

cd backend/src (edit .env and add your key)

Start backend server inside src folder

python main.py

You should see

INFO:     Started server process [85614]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
  1. Configure frontend

Open a new terminal and go to the react-frontend folder (you need to have nodejs installed and npm >= v14 )

cd autogenwebdemo/react-frontend
npm install
npm run dev

Open you browser on http://localhost:5173/ or the port shown

Send the following messages:

-> Hi
<- Hello! How can I assist you today?

-> What the status of my order?
<- Sure, I can help you with that. Could you please provide me with your order number and customer number?

-> Order 222
<- Thank you for providing the order number. Could you also please provide me with your customer number?

-> customer 333
<- The status of your order with order number 222 and customer number 333 is "delivered". Is there anything else I can assist you with?
  1. Groupchat if you want to use Groupchat take a look at autogen_group_chat.py

chat interface

Have fun!

autogenwebdemo's People

Contributors

bonadio avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.