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