fix(anthropic.py): fix linting errors

This commit is contained in:
Krrish Dholakia 2024-03-12 10:23:56 -07:00
parent f00c489c1b
commit 84c7a5b693

View file

@ -269,7 +269,9 @@ def completion(
].finish_reason
streaming_model_response.choices[0].index = model_response.choices[0].index
_tool_calls = []
if isinstance(model_response.choices[0], litellm.Choices):
if isinstance(model_response.choices[0], litellm.Choices) and isinstance(
streaming_model_response.choices[0], litellm.utils.StreamingChoices
):
if getattr(
model_response.choices[0].message, "tool_calls", None
) is not None and isinstance(