API Reference
Prelude
`appam::prelude::*` re-exports for the common agent, tool, streaming, config, and error surfaces.
The prelude is defined in src/lib.rs and is the fastest way to write Appam code:
use appam::prelude::*;What it exports
Agent and streaming
AgentTraitAgentBuilderRuntimeAgentSessionTomlAgentAgentAgentQuickAgentBuilderToolExtStreamConsumerStreamEventStreamBuilder
Built-in consumers
CallbackConsumerChannelConsumerConsoleConsumerTraceConsumer
Errors and history
ToolExecutionErroranalyze_tool_errorSessionHistorySessionSummary
Configuration
load_config_from_envload_global_configAgentConfigBuilderAppConfigAppConfigBuilderHistoryConfigLogFormatLoggingConfigTraceFormat
LLM and tool types
ChatMessageDynamicLlmClientLlmClientLlmProviderRoleToolSpecUnifiedMessageUnifiedToolUnifiedToolCallToolToolRegistryClosureToolToolRegistryExt
Macros and convenience imports
toolSchemaanyhow,bail,Context,ResultDeserialize,Serializejson,ValueArctokio
Not in the prelude
Some secondary types still need explicit imports, for example:
use appam::agent::consumers::SqliteTraceConsumer;
use appam::llm::pricing::{calculate_cost, get_model_pricing};
use appam::llm::usage::UsageTracker;
use appam::web::state::AppState;