1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
use serde::{Deserialize, Serialize};

#[derive(Debug, Deserialize, Serialize)]
pub struct Mixtral8x7bInstruct {
    pub temperature: f32,
    pub top_p: f32,
    pub top_k: i32,
    pub max_tokens: i32,
    pub stop: Vec<String>,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct Mistral7bInstruct {
    pub temperature: f32,
    pub top_p: f32,
    pub top_k: i32,
    pub max_tokens: i32,
    pub stop: Vec<String>,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct MistralLarge {
    pub temperature: f32,
    pub top_p: f32,
    pub top_k: i32,
    pub max_tokens: i32,
    pub stop: Vec<String>,
}

#[derive(serde::Serialize, Debug)]
pub struct Mistral7Body {
    pub prompt: String,
    pub temperature: f32,
    pub top_p: f32,
    pub top_k: i32,
    pub max_tokens: i32,
    pub stop: Vec<String>,
}

impl Mistral7Body {
    pub fn new(
        prompt: String,
        temperature: f32,
        top_p: f32,
        top_k: i32,
        max_tokens: i32,
        stop: Vec<String>,
    ) -> Mistral7Body {
        Mistral7Body {
            prompt,
            temperature,
            top_p,
            top_k,
            max_tokens,
            stop,
        }
    }
}

#[derive(serde::Deserialize, Debug)]
pub struct Mistral7Results {
    pub outputs: Vec<Mistral7Outputs>,
}

#[derive(serde::Deserialize, Debug)]
pub struct Mistral7Outputs {
    pub text: String,
}