Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix: convert_anthropic_tool_to_databricks_tool

Ishaan Jaff698a2dd382f5
diff --git a/litellm/llms/databricks/chat/transformation.py b/litellm/llms/databricks/chat/transformation.py
index 4852f2e7106..a1370074238 100644
--- a/litellm/llms/databricks/chat/transformation.py
+++ b/litellm/llms/databricks/chat/transformation.py
@@ -169,18 +169,20 @@ class DatabricksConfig(DatabricksBase, OpenAILikeChatConfig, AnthropicConfig):
if tool is None:
return None
- kwags: dict = {
+ # Build DatabricksFunction explicitly to avoid parameter conflicts
+ function_params: DatabricksFunction = {
"name": tool["name"],
"parameters": cast(dict, tool.get("input_schema") or {})
}
-
+
+ # Only add description if it exists
description = tool.get("description")
if description is not None:
- kwags["description"] = cast(Union[dict, str], description)
+ function_params["description"] = cast(Union[dict, str], description)
return DatabricksTool(
type="function",
- function=DatabricksFunction(name=tool["name"], **kwags),
+ function=function_params,
)
def _map_openai_to_dbrx_tool(self, model: str, tools: List) -> List[DatabricksTool]: