fix(minimax): honour OPTIMIZER_DEPLOYMENT for optimizer-role calls
Follow-up to #116. MiniMax exposed only TARGET_DEPLOYMENT, and set_optimizer_deployment() never touched MiniMax, so a configured optimizer_model was ignored: chat_optimizer and the optimizer message path both sent TARGET_DEPLOYMENT. In mixed optimizer/target setups this could send the wrong model name to the optimizer endpoint. Adds OPTIMIZER_DEPLOYMENT and set_optimizer_deployment() to minimax_backend, wired into the model facade. chat_optimizer and a new chat_optimizer_messages use it, falling back to TARGET_DEPLOYMENT when unset. Also fixes dict[int] return annotations to dict[str, int]. Adds routing tests. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -215,7 +215,7 @@ def chat_optimizer_messages(
|
||||
timeout=timeout,
|
||||
)
|
||||
if get_optimizer_backend() == "minimax_chat":
|
||||
return _minimax.chat_target_messages(
|
||||
return _minimax.chat_optimizer_messages(
|
||||
messages=messages,
|
||||
max_completion_tokens=max_completion_tokens,
|
||||
retries=retries,
|
||||
@@ -540,3 +540,4 @@ def set_optimizer_deployment(deployment: str) -> None:
|
||||
_openai.set_optimizer_deployment(deployment)
|
||||
_claude.set_optimizer_deployment(deployment)
|
||||
_qwen.set_optimizer_deployment(deployment)
|
||||
_minimax.set_optimizer_deployment(deployment)
|
||||
|
||||
Reference in New Issue
Block a user