MCPcopy
hub / github.com/AgentOps-AI/agentops / get

Method get

app/api/agentops/auth/session.py:45–62  ·  view source on GitHub ↗

Retrieve a session by its ID. Args: session_id (str | UUID): The session ID to look up Returns: Optional[Session]: Session object if found, None otherwise

(cls, session_id: str | UUID)

Source from the content-addressed store, hash-verified

43
44 @classmethod
45 def get(cls, session_id: str | UUID) -> Optional['Session']:
46 """
47 Retrieve a session by its ID.
48
49 Args:
50 session_id (str | UUID): The session ID to look up
51
52 Returns:
53 Optional[Session]: Session object if found, None otherwise
54 """
55 session_id = str(session_id)
56 if user_id := cache.get(_make_key(session_id)):
57 return cls(
58 session_id=UUID(session_id),
59 user_id=UUID(user_id),
60 )
61
62 return None
63
64 @classmethod
65 def create(cls, user_id: UUID) -> 'Session':

Callers 15

mainFunction · 0.45
mainFunction · 0.45
index.tsFile · 0.45
_get_auth_payloadMethod · 0.45
__call__Method · 0.45
__call__Method · 0.45
get_user_orgsFunction · 0.45
accept_org_inviteFunction · 0.45
remove_from_orgFunction · 0.45
update_member_licensesFunction · 0.45

Calls 1

_make_keyFunction · 0.85