Skip to content

Commit

Permalink
handle unknown cost (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
bboynton97 authored Apr 9, 2024
1 parent 5c11613 commit 3d1b80c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions agentops/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,11 @@ def end_session(self,

self._session.video = video
self._session.end_session(end_state, end_state_reason)
token_cost = float(self._worker.end_session(self._session))
print('🖇 AgentOps: This run cost ${:.6f}'.format(token_cost))
token_cost = self._worker.end_session(self._session)
if token_cost is 'unknown':
print('🖇 AgentOps: Could not determine cost of run.')
else:
print('🖇 AgentOps: This run cost ${:.6f}'.format(float(token_cost)))
self._session = None
self._worker = None

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "agentops"
version = "0.1.2"
version = "0.1.3"
authors = [
{ name="Alex Reibman", email="[email protected]" },
{ name="Shawn Qiu", email="[email protected]" },
Expand Down

0 comments on commit 3d1b80c

Please sign in to comment.