Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion litellm/llms/anthropic/chat/transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,11 @@ def _transform_request(
anthropic_tools.append(tool)
else: # assume openai tool call
new_tool = tool["function"]
new_tool["input_schema"] = new_tool.pop("parameters") # rename key
parameters = new_tool.pop("parameters", {
"type": "object",
"properties": {},
})
new_tool["input_schema"] = parameters # rename key
if "cache_control" in tool:
new_tool["cache_control"] = tool["cache_control"]
anthropic_tools.append(new_tool)
Expand Down
5 changes: 4 additions & 1 deletion litellm/llms/prompt_templates/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -2554,7 +2554,10 @@ def _bedrock_tools_pt(tools: List) -> List[BedrockToolBlock]:
"""
tool_block_list: List[BedrockToolBlock] = []
for tool in tools:
parameters = tool.get("function", {}).get("parameters", None)
parameters = tool.get("function", {}).get("parameters", {
"type": "object",
"properties": {}
})
name = tool.get("function", {}).get("name", "")

# related issue: https://github.com/BerriAI/litellm/issues/5007
Expand Down