mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-17 07:05:12 +08:00
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:
parent
acf25eeab5
commit
c01e019286
@ -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):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user