mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-14 12:26:25 +00:00
Fix structured response of tool call
This commit is contained in:
@@ -3,7 +3,7 @@ WebSearch Tool Transformation
|
||||
|
||||
Transforms between Anthropic/OpenAI tool_use format and LiteLLM search format.
|
||||
"""
|
||||
|
||||
import json
|
||||
from typing import Any, Dict, List, Tuple
|
||||
|
||||
from litellm._logging import verbose_logger
|
||||
@@ -301,7 +301,7 @@ class WebSearchTransformation:
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": tc["name"],
|
||||
"arguments": str(tc["input"]),
|
||||
"arguments": json.dumps(tc["input"]) if isinstance(tc["input"], dict) else str(tc["input"]),
|
||||
},
|
||||
}
|
||||
for tc in tool_calls
|
||||
|
||||
@@ -926,7 +926,6 @@ class OpenAIChatCompletion(BaseLLM, BaseOpenAILLM):
|
||||
logging_obj=logging_obj,
|
||||
)
|
||||
stringified_response = response.model_dump()
|
||||
print(f"🔥stringified_response: {stringified_response}")
|
||||
logging_obj.post_call(
|
||||
input=data["messages"],
|
||||
api_key=api_key,
|
||||
|
||||
Reference in New Issue
Block a user