test(anthropic.py): more logging for test

This commit is contained in:
Krrish Dholakia
2024-03-12 19:07:52 -07:00
parent e342ecd873
commit 82c53d7e2f
+8
View File
@@ -262,7 +262,9 @@ def completion(
completion_response["stop_reason"]
)
print_verbose(f"_is_function_call: {_is_function_call}; stream: {stream}")
if _is_function_call == True and stream is not None and stream == True:
print_verbose(f"INSIDE ANTHROPIC STREAMING TOOL CALLING CONDITION BLOCK")
# return an iterator
streaming_model_response = ModelResponse(stream=True)
streaming_model_response.choices[0].finish_reason = model_response.choices[
@@ -270,6 +272,12 @@ def completion(
].finish_reason
streaming_model_response.choices[0].index = model_response.choices[0].index
_tool_calls = []
print_verbose(
f"type of model_response.choices[0]: {type(model_response.choices[0])}"
)
print_verbose(
f"type of streaming_model_response.choices[0]: {type(streaming_model_response.choices[0])}"
)
if isinstance(model_response.choices[0], litellm.Choices) and isinstance(
streaming_model_response.choices[0], litellm.utils.StreamingChoices
):