mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 03:54:43 -07:00
Code assist service metrics. (#15024)
This commit is contained in:
committed by
GitHub
parent
5ea5107d05
commit
5e21c8c03c
@@ -105,3 +105,14 @@ export function getStructuredResponseFromParts(
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function getCitations(resp: GenerateContentResponse): string[] {
|
||||
return (resp.candidates?.[0]?.citationMetadata?.citations ?? [])
|
||||
.filter((citation) => citation.uri !== undefined)
|
||||
.map((citation) => {
|
||||
if (citation.title) {
|
||||
return `(${citation.title}) ${citation.uri}`;
|
||||
}
|
||||
return citation.uri!;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user