-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support google genai code execution tool #3205
Labels
Comments
I am encountering the same issue where |
lgrammel
changed the title
Schema for Google Generative breaks when using code execution
support google genai code execution tool
Oct 15, 2024
Thanks for this thread! I also encountered an issue running code execution.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Background
Google Gemini API supports code execution, which runs Python code in Google servers.
I was not able to set a
codeExecution
tool with the SDK, so I resorted to overriding thefetch
.Running
streamText
will then throwAI_TypeValidationError
.Show error
I tried logging the chunk response, and it appears that the chunk does not have the
text
property.Show chunk response
This format appears to be enforced in the schema, defined in:
ai/packages/google/src/google-generative-ai-language-model.ts
Lines 389 to 404 in 14eb2b8
Question
So I have a number of questions here:
codeExecution
tool for Gemini somehow?executableCode
andcodeExecutionResult
)?Workaround
If I access the
textStream
, the code will throw an error:So the work around I had was to access the
fullStream
, and silently ignore these errors.Code example
No response
Additional context
Packages installed:
The text was updated successfully, but these errors were encountered: