Giter VIP home page Giter VIP logo

debate_team's Introduction

debate_team

Code, samples, and a working app for creating and using a debate team of AI agents with with Agent AutoBuild.

Meant mainly as an example of what can be done with multiple agents and of how easy it is to create badly-needed teachingl tools with AI.

overview

Autobuild is part of autogen from Microsoft. It partly automates the task of a creating a group of agents to coloborate on a task. It is low-code but not no-code.

builddebateteam.py in this repository builds a team of four debating agents, a moderator, and a judge to debate any proposition given to them. The agents are created as a JSON file, debateteam.json, which is then input to the user-facing debate application.

The depository is set up so that an application can be uploaded to the Streamlit cloud. That has been done and the application is here. The .gitignore and requirements.txt are specific to streamlit cloud.

debatemanager.py is incorporated in the streamlit app but also be run as standalone Python with a console-based interface to test debating and debate topics.

ststreamer.py is a helper module for the streamer app which reditects console output and streams it to the streamlit user while a long-running app (like a debate) is writing to console. It is usable independent of the rest of this code but is not on PyPi.

usage

as a streamlit app:

Click the URL https://debateteam.streamlit.app/. You will need an OPENAI api key in the paid tier. The free api key will not work because the agents use GPT4.

as a basis for deploying your own Streamlit app.

  1. clone the repository.
  2. make any changes you want to make.
  3. be sure to update .gitignore and requirements.txt as needed.
  4. deploy from Streamlit (you need an acount, of course).

to make a modified debate team

  1. download builddebateteamm.py and SAMPLE.env into your favorite IDE.
  2. modify SAMPLE.env by addind your own paid OPENAI api key where indicated. The free api key will not work because the agents and agentbuilder use GPT4.
  3. save as .env.
  4. pip install autogen[autobuild]
  5. change the text of building_task in builddebateteam tyo whatever you want.
  6. run.
  7. you will be prompted for an optional test debate topic and a name for the saved debate team.
  8. if you use your debate team with either debatemanager or a Streamlit app, be sure to specifiy the name and location of your debate team json file in debatemanager main_ or streamlit_app.py as appropriate. If you uploaded the json file containing your debate team speciifcation to your own repository or somewhere else, you can give the url ratther than a file address.

to capture console output from a Python function and stream it to streamlit

  1. download ststreamer.py (it's not on PyPi).
  2. import ststreamer into the code that you're writing
  3. write a function like this and use it to call your function.
   # Function to capture the console output
   def capture_console_output(func, *args, **kwargs):
     f = ststreamer.ObservableStringIO()
     with redirect_stdout(f):
       func(*args, **kwargs)
   output = f.getvalue()
   return output

ideas for enhancement

Let one or more of the debaters be humans

Empower the debaters to do research

Empower the judge to fact-check

Implement with an open source LLM

privacy

No code here explititly collects any information of any kind. However, some usage stastics are available from both github and Streamlit.

disclaimer

This all comes with no warranty of any kind nor any promise to fix problems or maintain compatabity with the code it uses. However, bug reports, issues, and enhancement pull requests are welcome.

debate_team's People

Contributors

tevslin avatar

Stargazers

Martin Brose avatar von avatar  avatar Your Tech Tribe avatar Mark Sze avatar  avatar Brandon Waite avatar

Watchers

 avatar

Forkers

jpuigde rphllc

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.