trieve_client/models/
edit_message_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 EditMessageReqPayload {
15    /// If concat user messages query is set to true, all of the user messages in the topic will be concatenated together and used as the search query. If not specified, this defaults to false. Default is false.
16    #[serde(rename = "concat_user_messages_query", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
17    pub concat_user_messages_query: Option<Option<bool>>,
18    #[serde(rename = "filters", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
19    pub filters: Option<Option<Box<models::ChunkFilter>>>,
20    #[serde(rename = "highlight_options", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub highlight_options: Option<Option<Box<models::HighlightOptions>>>,
22    #[serde(rename = "llm_options", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub llm_options: Option<Option<Box<models::LlmOptions>>>,
24    /// The sort order of the message to edit.
25    #[serde(rename = "message_sort_order")]
26    pub message_sort_order: i32,
27    /// The new content of the message to replace the old content with.
28    #[serde(rename = "new_message_content")]
29    pub new_message_content: String,
30    /// Page size is the number of chunks to fetch during RAG. If 0, then no search will be performed. If specified, this will override the N retrievals to include in the dataset configuration. Default is None.
31    #[serde(rename = "page_size", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub page_size: Option<Option<i64>>,
33    /// Set score_threshold to a float to filter out chunks with a score below the threshold. This threshold applies before weight and bias modifications. If not specified, this defaults to 0.0.
34    #[serde(rename = "score_threshold", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
35    pub score_threshold: Option<Option<f32>>,
36    /// Query is the search query. This can be any string. The search_query will be used to create a dense embedding vector and/or sparse vector which will be used to find the result set. If not specified, will default to the last user message or HyDE if HyDE is enabled in the dataset configuration. Default is None.
37    #[serde(rename = "search_query", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
38    pub search_query: Option<Option<String>>,
39    #[serde(rename = "search_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
40    pub search_type: Option<Option<models::SearchMethod>>,
41    /// The id of the topic to edit the message at the given sort order for.
42    #[serde(rename = "topic_id")]
43    pub topic_id: uuid::Uuid,
44    /// The user_id is the id of the user who is making the request. This is used to track user interactions with the RAG results.
45    #[serde(rename = "user_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
46    pub user_id: Option<Option<String>>,
47}
48
49impl EditMessageReqPayload {
50    pub fn new(message_sort_order: i32, new_message_content: String, topic_id: uuid::Uuid) -> EditMessageReqPayload {
51        EditMessageReqPayload {
52            concat_user_messages_query: None,
53            filters: None,
54            highlight_options: None,
55            llm_options: None,
56            message_sort_order,
57            new_message_content,
58            page_size: None,
59            score_threshold: None,
60            search_query: None,
61            search_type: None,
62            topic_id,
63            user_id: None,
64        }
65    }
66}
67