langgraph-api 0.1.1

Rust Client API of LangGraph
Documentation
/*
 * 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,
}