Skip to content

Commit d8f6b4f

Browse files
authored
Stop hardcoding python (#235)
1 parent 1ad8006 commit d8f6b4f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/gorgeous-squids-wonder.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@google/generative-ai": patch
3+
---
4+
5+
Fix language marker in text helper for executable code results.

src/requests/response-helpers.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ export function getText(response: GenerateContentResponse): string {
125125
}
126126
if (part.executableCode) {
127127
textStrings.push(
128-
"\n```python\n" + part.executableCode.code + "\n```\n",
128+
"\n```" +
129+
part.executableCode.language +
130+
"\n" +
131+
part.executableCode.code +
132+
"\n```\n",
129133
);
130134
}
131135
if (part.codeExecutionResult) {

0 commit comments

Comments
 (0)