pub struct ChatCompletionMessageToolCallFunction {
pub arguments: String,
pub name: String,
}Expand description
The function that the model called.
JSON schema
{
"description": "The function that the model called.",
"type": "object",
"required": [
"arguments",
"name"
],
"properties": {
"arguments": {
"description": "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.",
"type": "string"
},
"name": {
"description": "The name of the function to call.",
"type": "string"
}
}
}Fields§
§arguments: StringThe arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
name: StringThe name of the function to call.
Implementations§
Source§impl ChatCompletionMessageToolCallFunction
impl ChatCompletionMessageToolCallFunction
Sourcepub fn parse_arguments<T: DeserializeOwned>(&self) -> Result<T, Error>
pub fn parse_arguments<T: DeserializeOwned>(&self) -> Result<T, Error>
Deserialize the arguments JSON string into a typed value.
The OpenAI-style schema represents tool-call arguments as a JSON-encoded string rather than a structured object, so callers must parse them.
Trait Implementations§
Source§impl Clone for ChatCompletionMessageToolCallFunction
impl Clone for ChatCompletionMessageToolCallFunction
Source§fn clone(&self) -> ChatCompletionMessageToolCallFunction
fn clone(&self) -> ChatCompletionMessageToolCallFunction
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<'de> Deserialize<'de> for ChatCompletionMessageToolCallFunction
impl<'de> Deserialize<'de> for ChatCompletionMessageToolCallFunction
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
Auto Trait Implementations§
impl Freeze for ChatCompletionMessageToolCallFunction
impl RefUnwindSafe for ChatCompletionMessageToolCallFunction
impl Send for ChatCompletionMessageToolCallFunction
impl Sync for ChatCompletionMessageToolCallFunction
impl Unpin for ChatCompletionMessageToolCallFunction
impl UnsafeUnpin for ChatCompletionMessageToolCallFunction
impl UnwindSafe for ChatCompletionMessageToolCallFunction
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