mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
refactor(core): Centralize tool response formatting (#743)
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { GenerateContentResponse } from '@google/genai';
|
||||
import { GenerateContentResponse, Part } from '@google/genai';
|
||||
|
||||
export function getResponseText(
|
||||
response: GenerateContentResponse,
|
||||
@@ -15,3 +15,7 @@ export function getResponseText(
|
||||
.join('') || undefined
|
||||
);
|
||||
}
|
||||
|
||||
export function getResponseTextFromParts(parts: Part[]): string | undefined {
|
||||
return parts?.map((part) => part.text).join('') || undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user