pub struct Function {
pub name: String,
pub description: Option<String>,
pub parameters: Value,
pub strict: Option<bool>,
}Fields§
§name: String要调用的 function 名称。必须由 a-z、A-Z、0-9 字符组成,或包含下划线和连字符,最大长度为 64 个字符。
description: Option<String>function 的功能描述,供模型理解何时以及如何调用该 function。
parameters: Valuefunction 的输入参数,以 JSON Schema 对象描述。请参阅Tool Calls 指南获取示例,并参阅JSON Schema 参考了解有关格式的文档。省略 parameters 会定义一个参数列表为空的 function。
strict: Option<bool>Beta 功能:如果设置为 true,API 将在函数调用中使用 strict 模式 如果设置为 true,API 将在函数调用中使用 strict 模式,以确保输出始终符合函数的 JSON schema 定义。该功能为 Beta 功能,详细使用方式请参阅Tool Calls 指南
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Function
impl<'de> Deserialize<'de> for Function
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 Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnsafeUnpin for Function
impl UnwindSafe for Function
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