chat_completion_response_includes_annotations

This commit is contained in:
Ishaan Jaff 2025-03-22 17:36:22 -07:00
parent c2b9e96b3d
commit 8321159889

View file

@ -104,7 +104,12 @@ class StandardBuiltInToolCostTracking:
) -> bool: ) -> bool:
for _choice in response_object.choices: for _choice in response_object.choices:
message = getattr(_choice, "message", None) message = getattr(_choice, "message", None)
if message is not None and hasattr(message, "annotations"): if (
message is not None
and hasattr(message, "annotations")
and message.annotations is not None
and len(message.annotations) > 0
):
return True return True
return False return False