langgraph_api/generated/models/
run.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 Run {
16    /// The ID of the run.
17    #[serde(rename = "run_id")]
18    pub run_id: uuid::Uuid,
19    /// The ID of the thread.
20    #[serde(rename = "thread_id")]
21    pub thread_id: uuid::Uuid,
22    /// The assistant that was used for this run.
23    #[serde(rename = "assistant_id")]
24    pub assistant_id: uuid::Uuid,
25    /// The time the run was created.
26    #[serde(rename = "created_at")]
27    pub created_at: String,
28    /// The last time the run was updated.
29    #[serde(rename = "updated_at")]
30    pub updated_at: String,
31    /// The status of the run. One of 'pending', 'running', 'error', 'success', 'timeout', 'interrupted'.
32    #[serde(rename = "status")]
33    pub status: Status,
34    /// The run metadata.
35    #[serde(rename = "metadata")]
36    pub metadata: serde_json::Value,
37    #[serde(rename = "kwargs")]
38    pub kwargs: serde_json::Value,
39    /// Strategy to handle concurrent runs on the same thread.
40    #[serde(rename = "multitask_strategy")]
41    pub multitask_strategy: MultitaskStrategy,
42}
43
44impl Run {
45    pub fn new(
46        run_id: uuid::Uuid,
47        thread_id: uuid::Uuid,
48        assistant_id: uuid::Uuid,
49        created_at: String,
50        updated_at: String,
51        status: Status,
52        metadata: serde_json::Value,
53        kwargs: serde_json::Value,
54        multitask_strategy: MultitaskStrategy,
55    ) -> Run {
56        Run {
57            run_id,
58            thread_id,
59            assistant_id,
60            created_at,
61            updated_at,
62            status,
63            metadata,
64            kwargs,
65            multitask_strategy,
66        }
67    }
68}
69/// The status of the run. One of 'pending', 'running', 'error', 'success', 'timeout', 'interrupted'.
70#[derive(
71    Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize,
72)]
73pub enum Status {
74    #[serde(rename = "pending")]
75    #[default]
76    Pending,
77    #[serde(rename = "running")]
78    Running,
79    #[serde(rename = "error")]
80    Error,
81    #[serde(rename = "success")]
82    Success,
83    #[serde(rename = "timeout")]
84    Timeout,
85    #[serde(rename = "interrupted")]
86    Interrupted,
87}
88/// Strategy to handle concurrent runs on the same thread.
89#[derive(
90    Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize,
91)]
92pub enum MultitaskStrategy {
93    #[serde(rename = "reject")]
94    #[default]
95    Reject,
96    #[serde(rename = "rollback")]
97    Rollback,
98    #[serde(rename = "interrupt")]
99    Interrupt,
100    #[serde(rename = "enqueue")]
101    Enqueue,
102}