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

Function create_tool_event

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

Save tool event data to ClickHouse.

(data: dict)

Source from the content-addressed store, hash-verified

117
118
119async def create_tool_event(data: dict) -> None:
120 """Save tool event data to ClickHouse."""
121 assert 'session_id' in data, 'session_id must be provided to create tool event data.'
122 assert 'agent_id' in data, 'agent_id must be provided to create tool event data.'
123 project_id = await _get_project_id(data['session_id'])
124
125 tool_event = ToolEvent(**data)
126 span: Span = await tool_event.to_span(
127 trace_id=str(data['session_id']), parent_span_id=str(data['agent_id']), project_id=str(project_id)
128 )
129 await clickhouse_create_span(span)
130 logger.info(f"Created ClickHouse tool event as span {span}")
131
132
133async def update_tool_event(data: dict) -> None:

Callers

nothing calls this directly

Calls 4

to_spanMethod · 0.95
_get_project_idFunction · 0.85
clickhouse_create_spanFunction · 0.85
ToolEventClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…