mistral_rouille/models/embedding_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 * Build date: 2024-06-15T23:41:00.377209-06:00[America/Mexico_City]
7 * Generated using: https://openapi-generator.tech
8 * Open API specification v0.0.2 provided by Mistral @ https://docs.mistral.ai/redocusaurus/plugin-redoc-0.yaml
9 * Custom generation templates by [GovCraft Ai](https://www.govcraft.ai)
10 * Contact: roland@govcraft.ai
11 */
12
13use crate::models;
14use serde::{Deserialize, Serialize};
15
16#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
17pub struct EmbeddingRequest {
18 /// The ID of the model to use for this request.
19 #[serde(rename = "model", skip_serializing_if = "Option::is_none")]
20 pub model: Option<String>,
21 /// The list of strings to embed.
22 #[serde(rename = "input", skip_serializing_if = "Option::is_none")]
23 pub input: Option<Vec<String>>,
24 /// The format of the output data.
25 #[serde(rename = "encoding_format", skip_serializing_if = "Option::is_none")]
26 pub encoding_format: Option<EncodingFormat>,
27}
28
29impl EmbeddingRequest {
30 /// Creates a new `EmbeddingRequest` instance.
31 ///
32 /// # Arguments
33 ///
34 /// # Returns
35 ///
36 /// A new `EmbeddingRequest` instance.
37 pub fn new() -> EmbeddingRequest {
38 EmbeddingRequest {
39 model: None,
40 input: None,
41 encoding_format: None,
42 }
43 }
44}
45/// The format of the output data.
46#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
47pub enum EncodingFormat {
48 #[serde(rename = "float")]
49 Float,
50}
51
52impl Default for EncodingFormat {
53 fn default() -> EncodingFormat {
54 Self::Float
55 }
56}