Skip to main content

mistral_openapi_client/models/
completion_args.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/// CompletionArgs : White-listed arguments from the completion API
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CompletionArgs {
17    #[serde(rename = "stop", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
18    pub stop: Option<Option<Box<models::CompletionArgsStop>>>,
19    #[serde(rename = "presence_penalty", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
20    pub presence_penalty: Option<Option<f64>>,
21    #[serde(rename = "frequency_penalty", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub frequency_penalty: Option<Option<f64>>,
23    #[serde(rename = "temperature", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub temperature: Option<Option<f64>>,
25    #[serde(rename = "top_p", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub top_p: Option<Option<f64>>,
27    #[serde(rename = "max_tokens", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub max_tokens: Option<Option<i32>>,
29    #[serde(rename = "random_seed", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub random_seed: Option<Option<i32>>,
31    #[serde(rename = "prediction", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub prediction: Option<Option<Box<models::Prediction>>>,
33    #[serde(rename = "response_format", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub response_format: Option<Option<Box<models::ResponseFormat>>>,
35    #[serde(rename = "tool_choice", skip_serializing_if = "Option::is_none")]
36    pub tool_choice: Option<models::ToolChoiceEnum>,
37}
38
39impl CompletionArgs {
40    /// White-listed arguments from the completion API
41    pub fn new() -> CompletionArgs {
42        CompletionArgs {
43            stop: None,
44            presence_penalty: None,
45            frequency_penalty: None,
46            temperature: None,
47            top_p: None,
48            max_tokens: None,
49            random_seed: None,
50            prediction: None,
51            response_format: None,
52            tool_choice: None,
53        }
54    }
55}
56