From 8fa9aaa151b0aeba6e6c26bfd09612c4d4217a26 Mon Sep 17 00:00:00 2001 From: Han Xiao Date: Thu, 20 Mar 2025 09:56:21 +0800 Subject: [PATCH] fix: gen obj retry --- jina-ai/config.json | 10 +++++----- src/agent.ts | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/jina-ai/config.json b/jina-ai/config.json index 32101c6..b5c366a 100644 --- a/jina-ai/config.json +++ b/jina-ai/config.json @@ -34,20 +34,20 @@ "models": { "gemini": { "default": { - "model": "gemini-2.0-flash-lite", + "model": "gemini-2.0-flash", "temperature": 0.6, "maxTokens": 8000 }, "tools": { - "coder": { "maxTokens": 2000 }, - "searchGrounding": { }, + "coder": { "maxTokens": 2000, "model": "gemini-2.0-flash-lite" }, + "searchGrounding": {}, "dedup": { }, "evaluator": {"maxTokens": 2000 }, "errorAnalyzer": {"maxTokens": 1000}, "queryRewriter": {"maxTokens": 2000}, - "agent": {"model": "gemini-2.0-flash" }, + "agent": {}, "agentBeastMode": {}, - "fallback": {"maxTokens": 8000} + "fallback": {"maxTokens": 8000, "model": "gemini-2.0-flash-lite"} } }, "openai": { diff --git a/src/agent.ts b/src/agent.ts index 8027b4f..2b49f97 100644 --- a/src/agent.ts +++ b/src/agent.ts @@ -508,7 +508,7 @@ export async function getResponse(question?: string, allowReflect = true; allowRead = true; allowSearch = true; - // allowCoding = true; + allowCoding = true; // execute the step and action if (thisStep.action === 'answer' && thisStep.answer) { @@ -562,6 +562,9 @@ export async function getResponse(question?: string, } if (currentQuestion.trim() === question) { + // disable coding for preventing answer degradation + allowCoding = false; + if (evaluation.pass) { diaryContext.push(` At step ${step}, you took **answer** action and finally found the answer to the original question: