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

Added index of tool call in the list of tool calls #2084

Closed
wants to merge 1 commit into from

Conversation

ricken07
Copy link
Contributor

Fix : org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unrecognized field "index" (class org.springframework.ai.mistralai.api.MistralAiApi$ChatCompletionMessage$ToolCall), not marked as ignorable

Mistral has added an extra field named index in tool_calls responses, which causes an exception when mapping the template response.

This pull request corrects this problem. Currently, this index field is not used by Spring AI.

However, in view of developments in assistant response models, wouldn't it be preferable to modify the AssistantMessage structure to make it generic and more adaptable ? @tzolov

import java.util.List;
import java.util.Optional;
import java.util.UUID;
import java.util.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

Wildcard imports are not allowed.
Will try to fix it while reviewing.

@tzolov
Copy link
Contributor

tzolov commented Feb 11, 2025

Thank you @ricken07 !
Rebased, extended, squashed and merged at e92616b
I've made some additional (non mistral related fixes as well)

@tzolov tzolov closed this Feb 11, 2025
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