trieve_client/models/
create_topic_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 CreateTopicReqPayload {
15    /// The first message which will belong to the topic. The topic name is generated based on this message similar to how it works in the OpenAI chat UX if a name is not explicitly provided on the name request body key.
16    #[serde(rename = "first_user_message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
17    pub first_user_message: Option<Option<String>>,
18    /// The name of the topic. If this is not provided, the topic name is generated from the first_user_message.
19    #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
20    pub name: Option<Option<String>>,
21    /// The owner_id of the topic. This is typically a browser fingerprint or your user's id. It is used to group topics together for a user.
22    #[serde(rename = "owner_id")]
23    pub owner_id: String,
24}
25
26impl CreateTopicReqPayload {
27    pub fn new(owner_id: String) -> CreateTopicReqPayload {
28        CreateTopicReqPayload {
29            first_user_message: None,
30            name: None,
31            owner_id,
32        }
33    }
34}
35