mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-22 11:04:42 -07: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