mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
Prevent console.warn's for tool calls.
- Added helper for extracting text content from responses without warning. See fixed issue for more detail: https://b.corp.google.com/issues/414005146
This commit is contained in:
committed by
N. Taylor Mullen
parent
d051c0fd0f
commit
aa65a4a1fc
@@ -18,6 +18,7 @@ import {
|
||||
ToolResult,
|
||||
ToolResultDisplay,
|
||||
} from '../tools/tools.js'; // Keep ToolResult for now
|
||||
import { getResponseText } from '../utils/generateContentResponseUtilities.js';
|
||||
// Removed gemini-stream import (types defined locally)
|
||||
|
||||
// --- Types for Server Logic ---
|
||||
@@ -102,7 +103,6 @@ export class Turn {
|
||||
this.confirmationDetails = [];
|
||||
this.debugResponses = [];
|
||||
}
|
||||
|
||||
// The run method yields simpler events suitable for server logic
|
||||
async *run(
|
||||
req: PartListUnion,
|
||||
@@ -115,10 +115,12 @@ export class Turn {
|
||||
if (signal?.aborted) {
|
||||
throw this.abortError();
|
||||
}
|
||||
if (resp.text) {
|
||||
yield { type: GeminiEventType.Content, value: resp.text };
|
||||
continue;
|
||||
|
||||
const text = getResponseText(resp);
|
||||
if (text) {
|
||||
yield { type: GeminiEventType.Content, value: text };
|
||||
}
|
||||
|
||||
if (!resp.functionCalls) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user