pub struct MessageSendConfiguration {
pub accepted_output_modes: BTreeSet<String>,
pub history_length: Option<u32>,
pub blocking: bool,
}Expand description
Configuration for a SendMessage request.
Wire form:
{
"acceptedOutputModes": ["text/plain", "application/json"],
"historyLength": 10,
"blocking": true
}All fields are optional. A configuration
with every field set to its default (an
empty accepted_output_modes, no history
length, no blocking) serialises to {} on
the wire.
Fields§
§accepted_output_modes: BTreeSet<String>The MIME types the client can accept. A client that sends a message but the agent’s reply is in a type not in this list is a wire contract violation; the agent is free to refuse with a typed error.
history_length: Option<u32>The number of history messages to include in the response. A request with no history length lets the agent choose.
blocking: boolWhether the request should block
until the task completes. A
non-blocking request returns a Task
in Submitted or Working state;
the client polls with GetTask to
advance.
Implementations§
Source§impl MessageSendConfiguration
impl MessageSendConfiguration
Sourcepub fn new(modes: impl IntoIterator<Item = impl Into<String>>) -> Self
pub fn new(modes: impl IntoIterator<Item = impl Into<String>>) -> Self
Starts a new configuration with the
accepted output modes from modes. Use
with_history_length
and with_blocking
to set the other fields.
Sourcepub const fn with_history_length(self, length: u32) -> Self
pub const fn with_history_length(self, length: u32) -> Self
Sets the history length.
Sourcepub const fn with_blocking(self) -> Self
pub const fn with_blocking(self) -> Self
Marks the request as blocking.