langgraph_api/generated/models/
run_create_stateless.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/// RunCreateStateless : Payload for creating a run.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct RunCreateStateless {
17    #[serde(rename = "assistant_id")]
18    pub assistant_id: Box<models::RunCreateStatefulAssistantId>,
19    #[serde(
20        rename = "input",
21        default,
22        with = "::serde_with::rust::double_option",
23        skip_serializing_if = "Option::is_none"
24    )]
25    pub input: Option<Option<Box<models::Input1>>>,
26    #[serde(
27        rename = "command",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub command: Option<Option<Box<models::Command>>>,
33    /// Metadata to assign to the run.
34    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
35    pub metadata: Option<serde_json::Value>,
36    #[serde(rename = "config", skip_serializing_if = "Option::is_none")]
37    pub config: Option<Box<models::Config3>>,
38    /// Static context added to the assistant.
39    #[serde(rename = "context", skip_serializing_if = "Option::is_none")]
40    pub context: Option<serde_json::Value>,
41    /// Webhook to call after LangGraph API call is done.
42    #[serde(rename = "webhook", skip_serializing_if = "Option::is_none")]
43    pub webhook: Option<String>,
44    #[serde(rename = "stream_mode", skip_serializing_if = "Option::is_none")]
45    pub stream_mode: Option<Box<models::StreamMode>>,
46    /// Feedback keys to assign to run.
47    #[serde(rename = "feedback_keys", skip_serializing_if = "Option::is_none")]
48    pub feedback_keys: Option<Vec<String>>,
49    /// Whether to stream output from subgraphs.
50    #[serde(rename = "stream_subgraphs", skip_serializing_if = "Option::is_none")]
51    pub stream_subgraphs: Option<bool>,
52    /// Whether to persist the stream chunks in order to resume the stream later.
53    #[serde(rename = "stream_resumable", skip_serializing_if = "Option::is_none")]
54    pub stream_resumable: Option<bool>,
55    /// Whether to delete or keep the thread created for a stateless run. Must be one of 'delete' or 'keep'.
56    #[serde(rename = "on_completion", skip_serializing_if = "Option::is_none")]
57    pub on_completion: Option<OnCompletion>,
58    /// The disconnect mode to use. Must be one of 'cancel' or 'continue'.
59    #[serde(rename = "on_disconnect", skip_serializing_if = "Option::is_none")]
60    pub on_disconnect: Option<OnDisconnect>,
61    /// The number of seconds to wait before starting the run. Use to schedule future runs.
62    #[serde(rename = "after_seconds", skip_serializing_if = "Option::is_none")]
63    pub after_seconds: Option<f64>,
64    /// Whether to checkpoint during the run.
65    #[serde(rename = "checkpoint_during", skip_serializing_if = "Option::is_none")]
66    pub checkpoint_during: Option<bool>,
67    /// Durability level for the run. Must be one of 'sync', 'async', or 'exit'.
68    #[serde(rename = "durability", skip_serializing_if = "Option::is_none")]
69    pub durability: Option<Durability>,
70}
71
72impl RunCreateStateless {
73    /// Payload for creating a run.
74    pub fn new(assistant_id: models::RunCreateStatefulAssistantId) -> RunCreateStateless {
75        RunCreateStateless {
76            assistant_id: Box::new(assistant_id),
77            input: None,
78            command: None,
79            metadata: None,
80            config: None,
81            context: None,
82            webhook: None,
83            stream_mode: None,
84            feedback_keys: None,
85            stream_subgraphs: None,
86            stream_resumable: None,
87            on_completion: None,
88            on_disconnect: None,
89            after_seconds: None,
90            checkpoint_during: None,
91            durability: None,
92        }
93    }
94}
95/// Whether to delete or keep the thread created for a stateless run. Must be one of 'delete' or 'keep'.
96#[derive(
97    Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize,
98)]
99pub enum OnCompletion {
100    #[serde(rename = "delete")]
101    #[default]
102    Delete,
103    #[serde(rename = "keep")]
104    Keep,
105}
106/// The disconnect mode to use. Must be one of 'cancel' or 'continue'.
107#[derive(
108    Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize,
109)]
110pub enum OnDisconnect {
111    #[serde(rename = "cancel")]
112    #[default]
113    Cancel,
114    #[serde(rename = "continue")]
115    Continue,
116}
117/// Durability level for the run. Must be one of 'sync', 'async', or 'exit'.
118#[derive(
119    Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize,
120)]
121pub enum Durability {
122    #[serde(rename = "sync")]
123    #[default]
124    Sync,
125    #[serde(rename = "async")]
126    Async,
127    #[serde(rename = "exit")]
128    Exit,
129}