Manually capture a span for non-LLM operations (retrieval, embedding, tool, etc.) Must be called within a trace() block.
span({ type: 'tool', name: 'query_database', toolCallId: 'tooluse_abc123', // Links to LLM that requested this input: { sql: 'SELECT ...' }, output: { rows: [...] }, durationMs: 15,}); Copy
span({ type: 'tool', name: 'query_database', toolCallId: 'tooluse_abc123', // Links to LLM that requested this input: { sql: 'SELECT ...' }, output: { rows: [...] }, durationMs: 15,});
span({ type: 'retrieval', name: 'pinecone-search', input: { topK: 5 }, output: { count: 10 }, durationMs: 50,}); Copy
span({ type: 'retrieval', name: 'pinecone-search', input: { topK: 5 }, output: { count: 10 }, durationMs: 50,});
Manually capture a span for non-LLM operations (retrieval, embedding, tool, etc.) Must be called within a trace() block.