mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-26 04:54:25 -07:00
Harded code assist converter. (#18656)
This commit is contained in:
@@ -133,14 +133,18 @@ export function toGenerateContentRequest(
|
||||
export function fromGenerateContentResponse(
|
||||
res: CaGenerateContentResponse,
|
||||
): GenerateContentResponse {
|
||||
const inres = res.response;
|
||||
const out = new GenerateContentResponse();
|
||||
out.candidates = inres.candidates;
|
||||
out.responseId = res.traceId;
|
||||
const inres = res.response;
|
||||
if (!inres) {
|
||||
out.candidates = [];
|
||||
return out;
|
||||
}
|
||||
out.candidates = inres.candidates ?? [];
|
||||
out.automaticFunctionCallingHistory = inres.automaticFunctionCallingHistory;
|
||||
out.promptFeedback = inres.promptFeedback;
|
||||
out.usageMetadata = inres.usageMetadata;
|
||||
out.modelVersion = inres.modelVersion;
|
||||
out.responseId = res.traceId;
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user