Skip to main content
AG2 (formerly AutoGen) is an open-source framework for building and orchestrating AI agents. It focuses on enabling multiple agents to cooperate in solving complex tasks. The framework supports various language models from Together AI, tool integrations, and both autonomous and human-in-the-loop workflows.

Install libraries

Set your Together AI API key:

Example

Setup and configure AutoGen to use LLMs from Together AI
Importantly, we have tweaked the system message so that the model doesn’t return the termination keyword, which we’ve changed to FINISH, with the code block.

Output