mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-29 06:31:32 +00:00
fix(provider): remove MiniMax /v1→/anthropic auto-correction to allow user override (#3553)
The minimax-specific auto-correction in runtime_provider.py was preventing users from overriding to the OpenAI-compatible endpoint via MINIMAX_BASE_URL. Users in certain regions get nginx 404 on api.minimax.io/anthropic and need to switch to api.minimax.chat/v1. The generic URL-suffix detection already handles /anthropic → anthropic_messages, so the minimax-specific code was redundant for the default path and harmful for the override path. Now: default /anthropic URL works via generic detection, user override to /v1 gets chat_completions mode naturally. Closes #3546 (different approach — respects user overrides instead of changing the default endpoint).
This commit is contained in:
parent
735ca9dfb2
commit
df6ce848e9
2 changed files with 9 additions and 15 deletions
|
|
@ -407,12 +407,6 @@ def resolve_runtime_provider(
|
|||
# (e.g. https://api.minimax.io/anthropic, https://dashscope.../anthropic)
|
||||
elif base_url.rstrip("/").endswith("/anthropic"):
|
||||
api_mode = "anthropic_messages"
|
||||
# MiniMax providers always use Anthropic Messages API.
|
||||
# Auto-correct stale /v1 URLs (from old .env or config) to /anthropic.
|
||||
elif provider in ("minimax", "minimax-cn"):
|
||||
api_mode = "anthropic_messages"
|
||||
if base_url.rstrip("/").endswith("/v1"):
|
||||
base_url = base_url.rstrip("/")[:-3] + "/anthropic"
|
||||
return {
|
||||
"provider": provider,
|
||||
"api_mode": api_mode,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue