Skip to content

Commit

Permalink
Stop hardcoding python
Browse files Browse the repository at this point in the history
  • Loading branch information
hsubox76 committed Aug 22, 2024
1 parent 2dfa412 commit e8bce3e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-squids-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@google/generative-ai": patch
---

Fix language marker in text helper for executable code results.
6 changes: 5 additions & 1 deletion src/requests/response-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ export function getText(response: GenerateContentResponse): string {
}
if (part.executableCode) {
textStrings.push(
"\n```python\n" + part.executableCode.code + "\n```\n",
"\n```" +
part.executableCode.language +
"\n" +
part.executableCode.code +
"\n```\n",
);
}
if (part.codeExecutionResult) {
Expand Down

0 comments on commit e8bce3e

Please sign in to comment.