mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-23 10:03:36 +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"),
|
ApiEndpoint(path="/proxy/minimax/chat/completions", method="POST"),
|
||||||
response_model=MiniMaxChatResponse,
|
response_model=MiniMaxChatResponse,
|
||||||
data=MiniMaxChatRequest(
|
data=MiniMaxChatRequest(
|
||||||
model=model,
|
model=MiniMaxChatModel(model).value,
|
||||||
messages=messages,
|
messages=messages,
|
||||||
max_tokens=max_tokens,
|
max_tokens=max_tokens,
|
||||||
temperature=temperature,
|
temperature=temperature,
|
||||||
@ -550,7 +550,7 @@ class MinimaxChatNode(IO.ComfyNode):
|
|||||||
|
|
||||||
if response.choices:
|
if response.choices:
|
||||||
return IO.NodeOutput(response.choices[0].message.content)
|
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):
|
class MinimaxExtension(ComfyExtension):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user