mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 09:17:53 +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
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { GenerateContentResponse } from '@google/genai';
|
||||
|
||||
export function getResponseText(
|
||||
response: GenerateContentResponse,
|
||||
): string | undefined {
|
||||
return (
|
||||
response.candidates?.[0]?.content?.parts
|
||||
?.map((part) => part.text)
|
||||
.join('') || undefined
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user