pub struct AgentConfig {
pub agent: AgentMetadata,
pub handler: HandlerConfig,
pub runtime: RuntimeConfig,
pub server: ServerConfig,
pub skills: Vec<SkillConfig>,
pub features: FeaturesConfig,
pub llm: Option<LlmConfig>,
}Expand description
Complete agent configuration from TOML
Fields§
§agent: AgentMetadataAgent metadata
handler: HandlerConfigTyped handler selection ([handler]). When omitted, the legacy
agent.implementation string is honoured via [handler_type].
runtime: RuntimeConfigHow the platform packages this agent ([runtime]) — a custom image, or
nothing, meaning the platform’s base image runs it.
server: ServerConfigServer configuration
skills: Vec<SkillConfig>Skills exposed by the agent
features: FeaturesConfigFeatures enabled for the agent
llm: Option<LlmConfig>LLM Configuration
Implementations§
Source§impl AgentConfig
impl AgentConfig
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, ConfigError>
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, ConfigError>
Load configuration from a TOML file
Sourcepub fn from_toml(content: &str) -> Result<Self, ConfigError>
pub fn from_toml(content: &str) -> Result<Self, ConfigError>
Parse configuration from TOML string
Sourcepub fn check_toml(content: &str) -> Result<(Self, Vec<String>), ConfigError>
pub fn check_toml(content: &str) -> Result<(Self, Vec<String>), ConfigError>
Parse for validation, tolerating unset ${VAR} references.
Returns the config alongside the names of variables that had no value and
no :-default — they were substituted with a placeholder so the rest of
the config could still be checked. Everything else (unknown keys, wrong
types, failed validate) errors exactly as in
from_toml.
This is what a2a validate uses: a config’s shape should be checkable
without the production secrets it will eventually run with.
Sourcepub fn check_file<P: AsRef<Path>>(
path: P,
) -> Result<(Self, Vec<String>), ConfigError>
pub fn check_file<P: AsRef<Path>>( path: P, ) -> Result<(Self, Vec<String>), ConfigError>
check_toml for a file on disk.
Sourcepub fn handler_type(&self) -> HandlerType
pub fn handler_type(&self) -> HandlerType
Resolve the handler selector, preferring [handler].type and falling
back to the legacy agent.implementation (so existing configs keep
working) and finally HandlerType::Echo.
Sourcepub fn image(&self) -> Option<&str>
pub fn image(&self) -> Option<&str>
The image this agent runs from, if it brings its own.
None means the runtime’s base image (or, under a2a run, this binary’s
built-in handlers).
Sourcepub fn validate(&self) -> Result<(), ConfigError>
pub fn validate(&self) -> Result<(), ConfigError>
Validate the configuration
Trait Implementations§
Source§impl Clone for AgentConfig
impl Clone for AgentConfig
Source§impl Debug for AgentConfig
impl Debug for AgentConfig
Source§impl<'de> Deserialize<'de> for AgentConfig
impl<'de> Deserialize<'de> for AgentConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for AgentConfig
impl JsonSchema for AgentConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for AgentConfig
impl RefUnwindSafe for AgentConfig
impl Send for AgentConfig
impl Sync for AgentConfig
impl Unpin for AgentConfig
impl UnsafeUnpin for AgentConfig
impl UnwindSafe for AgentConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more