mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 01:07:46 +00:00
feat(commands): Enable @file processing in TOML commands (#6716)
This commit is contained in:
@@ -9,23 +9,7 @@ import type {
|
||||
Part,
|
||||
FunctionCall,
|
||||
} from '@google/genai';
|
||||
|
||||
export function getResponseText(
|
||||
response: GenerateContentResponse,
|
||||
): string | undefined {
|
||||
const parts = response.candidates?.[0]?.content?.parts;
|
||||
if (!parts) {
|
||||
return undefined;
|
||||
}
|
||||
const textSegments = parts
|
||||
.map((part) => part.text)
|
||||
.filter((text): text is string => typeof text === 'string');
|
||||
|
||||
if (textSegments.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
return textSegments.join('');
|
||||
}
|
||||
import { getResponseText } from './partUtils.js';
|
||||
|
||||
export function getResponseTextFromParts(parts: Part[]): string | undefined {
|
||||
if (!parts) {
|
||||
|
||||
Reference in New Issue
Block a user