Skip to content

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

Signed-off-by: Ricken Bazolo <ricken.bazolo@gmail.com>
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)

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