mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
fix: omit null web search options on chained calls
This commit is contained in:
parent
e5ffc4f8db
commit
887d8c751d
2 changed files with 4 additions and 0 deletions
|
|
@ -85,6 +85,8 @@ class LiteLLM_Proxy_MCP_Handler:
|
||||||
follow_up_params = dict(params)
|
follow_up_params = dict(params)
|
||||||
follow_up_params.pop("litellm_logging_obj", None)
|
follow_up_params.pop("litellm_logging_obj", None)
|
||||||
follow_up_params.pop("litellm_call_id", None)
|
follow_up_params.pop("litellm_call_id", None)
|
||||||
|
if follow_up_params.get("web_search_options") is None:
|
||||||
|
follow_up_params.pop("web_search_options", None)
|
||||||
|
|
||||||
nested_params = follow_up_params.get("litellm_params")
|
nested_params = follow_up_params.get("litellm_params")
|
||||||
if isinstance(nested_params, dict):
|
if isinstance(nested_params, dict):
|
||||||
|
|
|
||||||
|
|
@ -451,6 +451,7 @@ def test_prepare_follow_up_call_params_resets_per_call_logging_state():
|
||||||
"litellm_logging_obj": object(),
|
"litellm_logging_obj": object(),
|
||||||
"litellm_trace_id": "trace-1",
|
"litellm_trace_id": "trace-1",
|
||||||
"tool_choice": "auto",
|
"tool_choice": "auto",
|
||||||
|
"web_search_options": None,
|
||||||
"litellm_params": {
|
"litellm_params": {
|
||||||
"litellm_call_id": "nested-parent-call",
|
"litellm_call_id": "nested-parent-call",
|
||||||
"litellm_logging_obj": object(),
|
"litellm_logging_obj": object(),
|
||||||
|
|
@ -467,6 +468,7 @@ def test_prepare_follow_up_call_params_resets_per_call_logging_state():
|
||||||
assert follow_up["litellm_trace_id"] == "trace-1"
|
assert follow_up["litellm_trace_id"] == "trace-1"
|
||||||
assert follow_up["stream"] is True
|
assert follow_up["stream"] is True
|
||||||
assert "tool_choice" not in follow_up
|
assert "tool_choice" not in follow_up
|
||||||
|
assert "web_search_options" not in follow_up
|
||||||
assert follow_up["litellm_params"]["metadata"] == {"team": "legal"}
|
assert follow_up["litellm_params"]["metadata"] == {"team": "legal"}
|
||||||
assert original["litellm_call_id"] == "parent-call"
|
assert original["litellm_call_id"] == "parent-call"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue