pub struct OutputFunctionDefinition {
pub name: String,
pub description: Option<String>,
pub parameters: Value,
}Expand description
Function-style final output call definition.
Fields§
§name: StringOutput function name exposed to the model.
description: Option<String>Output function description.
parameters: ValueJSON schema for output function arguments.
Implementations§
Source§impl OutputFunctionDefinition
impl OutputFunctionDefinition
Sourcepub fn new(name: impl Into<String>, parameters: Value) -> Self
pub fn new(name: impl Into<String>, parameters: Value) -> Self
Build an output function definition.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Add description.
Sourcepub fn from_output_schema(schema: &OutputSchema) -> Self
pub fn from_output_schema(schema: &OutputSchema) -> Self
Build an output function definition from an output schema.
Sourcepub fn tool_definition(&self) -> ToolDefinition
pub fn tool_definition(&self) -> ToolDefinition
Convert to a provider-neutral tool definition.
Trait Implementations§
Source§impl Clone for OutputFunctionDefinition
impl Clone for OutputFunctionDefinition
Source§fn clone(&self) -> OutputFunctionDefinition
fn clone(&self) -> OutputFunctionDefinition
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 OutputFunctionDefinition
impl Debug for OutputFunctionDefinition
Source§impl<'de> Deserialize<'de> for OutputFunctionDefinition
impl<'de> Deserialize<'de> for OutputFunctionDefinition
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for OutputFunctionDefinition
Source§impl PartialEq for OutputFunctionDefinition
impl PartialEq for OutputFunctionDefinition
Source§fn eq(&self, other: &OutputFunctionDefinition) -> bool
fn eq(&self, other: &OutputFunctionDefinition) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for OutputFunctionDefinition
impl Serialize for OutputFunctionDefinition
impl StructuralPartialEq for OutputFunctionDefinition
Auto Trait Implementations§
impl Freeze for OutputFunctionDefinition
impl RefUnwindSafe for OutputFunctionDefinition
impl Send for OutputFunctionDefinition
impl Sync for OutputFunctionDefinition
impl Unpin for OutputFunctionDefinition
impl UnsafeUnpin for OutputFunctionDefinition
impl UnwindSafe for OutputFunctionDefinition
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