Skip to content

Commit

Permalink
token cost print fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bboynton97 committed May 3, 2024
1 parent 76d494d commit 82ddffa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions agentops/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,13 @@ def end_session(self,

self._session.video = video
self._session.end_session(end_state, end_state_reason)
token_cost = Decimal(self._worker.end_session(self._session))
token_cost = self._worker.end_session(self._session)
if token_cost == 'unknown':
print('🖇 AgentOps: Could not determine cost of run.')
else:

token_cost_d = Decimal(token_cost)
print('🖇 AgentOps: This run cost ${}'.format('{:.2f}'.format(
token_cost) if token_cost == 0 else '{:.6f}'.format(token_cost)))
token_cost_d) if token_cost_d == 0 else '{:.6f}'.format(token_cost_d)))
self._session = None
self._worker = None

Expand Down

0 comments on commit 82ddffa

Please sign in to comment.