Skip to main content

Crate simple_agents_core

Crate simple_agents_core 

Source
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§

ClientConfig
Top-level configuration for a SimpleAgentsClient.
CompletionOptions
Options that control completion behavior.
ExecutionFlags
Flags that control execution behaviour for a single run.
HealedJsonResponse
JSON healing response wrapper.
HealedSchemaResponse
Schema-aligned healing response wrapper.
HealingSettings
Healing settings for JSON parsing and coercion.
RetryConfig
Retry behaviour for failed LLM requests.
RunOptions
Per-run options passed to the executor.
SimpleAgentsClient
Unified SimpleAgents client.

Enums§

CompletionMode
Mode for completion post-processing.
CompletionOutcome
Result of a unified completion call.