Harden DeepSeek agent: LiteLLM adapter, DSML/reasoning/embeddings/error fixes
- LiteLLMAdapter (subclasses OpenAIAdapter via _acreate hook): routes DeepSeek through LiteLLM. Opt-in AGENTIC_DEFAULT_MODEL_PROVIDER=litellm. A/B beat the hand-rolled adapter (0 DSML, 0 parse-fails). Defensive chunk.usage getattr, token-estimate usage fallback for billing, quiet litellm logs. - DSML parser: tolerate single/multi fullwidth pipes, honor string="true/false" typed args (openai_adapter fallback when DeepSeek leaks tool calls as text). - Thinking mode: capture and round-trip reasoning_content across turns. - Embeddings: dedicated AGENTIC_EMBEDDINGS_API_KEY (DeepSeek has no embeddings); disable cleanly when unset to avoid per-turn 401. - claude_format: friendly generic error messages to the chat, raw only in logs. - acai agent max_tokens 4096->16384 (whole-file writes no longer truncate); system.md size-based edit policy; strict tools opt-in (off). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ pydantic-settings>=2.7.0,<3.0.0
|
||||
redis[hiredis]>=5.2.0,<6.0.0
|
||||
anthropic>=0.42.0,<1.0.0
|
||||
openai>=1.60.0,<2.0.0
|
||||
litellm>=1.50.0,<2.0.0
|
||||
httpx>=0.28.0,<1.0.0
|
||||
sse-starlette>=2.2.0,<3.0.0
|
||||
tiktoken>=0.7.0,<1.0.0
|
||||
|
||||
Reference in New Issue
Block a user