fix _convert_tool_response_to_message

This commit is contained in:
Ishaan Jaff 2024-11-14 12:45:37 -08:00
parent f5f36fb96c
commit ce235facd0

View file

@ -339,8 +339,10 @@ class AnthropicChatCompletion(BaseLLM):
try:
if json_mode_content_str is not None:
args = json.loads(json_mode_content_str)
values: Optional[dict] = args.get("values")
if values is not None:
if (
isinstance(args, dict)
and (values := args.get("values")) is not None
):
_message = litellm.Message(content=json.dumps(values))
return _message
else: