Skip to content

Conversation

@indegro
Copy link
Contributor

@indegro indegro commented Aug 20, 2025

Motivation and Context

MistralAI provides a list of models for working with completions, agents. Also the company has a high-speed inference.
Another aspect -- GDPR, models are deployed in Europe and it allows working with projects where GDPR is crucial.

Original issue -- #530

Breaking Changes


Type of the changes

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tests improvement
  • Refactoring

Checklist

  • The pull request has a description of the proposed change
  • I read the Contributing Guidelines before opening the pull request
  • The pull request uses develop as the base branch
  • Tests for the changes have been added
  • All new and existing tests passed
Additional steps for pull requests adding a new feature
  • An issue describing the proposed change exists
  • The pull request includes a link to the issue
  • The change was discussed and approved in the issue
  • Docs have been added / updated

Copy link
Collaborator

@Ololoshechkin Ololoshechkin left a comment

Choose a reason for hiding this comment

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

Thank you so much for your contribution! Appreciate that a lot!

Please consider adding KDocs for public API, and supporting media types.
Adding all models is rather optional (we can auto-generate it later) but nice to have :)

Copy link
Contributor

@devcrocod devcrocod left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!

I have reviewed the client class and left a few comments. please take a look at them

From what I can tell, Mistral is generally similar to an OpenAI-like client. To address this, you might consider:

  • Inheriting from AbstractOpenAILLMClient. This way, you would not need to reimplement the core logic and types
  • Waiting for this PR #645 to be merged, and then adding only the Mistral request.
    Compared to OpenAI, Mistral is missing many fields and instead introduces a different field, prompt_mode

Copy link
Contributor

@antoniibelyshev antoniibelyshev left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!

Could you please also implement the executeMultipleChoices method to support the multiple choices functionality supported by the parameter n?

@devcrocod devcrocod changed the title Add MistralAI LLLM client. Add MistralAI LLM client Oct 8, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive MistralAI LLM client integration to the Koog framework, enabling support for MistralAI's chat, embedding, and moderation models with full parameter control and multimodal capabilities.

  • Adds new MistralAI client implementation with support for chat completions, embeddings, and content moderation
  • Integrates MistralAI provider across all framework modules including Spring Boot starter and Ktor integration
  • Includes comprehensive test coverage for serialization, parameters, models, and client functionality

Reviewed Changes

Copilot reviewed 39 out of 40 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
settings.gradle.kts Adds MistralAI client module to build configuration
prompt/prompt-model/src/commonMain/kotlin/ai/koog/prompt/dsl/ModerationAPI.kt Adds hashCode method to ModerationCategory
prompt/prompt-llm/src/commonMain/kotlin/ai/koog/prompt/llm/LLMProvider.kt Adds MistralAI provider definition
prompt-executor-mistralai-client/ Core MistralAI client implementation with models, parameters, and API integration
prompt-executor-llms-all/ Adds simple MistralAI executor factory method
Spring Boot starter modules Adds auto-configuration and properties for MistralAI integration
Ktor modules Adds configuration loading and model parsing for MistralAI
Examples Adds MistralAI usage examples and tool integration
Comments suppressed due to low confidence (2)

prompt/prompt-executor/prompt-executor-clients/prompt-executor-mistralai-client/src/commonMain/kotlin/ai/koog/prompt/executor/clients/mistralai/models/MistralAIChatCompletion.kt:1

  • The moderationPath property is declared as val instead of var, making it immutable and always null. This prevents customization of the moderation API path.
package ai.koog.prompt.executor.clients.mistralai.models

koog-ktor/src/commonMain/kotlin/ai/koog/ktor/KoogAgentsConfig.kt:1

  • Comment incorrectly refers to 'Google configuration' in the MistralAI configuration section.
package ai.koog.ktor

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@devcrocod devcrocod left a comment

Choose a reason for hiding this comment

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

So the PR doesn’t get blocked

Copy link
Contributor

@antoniibelyshev antoniibelyshev left a comment

Choose a reason for hiding this comment

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

Thank you, looks good

@devcrocod
Copy link
Contributor

@Ololoshechkin please take a look at this PR

@devcrocod devcrocod merged commit 7bff7cb into JetBrains:develop Oct 28, 2025
10 checks passed
antoniibelyshev pushed a commit that referenced this pull request Oct 28, 2025
MistralAI provides a list of models for working with completions,
agents. Also the company has a high-speed inference.
Another aspect -- GDPR, models are deployed in Europe and it allows
working with projects where GDPR is crucial.

Original issue -- #530

Co-authored-by: Andrey Bragin <[email protected]>
Co-authored-by: devcrocod <[email protected]>
Co-authored-by: Copilot <[email protected]>
antoniibelyshev pushed a commit that referenced this pull request Oct 29, 2025
MistralAI provides a list of models for working with completions,
agents. Also the company has a high-speed inference.
Another aspect -- GDPR, models are deployed in Europe and it allows
working with projects where GDPR is crucial.

Original issue -- #530

Co-authored-by: Andrey Bragin <[email protected]>
Co-authored-by: devcrocod <[email protected]>
Co-authored-by: Copilot <[email protected]>
vova-jb pushed a commit that referenced this pull request Jan 27, 2026
MistralAI provides a list of models for working with completions,
agents. Also the company has a high-speed inference.
Another aspect -- GDPR, models are deployed in Europe and it allows
working with projects where GDPR is crucial.

Original issue -- #530

Co-authored-by: Andrey Bragin <[email protected]>
Co-authored-by: devcrocod <[email protected]>
Co-authored-by: Copilot <[email protected]>
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.

5 participants