langgraph_api/generated/models/
assistant_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/// AssistantCreate : Payload for creating an assistant.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct AssistantCreate {
17    /// The ID of the assistant. If not provided, a random UUID will be generated.
18    #[serde(rename = "assistant_id", skip_serializing_if = "Option::is_none")]
19    pub assistant_id: Option<uuid::Uuid>,
20    /// The ID of the graph the assistant should use. The graph ID is normally set in your langgraph.json configuration.
21    #[serde(rename = "graph_id")]
22    pub graph_id: String,
23    /// Configuration to use for the graph. Useful when graph is configurable and you want to create different assistants based on different configurations.
24    #[serde(rename = "config", skip_serializing_if = "Option::is_none")]
25    pub config: Option<serde_json::Value>,
26    /// Static context added to the assistant.
27    #[serde(rename = "context", skip_serializing_if = "Option::is_none")]
28    pub context: Option<serde_json::Value>,
29    /// Metadata to add to assistant.
30    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
31    pub metadata: Option<serde_json::Value>,
32    /// How to handle duplicate creation. Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing assistant).
33    #[serde(rename = "if_exists", skip_serializing_if = "Option::is_none")]
34    pub if_exists: Option<IfExists>,
35    /// The name of the assistant. Defaults to 'Untitled'.
36    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
37    pub name: Option<String>,
38    /// The description of the assistant. Defaults to null.
39    #[serde(
40        rename = "description",
41        default,
42        with = "::serde_with::rust::double_option",
43        skip_serializing_if = "Option::is_none"
44    )]
45    pub description: Option<Option<String>>,
46}
47
48impl AssistantCreate {
49    /// Payload for creating an assistant.
50    pub fn new(graph_id: String) -> AssistantCreate {
51        AssistantCreate {
52            assistant_id: None,
53            graph_id,
54            config: None,
55            context: None,
56            metadata: None,
57            if_exists: None,
58            name: None,
59            description: None,
60        }
61    }
62}
63/// How to handle duplicate creation. Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing assistant).
64#[derive(
65    Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize,
66)]
67pub enum IfExists {
68    #[serde(rename = "raise")]
69    #[default]
70    Raise,
71    #[serde(rename = "do_nothing")]
72    DoNothing,
73}