Save agent data to ClickHouse.
(data: dict)
| 51 | |
| 52 | |
| 53 | async 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 | |
| 66 | async def update_agent(data: dict) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…