Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return token cost on session_end #264

Merged
merged 5 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agentops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def end_session(
video (str, optional): URL to a video recording of the session
is_auto_end (bool, optional): is this an automatic use of end_session and should be skipped with bypass_auto_end_session
"""
Client().end_session(
return Client().end_session(
end_state=end_state,
end_state_reason=end_state_reason,
video=video,
Expand Down
8 changes: 4 additions & 4 deletions agentops/client.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
AgentOps client module that provides a client class with public interfaces and configuration.
AgentOps client module that provides a client class with public interfaces and configuration.

Classes:
Client: Provides methods to interact with the AgentOps service.
Classes:
Client: Provides methods to interact with the AgentOps service.
"""
areibman marked this conversation as resolved.
Show resolved Hide resolved

import os
Expand Down Expand Up @@ -80,7 +80,6 @@ def __init__(
inherited_session_id: Optional[str] = None,
skip_auto_end_session: Optional[bool] = False,
):

if override is not None:
logger.warning(
"The 'override' parameter is deprecated. Use 'instrument_llm_calls' instead.",
Expand Down Expand Up @@ -439,6 +438,7 @@ def end_session(

self._session = None
self._worker = None
return token_cost_d

def create_agent(self, name: str, agent_id: Optional[str] = None):
if agent_id is None:
Expand Down
Loading