From c1af32e6043a3128c891e3c9e4934bb36fe28955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=9D=E5=A4=95?= Date: Tue, 28 Apr 2026 10:06:33 +0800 Subject: [PATCH] Feat/deepseek adapter dropin 14224636701039833263 (#47) * feat: refactor DeepSeekReasonerAgent as a drop-in replacement for pydantic_ai Agent This refactor improves the `DeepSeekReasonerAgent` adapter to be a robust, drop-in replacement for native PydanticAI Agents. It brings several enhancements: 1. Re-implemented `run()` to manually inject historical messages (`message_history`) and dependencies, preserving state across workflows. 2. Replaced the simplistic crash loop with an explicit, manual multi-turn retry mechanism. If the Markdown JSON parser fails, it correctly injects the `ValidationError` back into the conversation history and prompts the model to correct its structure up to `retries` times. 3. Designed an elegant proxy `AgentRunResultProxy` to seamlessly wrap `AgentRunResult` outputs. This cleanly passes through downstream calls (e.g., `result.data`, `result.usage()`, `result.all_messages()`) avoiding `AttributeError`s and Monkey-patching. 4. Integrated fallback tool descriptions parsing, dynamically instructing the model on available tools. 5. Adapted `AgentFactory` to correctly propagate `tools` and `retries`. Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com> * feat: add deepseek provider option to frontend - Added 'deepseek' option to `ProvidersSettings.tsx` ` diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts index 7b57e59..662d5fe 100644 --- a/frontend/src/types/index.ts +++ b/frontend/src/types/index.ts @@ -14,7 +14,7 @@ export interface User { // Provider types export interface Provider { - provider_type: 'openai' | 'gemini' | 'claude' | 'local'; + provider_type: 'openai' | 'gemini' | 'claude' | 'local' | 'deepseek'; provider_title: string; provider_url?: string; provider_owner?: string; @@ -25,7 +25,7 @@ export interface Provider { } export interface ProviderRegisterRequest { - provider_type: 'openai' | 'gemini' | 'claude' | 'local'; + provider_type: 'openai' | 'gemini' | 'claude' | 'local' | 'deepseek'; provider_title: string; provider_url: string; provider_apikey: string;