feat(minimax): add MiniMax provider support (closes #2260) - #2282
Closed
ennajari wants to merge 7 commits into
Closed
feat(minimax): add MiniMax provider support (closes #2260)#2282ennajari wants to merge 7 commits into
ennajari wants to merge 7 commits into
Conversation
Collaborator
|
Thanks for the provider contribution. This overlaps with the newer MiniMax provider PR #2306, so I am marking this one as duplicate to keep review focused in a single place. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
from_minimax()factory andfrom_provider("minimax/...")support targeting MiniMax's OpenAI-compatible chat completions API (https://api.minimax.chat/v1), withMINIMAX_API_KEYenvironment-variable fallback.Mode.MINIMAX_TOOLS(default) andMode.MINIMAX_JSON, with matching response/reask handlers wired into the central dispatchers (processing/response.py,processing/function_calls.py) and streaming mode sets (dsl/iterable.py,dsl/partial.py).Provider.MINIMAX, base-URL detection inget_provider, known MiniMax model names inmodels.py, and anauto_clienthandler sofrom_provider("minimax/MiniMax-Text-01")works end-to-end.CHANGELOG.mdentry, and 18 unit tests that mock the OpenAI client so no live API calls are made.Closes #2260.
Test plan
ruff check instructor tests/llm/test_minimax.py examples/minimax_example.py— all checks passedruff format --checkclean on new filespytest tests/llm/test_minimax.py -v— 18/18 passedpytest tests/dsl/ tests/test_xai_optional_dependency.py -k "not llm and not openai"— still greenfrom_provider("minimax/MiniMax-Text-01", api_key="...")returns anInstructorwithProvider.MINIMAXandMode.MINIMAX_TOOLSget_provider("https://api.minimax.chat/v1")resolves toProvider.MINIMAX