Skip to main content

mistral_openapi_client/models/
conversation_restart_request_base.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/// ConversationRestartRequestBase : Request to restart a new conversation from a given entry in the conversation.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ConversationRestartRequestBase {
17    #[serde(rename = "inputs", skip_serializing_if = "Option::is_none")]
18    pub inputs: Option<Box<models::ConversationInputs>>,
19    /// Whether to stream back partial progress. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.
20    #[serde(rename = "stream", skip_serializing_if = "Option::is_none")]
21    pub stream: Option<bool>,
22    /// Whether to store the results into our servers or not.
23    #[serde(rename = "store", skip_serializing_if = "Option::is_none")]
24    pub store: Option<bool>,
25    #[serde(rename = "handoff_execution", skip_serializing_if = "Option::is_none")]
26    pub handoff_execution: Option<HandoffExecution>,
27    /// Completion arguments that will be used to generate assistant responses. Can be overridden at each message request.
28    #[serde(rename = "completion_args", skip_serializing_if = "Option::is_none")]
29    pub completion_args: Option<Box<models::CompletionArgs>>,
30    #[serde(rename = "guardrails", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub guardrails: Option<Option<Vec<models::GuardrailConfig>>>,
32    /// Custom type for metadata with embedded validation.
33    #[serde(rename = "metadata", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub metadata: Option<Option<std::collections::HashMap<String, serde_json::Value>>>,
35    #[serde(rename = "from_entry_id")]
36    pub from_entry_id: String,
37    #[serde(rename = "agent_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
38    pub agent_version: Option<Option<Box<models::AgentVersion2>>>,
39}
40
41impl ConversationRestartRequestBase {
42    /// Request to restart a new conversation from a given entry in the conversation.
43    pub fn new(from_entry_id: String) -> ConversationRestartRequestBase {
44        ConversationRestartRequestBase {
45            inputs: None,
46            stream: None,
47            store: None,
48            handoff_execution: None,
49            completion_args: None,
50            guardrails: None,
51            metadata: None,
52            from_entry_id,
53            agent_version: None,
54        }
55    }
56}
57/// 
58#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
59pub enum HandoffExecution {
60    #[serde(rename = "client")]
61    Client,
62    #[serde(rename = "server")]
63    Server,
64}
65
66impl Default for HandoffExecution {
67    fn default() -> HandoffExecution {
68        Self::Client
69    }
70}
71