kaxil commented on code in PR #71463:
URL: https://github.com/apache/airflow/pull/71463#discussion_r3766972481


##########
providers/anthropic/src/airflow/providers/anthropic/hooks/anthropic.py:
##########
@@ -646,6 +646,40 @@ def get_session(self, session_id: str) -> 
BetaManagedAgentsSession:
         self._require_first_party("Managed Agents")
         return self._first_party_conn.beta.sessions.retrieve(session_id)
 
+    def get_session_usage(self, session_id: str) -> dict[str, Any]:

Review Comment:
   Not able to -- `get_session_usage(session_id)` takes the session to look up, 
and a property cannot take an argument. It is also a network call rather than 
an attribute read, so a property would hide a round trip behind attribute 
access.
   
   There is a related no-argument accessor though: `summarize_usage(session)` 
flattens a session object you already hold, which is what the failure paths use 
so they do not pay a second retrieve. If the concern was the call looking 
heavier than it is, that one is the cheap path.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to