pub mod anthropic; pub mod gemini; pub mod mistral; pub mod ollama; pub mod openai; pub mod provider; pub mod tools; pub use provider::*; pub use tools::*; use serde::{Deserialize, Serialize}; use std::collections::HashMap; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Message { pub role: String, pub content: String, #[serde(skip_serializing_if = "Option::is_none")] pub tool_call_id: Option, #[serde(skip_serializing_if = "Option::is_none")] pub tool_calls: Option>, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ChatResponse { pub content: String, pub model: String, pub usage: Option, #[serde(skip_serializing_if = "Option::is_none")] pub tool_calls: Option>, } /// Represents a tool call made by the AI #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ToolCall { pub id: String, pub name: String, pub arguments: String, // JSON string } /// Tool definition that describes available functions to the AI #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Tool { pub name: String, pub description: String, pub parameters: ToolParameters, } /// JSON Schema-style parameter definition for tools #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ToolParameters { #[serde(rename = "type")] pub param_type: String, // Usually "object" pub properties: HashMap, pub required: Vec, } /// Individual parameter property definition #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ParameterProperty { #[serde(rename = "type")] pub prop_type: String, // "string", "number", "integer", "boolean" pub description: String, #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "enum")] pub enum_values: Option>, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct TokenUsage { pub prompt_tokens: u32, pub completion_tokens: u32, pub total_tokens: u32, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct AnalysisResult { pub summary: String, pub key_findings: Vec, pub suggested_why1: String, pub severity_assessment: String, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProviderInfo { pub name: String, pub supports_streaming: bool, pub models: Vec, }