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

Function create_agent

app/api/agentops/exporter/export.py:53–63  ·  view source on GitHub ↗

Save agent data to ClickHouse.

(data: dict)

Source from the content-addressed store, hash-verified

51
52
53async def create_agent(data: dict) -> None:
54 """Save agent data to ClickHouse."""
55 assert 'session_id' in data, 'session_id must be provided to create agent data.'
56 project_id = await _get_project_id(data['session_id'])
57
58 agent = Agent(**data)
59 span = await agent.to_span(
60 trace_id=str(data['session_id']), parent_span_id=str(data['session_id']), project_id=str(project_id)
61 )
62 await clickhouse_create_span(span)
63 logger.info(f"Created ClickHouse agent as span {span}")
64
65
66async def update_agent(data: dict) -> None:

Callers

nothing calls this directly

Calls 4

to_spanMethod · 0.95
_get_project_idFunction · 0.85
AgentClass · 0.85
clickhouse_create_spanFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…