trieve_client/models/
recommend_chunks_request.rs

1/*
2 * Trieve API
3 *
4 * Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5 *
6 * The version of the OpenAPI document: 0.11.7
7 * Contact: developers@trieve.ai
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
14pub struct RecommendChunksRequest {
15    #[serde(rename = "filters", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
16    pub filters: Option<Option<Box<models::ChunkFilter>>>,
17    /// The number of chunks to return. This is the number of chunks which will be returned in the response. The default is 10.
18    #[serde(rename = "limit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
19    pub limit: Option<Option<i64>>,
20    /// The ids of the chunks to be used as negative examples for the recommendation. The chunks in this array will be used to filter out similar chunks.
21    #[serde(rename = "negative_chunk_ids", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub negative_chunk_ids: Option<Option<Vec<uuid::Uuid>>>,
23    /// The tracking_ids of the chunks to be used as negative examples for the recommendation. The chunks in this array will be used to filter out similar chunks.
24    #[serde(rename = "negative_tracking_ids", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub negative_tracking_ids: Option<Option<Vec<String>>>,
26    /// The ids of the chunks to be used as positive examples for the recommendation. The chunks in this array will be used to find similar chunks.
27    #[serde(rename = "positive_chunk_ids", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub positive_chunk_ids: Option<Option<Vec<uuid::Uuid>>>,
29    /// The tracking_ids of the chunks to be used as positive examples for the recommendation. The chunks in this array will be used to find similar chunks.
30    #[serde(rename = "positive_tracking_ids", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub positive_tracking_ids: Option<Option<Vec<String>>>,
32    #[serde(rename = "recommend_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33    pub recommend_type: Option<Option<models::RecommendType>>,
34    /// Set slim_chunks to true to avoid returning the content and chunk_html of the chunks. This is useful for when you want to reduce amount of data over the wire for latency improvement (typicall 10-50ms). Default is false.
35    #[serde(rename = "slim_chunks", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub slim_chunks: Option<Option<bool>>,
37    #[serde(rename = "strategy", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
38    pub strategy: Option<Option<models::RecommendationStrategy>>,
39    /// User ID is the id of the user who is making the request. This is used to track user interactions with the recommendation results.
40    #[serde(rename = "user_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
41    pub user_id: Option<Option<String>>,
42}
43
44impl RecommendChunksRequest {
45    pub fn new() -> RecommendChunksRequest {
46        RecommendChunksRequest {
47            filters: None,
48            limit: None,
49            negative_chunk_ids: None,
50            negative_tracking_ids: None,
51            positive_chunk_ids: None,
52            positive_tracking_ids: None,
53            recommend_type: None,
54            slim_chunks: None,
55            strategy: None,
56            user_id: None,
57        }
58    }
59}
60