cai/examples/basic
Víctor Mayoral Vilches c3e3983143 Switch to CAI structure from swarm inspiration
Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
2025-01-09 13:20:31 +01:00
..
README.md Switch to CAI structure from swarm inspiration 2025-01-09 13:20:31 +01:00
agent_handoff.py Switch to CAI structure from swarm inspiration 2025-01-09 13:20:31 +01:00
bare_minimum.py Switch to CAI structure from swarm inspiration 2025-01-09 13:20:31 +01:00
context_variables.py Switch to CAI structure from swarm inspiration 2025-01-09 13:20:31 +01:00
function_calling.py Switch to CAI structure from swarm inspiration 2025-01-09 13:20:31 +01:00
simple_loop_no_helpers.py Switch to CAI structure from swarm inspiration 2025-01-09 13:20:31 +01:00

README.md

CAI basic

This folder contains basic examples demonstrating core CAI capabilities. These examples show the simplest implementations of CAI, with one input message, and a corresponding output. The simple_loop_no_helpers has a while loop to demonstrate how to create an interactive CAI session.

Examples

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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