Skip to content

Commit

Permalink
Add support for logging data or custom responses from LLMs (#1191)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanatkinson authored Nov 6, 2024
1 parent c487e47 commit 0fcdb38
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions js/plugins/google-cloud/src/telemetry/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ class GenerateTelemetry implements Telemetry {
if (part.text) {
return this.toPartLogText(part.text);
}
if (part.data) {
return this.toPartLogText(JSON.stringify(part.data));
}
if (part.media) {
return this.toPartLogMedia(part);
}
Expand All @@ -358,6 +361,9 @@ class GenerateTelemetry implements Telemetry {
if (part.toolResponse) {
return this.toPartLogToolResponse(part);
}
if (part.custom) {
return this.toPartLogText(JSON.stringify(part.custom));
}
return '<unknown format>';
}

Expand Down

0 comments on commit 0fcdb38

Please sign in to comment.