Files
zesdex/src/dto/provider/request.rs
T
asepharyana 3dee2a1427 Refactor API integration and enhance command handling
- Removed unused modules and updated module paths for clarity.
- Added autocomplete functionality for command input in InputState.
- Updated AppStateRest to include a method for checking if a turn is in flight.
- Refactored subagent engine to use new API client structure.
- Changed default provider from "openrouter" to "zen" with updated API keys and models.
- Implemented tests for memory management and edit log functionalities.
- Enhanced error handling in API requests and improved response parsing.
- Updated UI components to reflect new API provider and status indicators.
2026-07-11 22:10:17 +07:00

35 lines
1.0 KiB
Rust

use serde::{Deserialize, Serialize};
use serde_json::Value;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChatRequest {
pub model: String,
pub messages: Vec<super::super::chat::message::ChatMessage>,
#[serde(skip_serializing_if = "Option::is_none")]
pub max_tokens: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub temperature: Option<f32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tools: Option<Vec<ToolDef>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stream: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub top_p: Option<f32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stop: Option<Vec<String>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ToolDef {
#[serde(rename = "type")]
pub type_: String,
pub function: ToolFunctionDef,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ToolFunctionDef {
pub name: String,
pub description: String,
pub parameters: Value,
}