fix: set memory step tool call even if code parsing fails #1132
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thegoogle-genai
package. To achieve this, I've developed a bridge that translates yourChatMessages
into the format expected by the Gemini API.However, I've encountered the following error when sending message lists to Gemini with my agent:
This error appears to stem from instances where the
List[ChatMessage]
contains atool-response
without a precedingtool-call
. Notably, this issue arises exclusively withCodeAgent
. Specifically, when code parsing fails, thetool_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