Skip to main content

cerebras_rs/models/
function_definition.rs

1/*
2 * Cerebras Inference API
3 *
4 * The Cerebras Inference API offers developers a low-latency solution for AI model inference  powered by Cerebras Wafer-Scale Engines and CS-3 systems. The API provides access to  high-performance language models with unprecedented speed for AI inference workloads. 
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * Contact: support@cerebras.ai
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct FunctionDefinition {
16    /// The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
17    #[serde(rename = "name")]
18    pub name: String,
19    /// A description of what the function does, used by the model to choose when and how to call the function.
20    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
21    pub description: Option<String>,
22    /// The parameters the function accepts, described as a JSON Schema object.
23    #[serde(rename = "parameters", skip_serializing_if = "Option::is_none")]
24    pub parameters: Option<std::collections::HashMap<String, serde_json::Value>>,
25}
26
27impl FunctionDefinition {
28    pub fn new(name: String) -> FunctionDefinition {
29        FunctionDefinition {
30            name,
31            description: None,
32            parameters: None,
33        }
34    }
35}
36