thiggle_client/models/
categorize_request.rs

1/*
2 * Thiggle API
3 *
4 * API for categorizing data with LLMs
5 *
6 * The version of the OpenAPI document: 0.0.1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct CategorizeRequest {
16    /// The prompt that describes the classification task.
17    #[serde(rename = "prompt")]
18    pub prompt: String,
19    /// The list of categories to be considered for the task
20    #[serde(rename = "categories")]
21    pub categories: Vec<String>,
22    /// If true, the model may return an empty list of categories
23    #[serde(rename = "allow_null_category", skip_serializing_if = "Option::is_none")]
24    pub allow_null_category: Option<bool>,
25    /// If true, the model may return multiple categories
26    #[serde(rename = "allow_multiple_classes", skip_serializing_if = "Option::is_none")]
27    pub allow_multiple_classes: Option<bool>,
28}
29
30impl CategorizeRequest {
31    pub fn new(prompt: String, categories: Vec<String>) -> CategorizeRequest {
32        CategorizeRequest {
33            prompt,
34            categories,
35            allow_null_category: None,
36            allow_multiple_classes: None,
37        }
38    }
39}
40
41