okf: add MiniMax provider (MiniMax-M3, MiniMax-M2.7) to the reference agent - #249
Open
octo-patch wants to merge 1 commit into
Open
Conversation
Route the reference agent's --model through a new providers module so a MiniMax id (MiniMax-M3 / MiniMax-M2.7) runs on MiniMax via LiteLlm while a Gemini id keeps the existing default path. Support the global and China regional endpoints via KC_MINIMAX_REGION and read the key from MINIMAX_API_KEY. Heavy imports stay lazy so the default path is unchanged.
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.
Reason: The reference agent had no MiniMax provider, so MiniMax-M3 / MiniMax-M2.7 and the global and China endpoints could not be selected.
What this adds
The reference agent threaded a single
modelstring straight intogoogle.adk.Agentand the index synthesizer'sgoogle.genaiclient, so theonly reachable backend was the default Gemini one. This adds MiniMax as a second
provider without changing that default.
reference_agent.providersmodule holding a small MiniMax registry:MiniMax-M3(1,000,000-token context; text/image/video input;adaptive/disabled thinking) and
MiniMax-M2.7(204,800-token context;text input; always-on thinking), each with per-million-token pricing.
global_en(https://api.minimax.io/v1) andcn_zh(https://api.minimaxi.com/v1), each with its chat and Anthropicbase URLs and docs root. The region is chosen with
KC_MINIMAX_REGION(default
global_en).build_model()returns aLiteLlmbound to the selected endpoint when the--modelvalue names a MiniMax model, and returns the string unchangedotherwise — so a Gemini id keeps the existing behavior byte for byte.
agent.py(both the BQ and web agents) and the indexsynthesizerroutethrough the resolver; a MiniMax model reads its key from
MINIMAX_API_KEY.--modelhelp and the README credentials section document the new provider,the two models, the endpoint selection, and the API-key variable.
Heavy imports (
google.adkLiteLlm,litellm) are lazy, only loaded when aMiniMax model is actually used, so the default path takes on no new dependency.
Checks
python3 -m pytest -q tests/test_providers.py tests/test_index.py tests/test_bundle_tools.py tests/test_viewer.py tests/test_document.py— 44 passed. Newtests/test_providers.pycovers model detection, both model specs, both regional endpoints, region override/validation, and the pass-through of non-MiniMax names.ruff check --select I,F,Eon the changed source files — clean.The remaining tests in this suite require optional runtime dependencies
(
google-adk,google-cloud-bigquery,markdownify) that are not part of thischange and were not installable in the sandbox.