112 lines
3.1 KiB
ReStructuredText
112 lines
3.1 KiB
ReStructuredText
===========
|
|
Quick Start
|
|
===========
|
|
|
|
This guide will help you get started with CleverAgents quickly. We'll create a simple agent network, run it in both single-shot and interactive modes, and explore some basic customization options.
|
|
|
|
Installation
|
|
===========
|
|
|
|
First, install CleverAgents using pip:
|
|
|
|
.. code-block:: bash
|
|
|
|
pip install cleveragents
|
|
|
|
================================
|
|
Creating Your First Agent Network
|
|
================================
|
|
|
|
Let's create a simple agent network with two agents: a user interface agent and an LLM-powered assistant.
|
|
|
|
Create a file named ``my_network.yaml`` with the following content:
|
|
|
|
.. code-block:: yaml
|
|
|
|
name: "Simple Assistant Network"
|
|
description: "A basic network with a user interface and an assistant"
|
|
|
|
variables:
|
|
default_model: "gpt-4"
|
|
|
|
agents:
|
|
- name: "interface"
|
|
type: "interface"
|
|
description: "Handles user interaction"
|
|
|
|
- name: "assistant"
|
|
type: "llm"
|
|
description: "Provides helpful responses"
|
|
model: "${default_model}"
|
|
system_message: "You are a helpful assistant that provides concise and accurate information."
|
|
|
|
connections:
|
|
- from: "interface"
|
|
to: "assistant"
|
|
|
|
- from: "assistant"
|
|
to: "interface"
|
|
|
|
==========================
|
|
Running in Single-Shot Mode
|
|
==========================
|
|
|
|
To process a single query through your agent network:
|
|
|
|
.. code-block:: bash
|
|
|
|
cleveragents run --config my_network.yaml --input "What is the capital of France?"
|
|
|
|
This will output:
|
|
|
|
.. code-block:: text
|
|
|
|
The capital of France is Paris.
|
|
|
|
=========================
|
|
Running in Interactive Mode
|
|
=========================
|
|
|
|
For a continuous conversation with your agent network:
|
|
|
|
.. code-block:: bash
|
|
|
|
cleveragents interactive --config my_network.yaml
|
|
|
|
This will start an interactive session:
|
|
|
|
.. code-block:: text
|
|
|
|
CleverAgents Interactive Session
|
|
Type '/help' for available commands
|
|
> What is the capital of France?
|
|
The capital of France is Paris.
|
|
|
|
> Tell me more about Paris.
|
|
Paris is the capital and most populous city of France. Located on the Seine River in the north-central part of the country, it is a major European city and a global center for art, fashion, gastronomy, and culture. The city is known for its iconic landmarks such as the Eiffel Tower, the Louvre Museum, Notre-Dame Cathedral, and the Champs-Élysées.
|
|
|
|
> /exit
|
|
Session ended.
|
|
|
|
=======================
|
|
Customizing Your Network
|
|
=======================
|
|
|
|
You can override variables in your configuration at runtime:
|
|
|
|
.. code-block:: bash
|
|
|
|
cleveragents run --config my_network.yaml --var default_model=gpt-3.5-turbo --input "What is the capital of France?"
|
|
|
|
This will use the GPT-3.5 Turbo model instead of GPT-4 for this run.
|
|
|
|
Next Steps
|
|
|
|
Troubleshooting
|
|
---------------
|
|
|
|
If you encounter any issues while setting up or running CleverAgents, please check the following:
|
|
- Ensure that all dependencies are installed correctly.
|
|
- Verify that your configuration file is properly formatted.
|
|
- Consult the FAQ section on our website or open an issue on the repository if the problem persists.
|