Skip to content
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

fix: JSON schema issue with gemini tool calls #3851

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

monotykamary
Copy link

Description

Fixes tool calling error that happens when using Gemini. Not actually sure if it's because of MCP servers, but at least now it works.

Checklist

  • Fixed and added JSON schema cleaning for processing tools with Gemini

Screenshots

image

Testing instructions

Select any Gemini model and enable tools. Prompt it in such a way that it will invoke the tool and see the results.

Copy link

netlify bot commented Jan 26, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit 9ca4ad4
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/67969417acfd350008424cb4

@sestinj sestinj requested a review from RomneyDa January 27, 2025 21:31
await new Promise(resolve => setTimeout(resolve, 100));
} else if (part.type === 'tool') {
// Add delay before tool response to ensure tool call was processed
await new Promise(resolve => setTimeout(resolve, 100));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@monotykamary this is great! The schema cleaning is a needed thing I failed to add.
Could you remove the 100ms awaits or explain the thought process there beyond the comments?

There's a good chance it could take much longer than 100ms to process a tool call, and I think in the future continue GUI should handle any needed waiting/ordering. Did you find this necessary to work? Also for another edge case I think for now it's reasonable to assume that there will never be function calls and responses within the same message, and if there were, same reasoning could apply. Any other thoughts on your approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants