kikocis/Based-Agent public
b47944ff9368 Updates util.py Shyamal H Anadkat,
| .. | ||
| README.md | 1.4 KiB | |
| agent_handoff.py | 585 B | |
| bare_minimum.py | 274 B | |
| context_variables.py | 966 B | |
| function_calling.py | 400 B | |
| simple_loop_no_helpers.py | 611 B | |
README.md
Swarm basic
This folder contains basic examples demonstrating core Swarm capabilities. These examples show the simplest implementations of Swarm, with one input message, and a corresponding output. The simple_loop_no_helpers has a while loop to demonstrate how to create an interactive Swarm session.
Examples
agent_handoff.py
- Demonstrates how to transfer a conversation from one agent to another.
- Usage: Transfers Spanish-speaking users from an English agent to a Spanish agent.
bare_minimum.py
- A bare minimum example showing the basic setup of an agent.
- Usage: Sets up an agent that responds to a simple user message.
context_variables.py
- Shows how to use context variables within an agent.
- Usage: Uses context variables to greet a user by name and print account details.
function_calling.py
- Demonstrates how to define and call functions from an agent.
- Usage: Sets up an agent that can respond with weather information for a given location.
simple_loop_no_helpers.py
- An example of a simple interaction loop without using helper functions.
- Usage: Sets up a loop where the user can continuously interact with the agent, printing the conversation.
Running the Examples
To run any of the examples, use the following command:
python3 <example_name>.py