mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-01-09 16:36:32 +08:00
[Bugfix] Mistral crashes on tool with no description (#21167)
Signed-off-by: HugoMichard <hugo@harfanglab.fr>
This commit is contained in:
parent
0e18a5d058
commit
25708d317a
@ -183,7 +183,8 @@ def make_mistral_chat_completion_request(
|
||||
message["content"] = content
|
||||
|
||||
# The Mistral client, in comparison to the OpenAI client, requires the
|
||||
# "parameters" dict to be present, even if it's empty.
|
||||
# "parameters" dict and the "description" string to be present
|
||||
# even if they are empty.
|
||||
if tools:
|
||||
for function in [
|
||||
tool["function"] for tool in tools
|
||||
@ -191,6 +192,8 @@ def make_mistral_chat_completion_request(
|
||||
]:
|
||||
if function.get("parameters") is None:
|
||||
function["parameters"] = {}
|
||||
if function.get("description") is None:
|
||||
function["description"] = ""
|
||||
|
||||
from mistral_common.protocol.instruct.request import ChatCompletionRequest
|
||||
return ChatCompletionRequest(messages=messages,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user