refactor(provider): unify Provider responses with ChatResponse

- Switch Provider trait methods to return structured ChatResponse
- Map OpenAI-compatible tool_calls into shared ToolCall type
- Update reliable/router wrappers and provider tests for new interface
- Make agent loop prefer structured tool calls with text fallback parsing
- Adapt gateway replies to structured responses with safe tool-call fallback
This commit is contained in:
chumyin 2026-02-16 13:04:10 +08:00 committed by Chummy
parent b3fcdad3b5
commit 3b4a4de457
12 changed files with 260 additions and 118 deletions

View file

@ -8,7 +8,7 @@ pub mod reliable;
pub mod router;
pub mod traits;
pub use traits::{ChatMessage, Provider};
pub use traits::{ChatMessage, ChatResponse, Provider, ToolCall};
use compatible::{AuthStyle, OpenAiCompatibleProvider};
use reliable::ReliableProvider;