From AG2 realtime agent example project, we build a todo management assistant that can be interacted with through voice.
By starting the app, you can directly speak to the assistant to manage your todo list. The assistant will help you add, remove, and modify your todos. A local todo.json
file will be created to save the todos.
This project demonstrates the following AG2 features:
TAGS: todo management, realtime agent, voice interaction, websocket streaming, fastapi, realtime updates, task automation
git clone https://github.com/ag2ai/build-with-ag2.git
cd manage-todos-with-realtime-agent
pip install -r requirements.txt
You need to obtain API keys from OpenAI or Gemini to use the realtime API. Sign up for OpenAI here, and Gemini here.
Then, create a OAI_CONFIG_LIST
file based on the provided OAI_CONFIG_LIST_sample
:
cp OAI_CONFIG_LIST_sample OAI_CONFIG_LIST
api_key
to your OpenAI API key for the configuration with the tag “gpt-4o-mini-realtime”api_key
to your Gemini API key for the configuration with the tag “gemini-realtime”Run the application with Uvicorn:
uvicorn main:app --port 5050
With the server running, open the client application in your browser by navigating to http://localhost:5050/start-chat/. Speak into your microphone, and the AI assistant will respond in real time.
For more information or any questions, please refer to the documentation or reach out to us!
This project is licensed under the Apache 2.0 License.