Didier Villevalois
04/11/2026, 1:26 PMMistralAILLMClient extends AbstractOpenAILLMClientMistralAIChatCompletionResponse, MistralAIChatCompletionStreamResponse which forces the messages to be of type OpenAIMessage (a sealed interface). This cannot work for MistralAI because in order to handle the Mistral-specific content parts (reference, document, thinking) we need to replace the whole type hierarchy to specific types (MistralAIChoice, MistralAIMessage, MistralAIContent and MistralAIContentPart).
So this will require to completely remove the base AbstractOpenAILLMClient base class and implement all the converters specifically to Mistral.
So I reiterate my initial question: given that Mistral publishes an OpenAPI spec, should we not rely on an OpenAPI data classes generation hierarchy (like e.g. https://github.com/nomisRev/OpenAPI-kt) to generate the Json message data classes at build. This would allow us to only have to maintain the glue (the converters to and from Koog's message model) and be sure to always be up-to-date with the API. Otherwise, we would have to maintain both the object model and the glue.
[Current WIP branch: https://github.com/ptitjes/koog/tree/p/KG-535-mistral-ai-references]
@Vadim Briliantov WDYT?
PS: for at least 5 months, the MistralAI LLM client is unusable because the API will regularly return "references" which causes deserialization errors in the client. Also note that it is not only "Mistral Medium", as stated in KG-535, but all the models of Mistral (Mistral Large/Medium/Small, and also Ministral 3B, 8B and 14B...).Didier Villevalois
04/13/2026, 7:30 PMAnastasiia Zarechneva
04/14/2026, 10:10 AMPavel Gorgulov
04/14/2026, 10:55 AM