mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
chore: migrate from responseSchema to use responseJsonSchema. (#4814)
This commit is contained in:
@@ -9,7 +9,6 @@ import { GeminiEventType, ServerGeminiStreamEvent } from '../core/turn.js';
|
||||
import { logLoopDetected } from '../telemetry/loggers.js';
|
||||
import { LoopDetectedEvent, LoopType } from '../telemetry/types.js';
|
||||
import { Config, DEFAULT_GEMINI_FLASH_MODEL } from '../config/config.js';
|
||||
import { SchemaUnion, Type } from '@google/genai';
|
||||
|
||||
const TOOL_CALL_LOOP_THRESHOLD = 5;
|
||||
const CONTENT_LOOP_THRESHOLD = 10;
|
||||
@@ -341,16 +340,16 @@ Please analyze the conversation history to determine the possibility that the co
|
||||
...recentHistory,
|
||||
{ role: 'user', parts: [{ text: prompt }] },
|
||||
];
|
||||
const schema: SchemaUnion = {
|
||||
type: Type.OBJECT,
|
||||
const schema: Record<string, unknown> = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
reasoning: {
|
||||
type: Type.STRING,
|
||||
type: 'string',
|
||||
description:
|
||||
'Your reasoning on if the conversation is looping without forward progress.',
|
||||
},
|
||||
confidence: {
|
||||
type: Type.NUMBER,
|
||||
type: 'number',
|
||||
description:
|
||||
'A number between 0.0 and 1.0 representing your confidence that the conversation is in an unproductive state.',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user