defect_agent/llm.rs
1//! LLM provider abstraction.
2//!
3//! The protocol-level types (chunk / request / model / capability / error / provider) now
4//! live in `defect-core::llm` so `defect-llm` can implement providers without depending on
5//! the agent runtime. They are re-exported here so existing `defect_agent::llm::*` paths
6//! keep working.
7//!
8//! The `registry` module stays in this crate: it depends on the session capabilities
9//! config (a runtime concern) and is not needed by the provider implementations.
10
11pub(crate) mod registry;
12
13// Protocol types from defect-core, re-exported under the original `defect_agent::llm::*`
14// paths so call sites are unaffected.
15pub use defect_core::llm::{
16 Capabilities, CompletionRequest, FeatureSupport, HostedCapabilities, ImageData, LlmProvider,
17 Message, MessageContent, ModelCapabilityOverrides, ModelInfo, ProtocolId, ProviderActivityKind,
18 ProviderChunk, ProviderError, ProviderErrorKind, ProviderInfo, ProviderStream, RateLimitScope,
19 ReasoningEffort, RetryAction, RetryHint, Role, SamplingParams, StopReason, ThinkingConfig,
20 ThinkingEcho, TimeoutPhase, ToolChoice, ToolResultBody, ToolResultContent, Usage,
21};
22
23// Registry stays local (depends on `crate::session::SessionCapabilitiesConfig`).
24pub use registry::{ModelCandidate, ProviderEntry, ProviderRegistry, ProviderRegistryError};