forked from phoenix/litellm-mirror
fix test_anthropic_function_call_with_no_schema
This commit is contained in:
parent
186a679243
commit
3ccbd5bb7b
1 changed files with 8 additions and 6 deletions
|
@ -160,15 +160,17 @@ class AnthropicConfig:
|
||||||
returned_tool: Optional[AllAnthropicToolsValues] = None
|
returned_tool: Optional[AllAnthropicToolsValues] = None
|
||||||
|
|
||||||
if tool["type"] == "function" or tool["type"] == "custom":
|
if tool["type"] == "function" or tool["type"] == "custom":
|
||||||
_input_function_parameters: dict = (
|
_input_schema: dict = tool["function"].get(
|
||||||
tool["function"].get("parameters", None) or {}
|
"parameters",
|
||||||
)
|
{
|
||||||
_tool_input_schema: AnthropicInputSchema = AnthropicInputSchema(
|
"type": "object",
|
||||||
**_input_function_parameters
|
"properties": {},
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
input_schema: AnthropicInputSchema = AnthropicInputSchema(**_input_schema)
|
||||||
_tool = AnthropicMessagesTool(
|
_tool = AnthropicMessagesTool(
|
||||||
name=tool["function"]["name"],
|
name=tool["function"]["name"],
|
||||||
input_schema=_tool_input_schema,
|
input_schema=input_schema,
|
||||||
)
|
)
|
||||||
|
|
||||||
_description = tool["function"].get("description")
|
_description = tool["function"].get("description")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue