Skip to content

feat(llm): add MistralAI structured output support - #574

Open
xxx-0425 wants to merge 2 commits into
neo4j:mainfrom
xxx-0425:feat/mistralai-structured-output
Open

feat(llm): add MistralAI structured output support#574
xxx-0425 wants to merge 2 commits into
neo4j:mainfrom
xxx-0425:feat/mistralai-structured-output

Conversation

@xxx-0425

Copy link
Copy Markdown

Description

Adds structured output support to MistralAILLM.

This PR:

  • Adds the response_format parameter to MistrAILLM.
  • Supports Pydantic models using chat.parse and chat.parse_async.
  • Supports JSON Schema dictionaries using chat.complete and chat.complete_async.
  • Exposes structured output support through supports_structured_output.
  • Updates the minimum supported mistralai version to 1.5.0.
  • Adds unit tests for synchronous and asynchronous structured output.
  • Adds documentation, an example, and a changelog entry.

Fixes #542.

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Documentation update
  • Project configuration change

Complexity

Complexity: Medium

How Has This Been Tested?

  • Unit tests
  • E2E tests
  • Manual tests

Testing performed:

  • uv run pytest tests/unit/llm/test_mistralai_llm.py — 29 passed
  • Full unit test suite — 1198 passed
  • Ruff lint and formatting checks
  • MyPy type checking
  • Sphinx documentation build
  • Package build with uv build
  • Manual synchronous and asynchronous tests against the Mistral API

Checklist

  • Documentation has been updated
  • Unit tests have been updated
  • E2E tests have been updated
  • Examples have been updated
  • New files have copyright header
  • CLA (https://neo4j.com/developer/cla/) has been signed
  • CHANGELOG.md updated if appropriate

@xxx-0425
xxx-0425 requested a review from a team as a code owner July 22, 2026 06:51
@NathalieCharbel
NathalieCharbel self-requested a review August 20, 2026 12:11
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.

[FEATURE]: Add MistralAI Structured Output feature

1 participant