fix: update MiniMax provider config and fix temperature=0 API error#33
Merged
Merged
Conversation
- Update .env.example: replace deprecated MiniMax-Text-01 with MiniMax-M2.7 and document MiniMax-M2.7-highspeed as the faster alternative; add note that temperature must be > 0 - Fix temperature clamping in build_llm(): MiniMax rejects temperature=0.0 (requires range (0.0, 1.0]); auto-clamp to 1.0 when the default 0.0 is configured for the minimax provider - Add unit tests: MiniMax env-var mapping, base URL propagation, temperature clamping from 0.0, and preservation of explicit values
warren618
reviewed
Apr 14, 2026
warren618
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the fix! One suggestion on the temperature clamping:
if os.getenv("LANGCHAIN_PROVIDER", "openai").lower() == "minimax" and temperature <= 0.0:
temperature = 1.0Clamping to 1.0 (max randomness) seems too aggressive — users who set temperature=0 typically want deterministic output. Since MiniMax's valid range is (0.0, 1.0], could we clamp to 0.01 instead? That stays closest to the user's intent while satisfying the API constraint.
temperature = 0.01
7 tasks
0.01 stays closest to the user's intent (deterministic output) while satisfying the MiniMax API constraint of temperature > 0.
Collaborator
|
Thanks for the fix @octo-patch! I tweaked the clamp value to Welcome to the contributors list! |
longmfe
pushed a commit
to longmfe/Vibe-Trading-Mars
that referenced
this pull request
Jul 14, 2026
…KUDS#33) * fix: update MiniMax provider config and fix temperature handling - Update .env.example: replace deprecated MiniMax-Text-01 with MiniMax-M2.7 and document MiniMax-M2.7-highspeed as the faster alternative; add note that temperature must be > 0 - Fix temperature clamping in build_llm(): MiniMax rejects temperature=0.0 (requires range (0.0, 1.0]); auto-clamp to 1.0 when the default 0.0 is configured for the minimax provider - Add unit tests: MiniMax env-var mapping, base URL propagation, temperature clamping from 0.0, and preservation of explicit values * fix: clamp MiniMax temperature to 0.01 instead of 1.0 0.01 stays closest to the user's intent (deterministic output) while satisfying the MiniMax API constraint of temperature > 0. --------- Co-authored-by: octo-patch <octo-patch@github.com> Co-authored-by: warren618 <haozhe_wu@connect.hku.hk>
4 tasks
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
.env.examplereferencedMiniMax-Text-01which has been superseded. Updated toMiniMax-M2.7(current production model) and documentedMiniMax-M2.7-highspeedas the faster alternative.temperature=0.0(valid range is(0.0, 1.0]). WhenLANGCHAIN_PROVIDER=minimaxand the defaultLANGCHAIN_TEMPERATURE=0.0is in effect,build_llm()now automatically clamps the value to1.0, preventing an otherwise-silent API validation error for all users who follow the example config.OPENAI_*mapping, base URL propagation, temperature clamping from0.0, and preservation of explicitly-set positive temperatures.Test plan
pytest agent/tests/test_llm.py— all 19 tests pass (11 pre-existing + 4 new MiniMax tests)LANGCHAIN_PROVIDER=minimax,LANGCHAIN_MODEL_NAME=MiniMax-M2.7,LANGCHAIN_TEMPERATURE=0.0→ model responds correctly after auto-clampAPI reference