llmrix-rust-sdk 1.0.0

Official Rust SDK for the llmrix AI Agent Platform API
Documentation
use serde::{Deserialize, Serialize};

/// A Llmrix chat thread.
#[derive(Debug, Clone, Deserialize, Default)]
pub struct Conversation {
    pub seq: String,
    pub id: String,
    pub title: String,
    #[serde(default)]
    pub agent_id: String,
    pub created_at: String,
    pub updated_at: String,
}

/// Request body for creating a conversation.
#[derive(Debug, Serialize)]
pub struct ConversationCreateRequest {
    pub title: String,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub agent_id: Option<String>,
}

/// Request body for updating a conversation.
#[derive(Debug, Default, Serialize)]
pub struct ConversationUpdateRequest {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
}

/// A single message within a conversation.
#[derive(Debug, Clone, Deserialize, Default)]
pub struct Message {
    pub seq: i64,
    pub id: String,
    /// `"user"` | `"assistant"` | `"tool"` | `"system"`
    pub role: String,
    pub content: String,
    #[serde(default)]
    pub tool_calls: Vec<ToolCall>,
}

/// A tool invocation embedded in an assistant message.
#[derive(Debug, Clone, Deserialize, Default)]
pub struct ToolCall {
    pub id: String,
    pub name: String,
    pub args: serde_json::Value,
}

/// Generic cursor-paginated list returned by list endpoints.
#[derive(Debug, Clone, Deserialize)]
pub struct PageResult<T> {
    pub items: Vec<T>,
    pub has_more: bool,
}