Skip to main content

mistral_openapi_client/models/
agent_creation_request.rs

1/*
2 * Mistral AI API
3 *
4 * Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * 
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 AgentCreationRequest {
16    #[serde(rename = "instructions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
17    pub instructions: Option<Option<String>>,
18    /// List of tools which are available to the model during the conversation.
19    #[serde(rename = "tools", skip_serializing_if = "Option::is_none")]
20    pub tools: Option<Vec<models::ToolsInner>>,
21    /// Completion arguments that will be used to generate assistant responses. Can be overridden at each message request.
22    #[serde(rename = "completion_args", skip_serializing_if = "Option::is_none")]
23    pub completion_args: Option<Box<models::CompletionArgs>>,
24    #[serde(rename = "guardrails", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub guardrails: Option<Option<Vec<models::GuardrailConfig>>>,
26    #[serde(rename = "model")]
27    pub model: String,
28    #[serde(rename = "name")]
29    pub name: String,
30    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub description: Option<Option<String>>,
32    #[serde(rename = "handoffs", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33    pub handoffs: Option<Option<Vec<String>>>,
34    /// Custom type for metadata with embedded validation.
35    #[serde(rename = "metadata", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub metadata: Option<Option<std::collections::HashMap<String, serde_json::Value>>>,
37    #[serde(rename = "version_message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
38    pub version_message: Option<Option<String>>,
39}
40
41impl AgentCreationRequest {
42    pub fn new(model: String, name: String) -> AgentCreationRequest {
43        AgentCreationRequest {
44            instructions: None,
45            tools: None,
46            completion_args: None,
47            guardrails: None,
48            model,
49            name,
50            description: None,
51            handoffs: None,
52            metadata: None,
53            version_message: None,
54        }
55    }
56}
57