feat(layer1): replace httpx with OpenAIChatModel + OpenAIChatFormatter
Replace the raw httpx HTTP client with AgentScope's native OpenAIChatModel and OpenAIChatFormatter classes for model calls. Changes: - Remove `import httpx` and `_model_client` property - Add `self.model` (OpenAIChatModel) and `self.formatter` (OpenAIChatFormatter) - Add `_dict_to_msg()` helper to convert API dicts to Msg objects for the formatter - Rewrite `_call_model()` to use AgentScope model + formatter pipeline - Parse ChatResponse content blocks (TextBlock/ToolUseBlock) directly - `close()` becomes a no-op since AgentScope manages its own client lifecycle Verification: All 22 tests pass (14 agent_hub + 8 session_service_internal) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Showing
1 changed file
with
95 additions
and
58 deletions
-
Please register or sign in to post a comment