Skip to content

feat: add Mistral AI plugin with LLM support#1226

Merged
toubatbrian merged 8 commits intolivekit:mainfrom
kevinkeibel1:feat/mistral-plugin
Apr 13, 2026
Merged

feat: add Mistral AI plugin with LLM support#1226
toubatbrian merged 8 commits intolivekit:mainfrom
kevinkeibel1:feat/mistral-plugin

Conversation

@kevinkeibel1
Copy link
Copy Markdown
Contributor

Description

Changes Made

  • Implements LLM and LLMStream using the official @mistralai/mistralai SDK
  • Supports streaming, tool calling, parallel tool calls, and tool choice
  • Handles all ChatContext item types: messages, function calls, outputs
  • Includes test suite using shared @livekit/agents-plugins-test helpers
  • Adds MistralChatModels type for all supported model identifiers

Pre-Review Checklist

  • Build passes: All builds (lint, typecheck, tests) pass locally
  • AI-generated code reviewed: Removed unnecessary comments and ensured code quality
  • Changes explained: All changes are properly documented and justified above
  • Scope appropriate: All changes relate to the PR title, or explanations provided for why they're included
  • Video demo: A small video demo showing changes works as expected and did not break any existing functionality using Agent Playground (if applicable)

Testing

  • Automated tests added/updated (if applicable)
  • All tests pass
  • Make sure both restaurant_agent.ts and realtime_agent.ts work properly (for major changes)

Additional Notes


Note to reviewers: Please ensure the pre-review checklist is completed before starting your review.

restaurant_agent.ts and realtime_agent.ts not tested because no changes to the core code were applied.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 10, 2026

🦋 Changeset detected

Latest commit: 2f93d8d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 23 packages
Name Type
@livekit/agents-plugin-mistral Major
@livekit/agents Major
@livekit/agents-plugin-anam Major
@livekit/agents-plugin-baseten Major
@livekit/agents-plugin-bey Major
@livekit/agents-plugin-cartesia Major
@livekit/agents-plugin-deepgram Major
@livekit/agents-plugin-elevenlabs Major
@livekit/agents-plugin-google Major
@livekit/agents-plugin-hedra Major
@livekit/agents-plugin-inworld Major
@livekit/agents-plugin-lemonslice Major
@livekit/agents-plugin-livekit Major
@livekit/agents-plugin-neuphonic Major
@livekit/agents-plugin-openai Major
@livekit/agents-plugin-phonic Major
@livekit/agents-plugin-resemble Major
@livekit/agents-plugin-rime Major
@livekit/agents-plugin-sarvam Major
@livekit/agents-plugin-silero Major
@livekit/agents-plugin-trugen Major
@livekit/agents-plugin-xai Major
@livekit/agents-plugins-test Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 10, 2026

CLA assistant check
All committers have signed the CLA.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@kevinkeibel1 kevinkeibel1 force-pushed the feat/mistral-plugin branch 3 times, most recently from 201898d to 5c0b12b Compare April 10, 2026 12:53
devin-ai-integration[bot]

This comment was marked as resolved.

@kevinkeibel1 kevinkeibel1 force-pushed the feat/mistral-plugin branch 3 times, most recently from 6bfd684 to 57d43f6 Compare April 10, 2026 14:46
devin-ai-integration[bot]

This comment was marked as resolved.

- Implements LLM and LLMStream using the official @mistralai/mistralai SDK
- Supports streaming, tool calling, parallel tool calls, and tool choice
- Handles all ChatContext item types: messages, function calls, outputs
- Includes test suite using shared @livekit/agents-plugins-test helpers
- Adds MistralChatModels type for all supported model identifiers
devin-ai-integration[bot]

This comment was marked as resolved.

@toubatbrian
Copy link
Copy Markdown
Contributor

@codex review and check the plugin package format against others. Review for web-socket patterns compared with other LLM plugins and check for alignment or discrepancies

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2f93d8d64e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +311 to +313
throw new APIConnectionError({
message: `Mistral LLM: connection error - ${err.message ?? 'unknown error'}`,
options: { retryable: true },
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Stop retrying after emitting partial stream output

This catch path always throws APIConnectionError with retryable: true, even when chunks were already queued from the current stream attempt; if a network drop happens mid-response, the base retry loop starts a fresh request and appends a second completion to already-emitted text/tool calls, which can corrupt downstream tool execution and user-visible output. Track a retryable flag that flips to false after the first emitted chunk/usage event and reuse it in the thrown API errors.

Useful? React with 👍 / 👎.

Comment on lines +27 to +34
"scripts": {
"build": "tsup --onSuccess \"pnpm build:types\"",
"build:types": "tsc --declaration --emitDeclarationOnly && node ../../scripts/copyDeclarationOutput.js",
"clean": "rm -rf dist",
"clean:build": "pnpm clean && pnpm build",
"lint": "eslint -f unix \"src/**/*.{ts,js}\"",
"test": "vitest"
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add API check scripts for the new plugin package

The new plugin package format diverges from other published plugins by omitting api:check/api:update scripts, so turbo run api:check will skip this package and public API regressions in its generated declarations can ship unnoticed. Since this package already includes api-extractor.json, wiring the standard scripts (and matching dev dependency) keeps it aligned with existing LLM plugin release validation.

Useful? React with 👍 / 👎.

@toubatbrian toubatbrian merged commit 382849b into livekit:main Apr 13, 2026
6 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 13, 2026
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.

4 participants