Skip to content

fix: set memory step tool call even if code parsing fails #1132

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dechantoine
Copy link

Hello huggingface team and thank you for this package, I'm making wonder with it 😄

Long story short, I'm currently working on integrating Google's Gemini API into smolagents using the google-genai package. To achieve this, I've developed a bridge that translates your ChatMessages into the format expected by the Gemini API.

However, I've encountered the following error when sending message lists to Gemini with my agent:

Error in generating model output:
400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'Please ensure that the number of function response parts is equal to the number of function call parts of the function call turn.', 'status': 'INVALID_ARGUMENT'}}

This error appears to stem from instances where the List[ChatMessage] contains a tool-response without a preceding tool-call. Notably, this issue arises exclusively with CodeAgent. Specifically, when code parsing fails, the tool_calls attribute for that step isn't set, yet the tool response is still present.

Is this behavior intentional? If so, it might pose challenges in effectively leveraging Gemini with smolagents. 😢

Best regards,
Antoine

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.

1 participant