#[non_exhaustive]pub enum ToolResultOutput {
Text {
value: String,
provider_options: Option<BTreeMap<String, Map<String, Value>>>,
},
Json {
value: Value,
provider_options: Option<BTreeMap<String, Map<String, Value>>>,
},
ExecutionDenied {
reason: Option<String>,
provider_options: Option<BTreeMap<String, Map<String, Value>>>,
},
ErrorText {
value: String,
provider_options: Option<BTreeMap<String, Map<String, Value>>>,
},
ErrorJson {
value: Value,
provider_options: Option<BTreeMap<String, Map<String, Value>>>,
},
Content {
value: Vec<ToolResultContentPart>,
},
}Expand description
The output of a tool call as sent back to the model.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Text
Plain text.
Fields
Json
A JSON value.
Fields
ExecutionDenied
Execution was denied by the application or user.
Fields
ErrorText
The tool failed; the error is plain text.
Fields
ErrorJson
The tool failed; the error is a JSON value.
Fields
Content
Multi-part content (text and files).
Fields
§
value: Vec<ToolResultContentPart>The parts.
Implementations§
Source§impl ToolResultOutput
impl ToolResultOutput
Sourcepub fn text(value: impl Into<String>) -> ToolResultOutput
pub fn text(value: impl Into<String>) -> ToolResultOutput
Creates a text output.
Sourcepub fn json(value: Value) -> ToolResultOutput
pub fn json(value: Value) -> ToolResultOutput
Creates a JSON output.
Sourcepub fn error_text(value: impl Into<String>) -> ToolResultOutput
pub fn error_text(value: impl Into<String>) -> ToolResultOutput
Creates an error-text output.
Sourcepub fn error_json(value: Value) -> ToolResultOutput
pub fn error_json(value: Value) -> ToolResultOutput
Creates an error-JSON output.
Sourcepub fn execution_denied(reason: Option<String>) -> ToolResultOutput
pub fn execution_denied(reason: Option<String>) -> ToolResultOutput
Creates an execution-denied output.
Trait Implementations§
Source§impl Clone for ToolResultOutput
impl Clone for ToolResultOutput
Source§fn clone(&self) -> ToolResultOutput
fn clone(&self) -> ToolResultOutput
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 ToolResultOutput
impl Debug for ToolResultOutput
Source§impl<'de> Deserialize<'de> for ToolResultOutput
impl<'de> Deserialize<'de> for ToolResultOutput
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolResultOutput, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolResultOutput, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ToolResultOutput
impl PartialEq for ToolResultOutput
Source§impl Serialize for ToolResultOutput
impl Serialize for ToolResultOutput
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 ToolResultOutput
Auto Trait Implementations§
impl Freeze for ToolResultOutput
impl RefUnwindSafe for ToolResultOutput
impl Send for ToolResultOutput
impl Sync for ToolResultOutput
impl Unpin for ToolResultOutput
impl UnsafeUnpin for ToolResultOutput
impl UnwindSafe for ToolResultOutput
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