trieve_client/models/
recommend_groups_req_payload.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 RecommendGroupsReqPayload {
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 fetch for each group. This is the number of chunks which will be returned in the response for each group. The default is 3. If this is set to a large number, we recommend setting slim_chunks to true to avoid returning the content and chunk_html of the chunks so as to reduce latency due to content download and serialization.
18    #[serde(rename = "group_size", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
19    pub group_size: Option<Option<i32>>,
20    /// The number of groups to return. This is the number of groups which will be returned in the response. The default is 10.
21    #[serde(rename = "limit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub limit: Option<Option<i64>>,
23    /// The ids of the groups to be used as negative examples for the recommendation. The groups in this array will be used to filter out similar groups.
24    #[serde(rename = "negative_group_ids", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub negative_group_ids: Option<Option<Vec<uuid::Uuid>>>,
26    /// The ids of the groups to be used as negative examples for the recommendation. The groups in this array will be used to filter out similar groups.
27    #[serde(rename = "negative_group_tracking_ids", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub negative_group_tracking_ids: Option<Option<Vec<String>>>,
29    /// The ids of the groups to be used as positive examples for the recommendation. The groups in this array will be used to find similar groups.
30    #[serde(rename = "positive_group_ids", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub positive_group_ids: Option<Option<Vec<uuid::Uuid>>>,
32    /// The ids of the groups to be used as positive examples for the recommendation. The groups in this array will be used to find similar groups.
33    #[serde(rename = "positive_group_tracking_ids", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub positive_group_tracking_ids: Option<Option<Vec<String>>>,
35    #[serde(rename = "recommend_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub recommend_type: Option<Option<models::RecommendType>>,
37    /// 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.
38    #[serde(rename = "slim_chunks", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
39    pub slim_chunks: Option<Option<bool>>,
40    #[serde(rename = "strategy", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
41    pub strategy: Option<Option<models::RecommendationStrategy>>,
42    /// The user_id is the id of the user who is making the request. This is used to track user interactions with the rrecommendation results.
43    #[serde(rename = "user_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
44    pub user_id: Option<Option<String>>,
45}
46
47impl RecommendGroupsReqPayload {
48    pub fn new() -> RecommendGroupsReqPayload {
49        RecommendGroupsReqPayload {
50            filters: None,
51            group_size: None,
52            limit: None,
53            negative_group_ids: None,
54            negative_group_tracking_ids: None,
55            positive_group_ids: None,
56            positive_group_tracking_ids: None,
57            recommend_type: None,
58            slim_chunks: None,
59            strategy: None,
60            user_id: None,
61        }
62    }
63}
64