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
/*
* langfuse
*
* ## Authentication Authenticate with the API using [Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication), get API keys in the project settings: - username: Langfuse Public Key - password: Langfuse Secret Key ## Exports - OpenAPI spec: https://cloud.langfuse.com/generated/api/openapi.yml - Postman collection: https://cloud.langfuse.com/generated/postman/collection.json
*
* The version of the OpenAPI document:
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateModelRequest {
/// Name of the model definition. If multiple with the same name exist, they are applied in the following order: (1) custom over built-in, (2) newest according to startTime where model.startTime<observation.startTime
#[serde(rename = "modelName")]
pub model_name: String,
/// Regex pattern which matches this model definition to generation.model. Useful in case of fine-tuned models. If you want to exact match, use `(?i)^modelname$`
#[serde(rename = "matchPattern")]
pub match_pattern: String,
/// Apply only to generations which are newer than this ISO date.
#[serde(rename = "startDate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub start_date: Option<Option<String>>,
#[serde(rename = "unit", skip_serializing_if = "Option::is_none")]
pub unit: Option<models::ModelUsageUnit>,
/// Price (USD) per input unit
#[serde(rename = "inputPrice", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub input_price: Option<Option<f64>>,
/// Price (USD) per output unit
#[serde(rename = "outputPrice", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub output_price: Option<Option<f64>>,
/// Price (USD) per total units. Cannot be set if input or output price is set.
#[serde(rename = "totalPrice", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub total_price: Option<Option<f64>>,
/// Optional. Tokenizer to be applied to observations which match to this model. See docs for more details.
#[serde(rename = "tokenizerId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub tokenizer_id: Option<Option<String>>,
/// Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details.
#[serde(rename = "tokenizerConfig", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub tokenizer_config: Option<Option<serde_json::Value>>,
}
impl CreateModelRequest {
pub fn new(model_name: String, match_pattern: String) -> CreateModelRequest {
CreateModelRequest {
model_name,
match_pattern,
start_date: None,
unit: None,
input_price: None,
output_price: None,
total_price: None,
tokenizer_id: None,
tokenizer_config: None,
}
}
}