pub struct AgentDefinition {
pub name: String,
pub instructions: String,
pub model: ModelSpec,
pub capabilities: Vec<Arc<dyn Capability>>,
pub max_iterations: usize,
pub middleware: Vec<Arc<dyn TurnMiddleware>>,
pub hooks: Vec<Arc<dyn Hook>>,
pub budget_checker: Option<Arc<dyn BudgetChecker>>,
pub context_assembler: Arc<dyn ContextAssembler>,
pub model_profile: Option<ModelProfile>,
pub context_token_limit: Option<usize>,
}Expand description
Agent behavior, separate from the resources that run it.
The model may contain credentials, so this value is sensitive configuration even though durable events never include it.
Fields§
§name: StringHuman-readable diagnostic name.
instructions: StringBase system instructions.
model: ModelSpecDefault model, required for every built definition.
capabilities: Vec<Arc<dyn Capability>>Behavior attached by value.
max_iterations: usizeMaximum reason steps in one turn.
middleware: Vec<Arc<dyn TurnMiddleware>>Ordered turn policy.
hooks: Vec<Arc<dyn Hook>>Ordered user hooks at session, turn, and tool lifecycle points.
budget_checker: Option<Arc<dyn BudgetChecker>>Optional budget policy.
context_assembler: Arc<dyn ContextAssembler>Shapes durable history into model context.
model_profile: Option<ModelProfile>What this agent’s model supports, when the host said — see
AgentBuilder::model_catalog. Read it to size a context budget or
to show a user what the model can do; the builder has already used it
to validate the composition.
context_token_limit: Option<usize>Optional input-token ceiling exposed to context assembly.