Expand description
§daimon-core
Core traits and types for the Daimon AI agent
framework. This crate is the plugin interface — implement Model to
add a new LLM provider.
Provider crates depend on daimon-core for the shared types and trait.
The main daimon crate re-exports everything from here, so end users
typically never need to depend on daimon-core directly.
§Implementing a Provider
ⓘ
use daimon_core::{Model, ChatRequest, ChatResponse, Result, ResponseStream};
pub struct MyProvider { /* ... */ }
impl Model for MyProvider {
async fn generate(&self, request: &ChatRequest) -> Result<ChatResponse> {
// call your LLM API
todo!()
}
async fn generate_stream(&self, request: &ChatRequest) -> Result<ResponseStream> {
todo!()
}
}Re-exports§
pub use distributed::AgentTask;pub use distributed::ErasedTaskBroker;pub use distributed::TaskBroker;pub use distributed::TaskResult;pub use distributed::TaskStatus;pub use vector_store::ErasedVectorStore;pub use vector_store::VectorStore;
Modules§
- distributed
- Core types and trait for distributed agent execution.
- vector_
store - Trait-based plugin system for vector stores.
Structs§
- Chat
Request - A request to send to a model.
- Chat
Response - A complete response from a model.
- Document
- A retrieved document fragment with optional metadata and relevance score.
- Message
- A single message in a conversation.
- Scored
Document - A document paired with a similarity score from a vector query.
- Tool
Call - A tool invocation requested by a model, containing the tool name and arguments.
- Tool
Spec - Describes a tool that can be passed to a model.
- Usage
- Token usage statistics for a single model request.
Enums§
- Daimon
Error - The central error type for all Daimon operations.
- Role
- The role of a participant in a conversation.
- Stop
Reason - Why the model stopped generating.
- Stream
Event - An event emitted during a streaming model response.
Traits§
- Embedding
Model - Trait for models that produce vector embeddings from text.
- Erased
Embedding Model - Object-safe wrapper for
EmbeddingModel. - Erased
Model - Object-safe wrapper for
Model, enabling dynamic dispatch viaArc<dyn ErasedModel>. - Model
- Trait for LLM providers. Supports both synchronous and streaming generation.
Type Aliases§
- Response
Stream - A boxed, pinned stream of
StreamEventresults. - Result
- A type alias for
Result<T, DaimonError>. - Shared
Embedding Model - Shared ownership of an embedding model.
- Shared
Model - Shared ownership of a model via
Arc<dyn ErasedModel>.