Fix model validation and empty choices handling in MiniMaxChatNode

- Validate `model` parameter against MiniMaxChatModel enum before
  forwarding to the API request, preventing invalid model strings.
- Raise RuntimeError instead of returning a fallback string when the
  API returns empty choices, surfacing failures consistently.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
octo-patch 2026-03-14 14:15:34 +08:00
parent acf25eeab5
commit c01e019286

View File

@ -541,7 +541,7 @@ class MinimaxChatNode(IO.ComfyNode):
ApiEndpoint(path="/proxy/minimax/chat/completions", method="POST"),
response_model=MiniMaxChatResponse,
data=MiniMaxChatRequest(
model=model,
model=MiniMaxChatModel(model).value,
messages=messages,
max_tokens=max_tokens,
temperature=temperature,
@ -550,7 +550,7 @@ class MinimaxChatNode(IO.ComfyNode):
if response.choices:
return IO.NodeOutput(response.choices[0].message.content)
return IO.NodeOutput("No response generated by MiniMax model.")
raise RuntimeError("No response generated by MiniMax model.")
class MinimaxExtension(ComfyExtension):