pub struct ToolOutput {
pub content: String,
pub display: Option<DisplayOutput>,
pub artifacts: Vec<Artifact>,
pub memory_policy: ToolMemoryPolicy,
pub metadata: BTreeMap<String, Value>,
}Expand description
Model-visible output produced by a tool.
Fields§
§content: StringText visible to the model through Message::ToolResult.
display: Option<DisplayOutput>Optional host/UI display output.
artifacts: Vec<Artifact>Artifact handles produced by the tool.
memory_policy: ToolMemoryPolicyMemory policy for the model-visible content.
metadata: BTreeMap<String, Value>Framework/application metadata.
Implementations§
Source§impl ToolOutput
impl ToolOutput
Sourcepub fn text(content: impl Into<String>) -> ToolOutput
pub fn text(content: impl Into<String>) -> ToolOutput
Constructs plain text model-visible output.
Sourcepub fn with_display(self, display: DisplayOutput) -> ToolOutput
pub fn with_display(self, display: DisplayOutput) -> ToolOutput
Sets host/UI display output.
Sourcepub fn with_artifacts(self, artifacts: Vec<Artifact>) -> ToolOutput
pub fn with_artifacts(self, artifacts: Vec<Artifact>) -> ToolOutput
Sets artifact handles.
Sourcepub fn with_memory_policy(self, policy: ToolMemoryPolicy) -> ToolOutput
pub fn with_memory_policy(self, policy: ToolMemoryPolicy) -> ToolOutput
Sets memory policy.
Sourcepub fn with_metadata(self, metadata: BTreeMap<String, Value>) -> ToolOutput
pub fn with_metadata(self, metadata: BTreeMap<String, Value>) -> ToolOutput
Sets framework/application metadata.
Trait Implementations§
Source§impl Clone for ToolOutput
impl Clone for ToolOutput
Source§fn clone(&self) -> ToolOutput
fn clone(&self) -> ToolOutput
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToolOutput
impl Debug for ToolOutput
Source§impl<'de> Deserialize<'de> for ToolOutput
impl<'de> Deserialize<'de> for ToolOutput
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolOutput, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolOutput, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&str> for ToolOutput
impl From<&str> for ToolOutput
Source§fn from(content: &str) -> ToolOutput
fn from(content: &str) -> ToolOutput
Converts to this type from the input type.
Source§impl From<String> for ToolOutput
impl From<String> for ToolOutput
Source§fn from(content: String) -> ToolOutput
fn from(content: String) -> ToolOutput
Converts to this type from the input type.
Source§impl From<ToolOutput> for ToolResult
impl From<ToolOutput> for ToolResult
Source§fn from(output: ToolOutput) -> ToolResult
fn from(output: ToolOutput) -> ToolResult
Converts to this type from the input type.
Source§impl PartialEq for ToolOutput
impl PartialEq for ToolOutput
Source§impl Serialize for ToolOutput
impl Serialize for ToolOutput
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ToolOutput
Auto Trait Implementations§
impl Freeze for ToolOutput
impl RefUnwindSafe for ToolOutput
impl Send for ToolOutput
impl Sync for ToolOutput
impl Unpin for ToolOutput
impl UnsafeUnpin for ToolOutput
impl UnwindSafe for ToolOutput
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
Mutably borrows from an owned value. Read more