pub struct OpenAiToolResult {
pub call_id: String,
pub name: String,
pub status: Symbol,
pub output: Expr,
}Expand description
The outcome of an OpenAiToolCall: a status symbol and result payload.
Fields§
§call_id: StringId of the originating OpenAiToolCall.
name: StringOpenAI tool name that produced this result.
status: SymbolOutcome status, e.g. ok, invalid-arguments, or unknown-tool.
output: ExprResult payload expression (the call output or an error message).
Implementations§
Source§impl OpenAiToolResult
impl OpenAiToolResult
Sourcepub fn success(call: &OpenAiToolCall, output: Expr) -> Self
pub fn success(call: &OpenAiToolCall, output: Expr) -> Self
Builds a successful (ok) result carrying output for call.
Sourcepub fn invalid_arguments(
call: &OpenAiToolCall,
message: impl Into<String>,
) -> Self
pub fn invalid_arguments( call: &OpenAiToolCall, message: impl Into<String>, ) -> Self
Builds an invalid-arguments failure result for call.
Sourcepub fn capability_denied(
call: &OpenAiToolCall,
message: impl Into<String>,
) -> Self
pub fn capability_denied( call: &OpenAiToolCall, message: impl Into<String>, ) -> Self
Builds a capability-denied failure result for call.
Sourcepub fn unknown_tool(call: &OpenAiToolCall) -> Self
pub fn unknown_tool(call: &OpenAiToolCall) -> Self
Builds an unknown-tool failure result for call.
Sourcepub fn message_text(&self) -> String
pub fn message_text(&self) -> String
Returns a human-readable one-line summary of this result.
Trait Implementations§
Source§impl Clone for OpenAiToolResult
impl Clone for OpenAiToolResult
Source§fn clone(&self) -> OpenAiToolResult
fn clone(&self) -> OpenAiToolResult
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 OpenAiToolResult
impl Debug for OpenAiToolResult
Source§impl PartialEq for OpenAiToolResult
impl PartialEq for OpenAiToolResult
Source§fn eq(&self, other: &OpenAiToolResult) -> bool
fn eq(&self, other: &OpenAiToolResult) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for OpenAiToolResult
Auto Trait Implementations§
impl Freeze for OpenAiToolResult
impl RefUnwindSafe for OpenAiToolResult
impl Send for OpenAiToolResult
impl Sync for OpenAiToolResult
impl Unpin for OpenAiToolResult
impl UnsafeUnpin for OpenAiToolResult
impl UnwindSafe for OpenAiToolResult
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