langgraph_api/generated/models/
thread.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Thread {
16    /// The ID of the thread.
17    #[serde(rename = "thread_id")]
18    pub thread_id: uuid::Uuid,
19    /// The time the thread was created.
20    #[serde(rename = "created_at")]
21    pub created_at: String,
22    /// The last time the thread was updated.
23    #[serde(rename = "updated_at")]
24    pub updated_at: String,
25    /// The thread metadata.
26    #[serde(rename = "metadata")]
27    pub metadata: serde_json::Value,
28    /// The thread config.
29    #[serde(rename = "config", skip_serializing_if = "Option::is_none")]
30    pub config: Option<serde_json::Value>,
31    /// The status of the thread.
32    #[serde(rename = "status")]
33    pub status: Status,
34    /// The current state of the thread.
35    #[serde(rename = "values", skip_serializing_if = "Option::is_none")]
36    pub values: Option<serde_json::Value>,
37    /// The current interrupts of the thread.
38    #[serde(rename = "interrupts", skip_serializing_if = "Option::is_none")]
39    pub interrupts: Option<serde_json::Value>,
40}
41
42impl Thread {
43    pub fn new(
44        thread_id: uuid::Uuid,
45        created_at: String,
46        updated_at: String,
47        metadata: serde_json::Value,
48        status: Status,
49    ) -> Thread {
50        Thread {
51            thread_id,
52            created_at,
53            updated_at,
54            metadata,
55            config: None,
56            status,
57            values: None,
58            interrupts: None,
59        }
60    }
61}
62/// The status of the thread.
63#[derive(
64    Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize,
65)]
66pub enum Status {
67    #[serde(rename = "idle")]
68    #[default]
69    Idle,
70    #[serde(rename = "busy")]
71    Busy,
72    #[serde(rename = "interrupted")]
73    Interrupted,
74    #[serde(rename = "error")]
75    Error,
76}