Expand description
Core client API for SimpleAgents.
This crate provides the unified SimpleAgentsClient that integrates
providers and healing in one place.
§Example
use simple_agents_core::{
CompletionOptions, CompletionOutcome, SimpleAgentsClient,
};
use simple_agent_type::prelude::*;
let client = SimpleAgentsClient::new(Arc::new(MockProvider));
let request = CompletionRequest::builder()
.model("gpt-4")
.message(Message::user("Hello!"))
.build()?;
let outcome = client.complete(&request, CompletionOptions::default()).await?;
let response = match outcome {
CompletionOutcome::Response(response) => response,
_ => return Ok(()),
};
println!("{}", response.content().unwrap_or_default());Modules§
- prelude
- Prelude module for convenient imports.
Structs§
- Client
Config - Top-level configuration for a
SimpleAgentsClient. - Completion
Options - Options that control completion behavior.
- Execution
Flags - Flags that control execution behaviour for a single run.
- Healed
Json Response - JSON healing response wrapper.
- Healed
Schema Response - Schema-aligned healing response wrapper.
- Healing
Settings - Healing settings for JSON parsing and coercion.
- Retry
Config - Retry behaviour for failed LLM requests.
- RunOptions
- Per-run options passed to the executor.
- Simple
Agents Client - Unified SimpleAgents client.
Enums§
- Completion
Mode - Mode for completion post-processing.
- Completion
Outcome - Result of a unified completion call.