MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / get_sessions

Function get_sessions

app/api/agentops/exporter/processor.py:233–246  ·  view source on GitHub ↗

Get raw session records without processing them as traces yet

(offset: int, limit: int)

Source from the content-addressed store, hash-verified

231
232
233async def get_sessions(offset: int, limit: int) -> list[Session]:
234 """Get raw session records without processing them as traces yet"""
235 query = """
236 SELECT * FROM {table_name}
237 WHERE id > '{last_session_id}'
238 ORDER BY id ASC
239 LIMIT {limit}
240 OFFSET {offset}
241 """
242 sessions = []
243 lsid = LAST_SESSION_ID if LAST_SESSION_ID else '00000000-0000-0000-0000-000000000000'
244 async for session in supabase[Session].fetchall(query, offset=offset, limit=limit, last_session_id=lsid):
245 sessions.append(session)
246 return sessions
247
248
249async def get_sessions_as_traces(offset: int, limit: int) -> AsyncGenerator[Trace, None]:

Callers 1

get_sessions_as_tracesFunction · 0.85

Calls 1

fetchallMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…