use std::sync::Arc; use async_trait::async_trait; use crate::{ Result, llm::ChatStream, mcp::{McpToolCall, McpToolDescriptor, McpToolResponse}, types::{ChatRequest, ChatResponse, ModelInfo}, }; /// Object-safe facade for interacting with LLM backends. #[async_trait] pub trait LlmClient: Send + Sync { /// List the models exposed by this client. async fn list_models(&self) -> Result>; /// Issue a one-shot chat request and wait for the complete response. async fn send_chat(&self, request: ChatRequest) -> Result; /// Stream chat responses incrementally. async fn stream_chat(&self, request: ChatRequest) -> Result; /// Enumerate tools exposed by the backing provider. async fn list_tools(&self) -> Result>; /// Invoke a tool exposed by the provider. async fn call_tool(&self, call: McpToolCall) -> Result; } /// Convenience alias for trait-object clients. pub type DynLlmClient = Arc;