mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
Merge 9ae0df4272
into b82af5b826
This commit is contained in:
commit
e7e640f699
3 changed files with 4 additions and 4 deletions
|
@ -25,7 +25,7 @@ class IBMWatsonXChatConfig(IBMWatsonXMixin, OpenAIGPTConfig):
|
||||||
"seed", # equivalent to random_seed
|
"seed", # equivalent to random_seed
|
||||||
"stream", # equivalent to stream
|
"stream", # equivalent to stream
|
||||||
"tools",
|
"tools",
|
||||||
"tool_choice", # equivalent to tool_choice + tool_choice_options
|
"tool_choice", # equivalent to tool_choice + tool_choice_option
|
||||||
"logprobs",
|
"logprobs",
|
||||||
"top_logprobs",
|
"top_logprobs",
|
||||||
"n",
|
"n",
|
||||||
|
@ -61,7 +61,7 @@ class IBMWatsonXChatConfig(IBMWatsonXMixin, OpenAIGPTConfig):
|
||||||
|
|
||||||
_tool_choice = non_default_params.pop("tool_choice", None)
|
_tool_choice = non_default_params.pop("tool_choice", None)
|
||||||
if self.is_tool_choice_option(_tool_choice):
|
if self.is_tool_choice_option(_tool_choice):
|
||||||
optional_params["tool_choice_options"] = _tool_choice
|
optional_params["tool_choice_option"] = _tool_choice
|
||||||
elif _tool_choice is not None:
|
elif _tool_choice is not None:
|
||||||
optional_params["tool_choice"] = _tool_choice
|
optional_params["tool_choice"] = _tool_choice
|
||||||
return super().map_openai_params(
|
return super().map_openai_params(
|
||||||
|
|
|
@ -964,7 +964,7 @@ def test_watsonx_tool_choice():
|
||||||
model="gemini-1.5-pro", custom_llm_provider="watsonx", tool_choice="auto"
|
model="gemini-1.5-pro", custom_llm_provider="watsonx", tool_choice="auto"
|
||||||
)
|
)
|
||||||
print(optional_params)
|
print(optional_params)
|
||||||
assert optional_params["tool_choice_options"] == "auto"
|
assert optional_params["tool_choice_option"] == "auto"
|
||||||
|
|
||||||
|
|
||||||
def test_watsonx_text_top_k():
|
def test_watsonx_text_top_k():
|
||||||
|
|
|
@ -791,7 +791,7 @@ async def test_watsonx_tool_choice(sync_mode):
|
||||||
mock_completion.assert_called_once()
|
mock_completion.assert_called_once()
|
||||||
print(mock_completion.call_args.kwargs)
|
print(mock_completion.call_args.kwargs)
|
||||||
json_data = json.loads(mock_completion.call_args.kwargs["data"])
|
json_data = json.loads(mock_completion.call_args.kwargs["data"])
|
||||||
json_data["tool_choice_options"] == "auto"
|
json_data["tool_choice_option"] == "auto"
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
if "The read operation timed out" in str(e):
|
if "The read operation timed out" in str(e):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue