mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 04:04:14 +00:00
fix: Ensure that tool calls with no arguments get handled correctly (#3560)
# What does this PR do? When a model decides to use an MCP tool call that requires no arguments, it sets the `arguments` field to `None`. This causes the user to see a `400 bad requst error` due to validation errors down the stack because this field gets removed when being parsed by an openai compatible inference provider like vLLM This PR ensures that, as soon as the tool call args are accumulated while streaming, we check to ensure no tool call function arguments are set to None - if they are we replace them with "{}" <!-- If resolving an issue, uncomment and update the line below --> Closes #3456 ## Test Plan Added new unit test to verify that any tool calls with function arguments set to `None` get handled correctly --------- Signed-off-by: Jaideep Rao <jrao@redhat.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Ashwin Bharambe <ashwin.bharambe@gmail.com>
This commit is contained in:
parent
42414a1a1b
commit
ca47d90926
51 changed files with 11061 additions and 10200 deletions
|
@ -20,15 +20,15 @@
|
|||
"__type__": "ollama._types.GenerateResponse",
|
||||
"__data__": {
|
||||
"model": "llama-guard3:1b",
|
||||
"created_at": "2025-09-03T17:38:03.002753Z",
|
||||
"created_at": "2025-09-30T17:40:02.587880074Z",
|
||||
"done": true,
|
||||
"done_reason": "stop",
|
||||
"total_duration": 334941166,
|
||||
"load_duration": 149512166,
|
||||
"total_duration": 2895949169,
|
||||
"load_duration": 45631237,
|
||||
"prompt_eval_count": 219,
|
||||
"prompt_eval_duration": 173843500,
|
||||
"prompt_eval_duration": 2801365130,
|
||||
"eval_count": 2,
|
||||
"eval_duration": 11119166,
|
||||
"eval_duration": 48315364,
|
||||
"response": "safe",
|
||||
"thinking": null,
|
||||
"context": null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue