agent
ModuleAgents: an adapter with a description, instructions and a schema.
Contents
Structs
AgentAn AI agent: a provider adapter, with a description, instructions and optionally a schema its answers must follow.ProfileWhat an agent tells its provider besides the conversation: a description, named instructions and, for structured output, a schema. Adapters read it in `Adapter::send`.use utopia_agents::Agent;Rust
pub struct Agent<A>An AI agent: a provider adapter, with a description, instructions and optionally a schema its answers must follow.
Rust
use utopia_agents::{Agent, OpenAi};
let mut agent = Agent::new(OpenAi::new("test-api-key"));
agent
.set_description("You answer questions about the weather.")
.add_instruction("Tone", "Be brief.");
assert_eq!(agent.description(), "You answer questions about the weather.");
assert_eq!(agent.instructions().len(), 1);use utopia_agents::Profile;Rust
pub struct ProfileWhat an agent tells its provider besides the conversation: a
description, named instructions and, for structured output, a schema.
Adapters read it in Adapter::send.
use utopia_agents::Instruction;Rust
pub enum InstructionThe content of one instruction: one text, or lines joined by \n when
sent.
Also implements
From.