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

Function create_llm_event

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

Save LLM event data to ClickHouse.

(data: dict)

Source from the content-addressed store, hash-verified

68
69
70async def create_llm_event(data: dict) -> None:
71 """Save LLM event data to ClickHouse."""
72 assert 'session_id' in data, 'session_id must be provided to create LLM event data.'
73 assert 'agent_id' in data, 'agent_id must be provided to create LLM event data.'
74 project_id = await _get_project_id(data['session_id'])
75
76 llm_event = LLMEvent(**data)
77 span: Span = await llm_event.to_span(
78 trace_id=str(data['session_id']), parent_span_id=str(data['agent_id']), project_id=str(project_id)
79 )
80 await clickhouse_create_span(span)
81 logger.info(f"Created ClickHouse LLM event as span {span}")
82
83
84async def update_llm_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
LLMEventClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…