Skip to main content

mermaid_cli/models/
mod.rs

1// Gateway module for models
2// All external access must go through this gateway
3
4// Core modules
5mod adapters;  // Provider adapters (Ollama, OpenAI-compatible)
6mod backend;   // Internal ModelFactory
7mod config;    // Unified configuration
8mod error;     // Structured error types
9mod factory;   // Public ModelFactory API
10mod traits;    // Model trait (public API)
11mod types;     // Core types (ChatMessage, etc)
12pub mod tool_call; // Tool call parsing (native function calling)
13pub mod tools;     // Tool definitions
14
15// Keep these for now (will migrate incrementally)
16mod lazy_context;
17
18// Public re-exports - the ONLY way to access model functionality
19pub use config::{BackendConfig, ModelConfig};
20pub use error::{BackendError, ConfigError, ErrorCategory, ModelError, Result, UserFacingError};
21pub use factory::ModelFactory;
22pub use lazy_context::{get_priority_files, LazyProjectContext};
23pub use traits::{Model, ModelCapabilities};
24pub use tool_call::{ToolCall, FunctionCall};
25pub use tools::{Tool, ToolFunction, ToolRegistry};
26pub use types::{
27    ChatMessage, MessageRole, ModelResponse, ProjectContext,
28    StreamCallback, TokenUsage,
29};