Correct MiniMax Anthropic-compatible base URLs - #321
Conversation
There was a problem hiding this comment.
"/v1" can not be seem as a solid promised base url part, it's more safer to let user provide it instead of adding it in framework process silently.
If base url from model provider is totally different from Anthropic official base url format, try use "full_url" instead of "base_url" in settings.
Maplemx
left a comment
There was a problem hiding this comment.
"/v1" can not be seem as a solid promised base url part, it's more safer to let user provide it instead of adding it in framework process silently.
If base url from model provider is totally different from Anthropic official base url format, try use "full_url" instead of "base_url" in settings.
|
Thanks for the review. I removed the implicit /v1 suffix so configured base URLs are respected, updated the regression coverage, and pushed a new commit. The targeted test run is currently blocked by a missing json5 dependency. |
Maplemx
left a comment
There was a problem hiding this comment.
Requesting changes because the proposed documentation and the adapter's URL semantics do not match.
The Agently AnthropicCompatible adapter sends HTTP directly and constructs request_url = <base_url>/messages. MiniMax's documented request endpoint is https://api.minimax.io/anthropic/v1/messages (and the corresponding api.minimaxi.com endpoint). Therefore:
- the current documented Agently
base_url = .../anthropic/v1produces the correct request URL; - this PR's
base_url = .../anthropicproduces.../anthropic/messages, which drops the required/v1; - MiniMax's SDK environment variable named
ANTHROPIC_BASE_URLis not automatically the same contract as Agently's direct-HTTPbase_urlsetting.
Please keep the functional .../anthropic/v1 prefix, or document an explicit full_url = .../anthropic/v1/messages if the intent is to use the provider's full endpoint. A regression test should assert the actual MiniMax URL produced by the documented configuration. The rstrip("/") hardening can remain as a separate small fix, with handling for a missing/empty base URL if applicable.
Official endpoint reference: https://platform.minimax.io/docs/api-reference/text-chat-anthropic
|
Thanks for clarifying the adapter contract. I restored the functional /anthropic/v1 base URLs in both provider guides, kept generic base_url handling unchanged, and added regression cases for the actual global and China /messages URLs. I pushed a new commit and ran the targeted test file (18 passed). |
Follow-up to #318.
Summary
/anthropic./v1/messagesinsideAnthropicCompatiblewhen a Base URL is not already versioned./v1.Why
#318 included
/v1in the documented Base URLs so the adapter would reach the versioned Messages endpoint. MiniMax documents/anthropicas the Base URL, so the versioned request path should be derived inside the adapter instead of exposed in user configuration.Testing
.venv/bin/python -m pytest tests/test_plugins/test_model_requester/test_anthropic_compatible.py -q(16 passed).venv/bin/python -m pytest tests/test_plugins/test_model_requester/test_anthropic_compatible.py -q -k 'generate_request_uses_messages_path or auth_headers_are_preserved_in_outgoing_request'(3 passed).venv/bin/python -m compileall -q agently/builtins/plugins/ModelRequester/AnthropicCompatible/modules/request_builder.py tests/test_plugins/test_model_requester/test_anthropic_compatible.pygit diff --checkI have read and agree to the CLA in CLA.md.