langgraph_api/generated/models/
thread_create.rs

1/*
2 * LangSmith Deployment
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 0.1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ThreadCreate : Payload for creating a thread.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ThreadCreate {
17    /// The ID of the thread. If not provided, a random UUID will be generated.
18    #[serde(rename = "thread_id", skip_serializing_if = "Option::is_none")]
19    pub thread_id: Option<uuid::Uuid>,
20    /// Metadata to add to thread.
21    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
22    pub metadata: Option<serde_json::Value>,
23    /// How to handle duplicate creation. Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing thread).
24    #[serde(rename = "if_exists", skip_serializing_if = "Option::is_none")]
25    pub if_exists: Option<IfExists>,
26    #[serde(rename = "ttl", skip_serializing_if = "Option::is_none")]
27    pub ttl: Option<Box<models::Ttl>>,
28    #[serde(rename = "supersteps", skip_serializing_if = "Option::is_none")]
29    pub supersteps: Option<Vec<models::ThreadCreateSuperstepsInner>>,
30}
31
32impl ThreadCreate {
33    /// Payload for creating a thread.
34    pub fn new() -> ThreadCreate {
35        ThreadCreate {
36            thread_id: None,
37            metadata: None,
38            if_exists: None,
39            ttl: None,
40            supersteps: None,
41        }
42    }
43}
44/// How to handle duplicate creation. Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing thread).
45#[derive(
46    Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize,
47)]
48pub enum IfExists {
49    #[serde(rename = "raise")]
50    #[default]
51    Raise,
52    #[serde(rename = "do_nothing")]
53    DoNothing,
54}