diff --git a/.changeset/gorgeous-squids-wonder.md b/.changeset/gorgeous-squids-wonder.md new file mode 100644 index 00000000..ec390a55 --- /dev/null +++ b/.changeset/gorgeous-squids-wonder.md @@ -0,0 +1,5 @@ +--- +"@google/generative-ai": patch +--- + +Fix language marker in text helper for executable code results. diff --git a/src/requests/response-helpers.ts b/src/requests/response-helpers.ts index 824e8a40..2554d001 100644 --- a/src/requests/response-helpers.ts +++ b/src/requests/response-helpers.ts @@ -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) {