fix: gen obj retry

This commit is contained in:
Han Xiao
2025-03-20 09:56:21 +08:00
parent 2cf9061a39
commit 8fa9aaa151
2 changed files with 9 additions and 6 deletions

View File

@@ -34,20 +34,20 @@
"models": { "models": {
"gemini": { "gemini": {
"default": { "default": {
"model": "gemini-2.0-flash-lite", "model": "gemini-2.0-flash",
"temperature": 0.6, "temperature": 0.6,
"maxTokens": 8000 "maxTokens": 8000
}, },
"tools": { "tools": {
"coder": { "maxTokens": 2000 }, "coder": { "maxTokens": 2000, "model": "gemini-2.0-flash-lite" },
"searchGrounding": { }, "searchGrounding": {},
"dedup": { }, "dedup": { },
"evaluator": {"maxTokens": 2000 }, "evaluator": {"maxTokens": 2000 },
"errorAnalyzer": {"maxTokens": 1000}, "errorAnalyzer": {"maxTokens": 1000},
"queryRewriter": {"maxTokens": 2000}, "queryRewriter": {"maxTokens": 2000},
"agent": {"model": "gemini-2.0-flash" }, "agent": {},
"agentBeastMode": {}, "agentBeastMode": {},
"fallback": {"maxTokens": 8000} "fallback": {"maxTokens": 8000, "model": "gemini-2.0-flash-lite"}
} }
}, },
"openai": { "openai": {

View File

@@ -508,7 +508,7 @@ export async function getResponse(question?: string,
allowReflect = true; allowReflect = true;
allowRead = true; allowRead = true;
allowSearch = true; allowSearch = true;
// allowCoding = true; allowCoding = true;
// execute the step and action // execute the step and action
if (thisStep.action === 'answer' && thisStep.answer) { if (thisStep.action === 'answer' && thisStep.answer) {
@@ -562,6 +562,9 @@ export async function getResponse(question?: string,
} }
if (currentQuestion.trim() === question) { if (currentQuestion.trim() === question) {
// disable coding for preventing answer degradation
allowCoding = false;
if (evaluation.pass) { if (evaluation.pass) {
diaryContext.push(` diaryContext.push(`
At step ${step}, you took **answer** action and finally found the answer to the original question: At step ${step}, you took **answer** action and finally found the answer to the original question: