@lelemondev/sdk - v0.9.9
    Preparing search index...

    Function span

    • Manually capture a span for non-LLM operations (retrieval, embedding, tool, etc.) Must be called within a trace() block.

      Parameters

      Returns void

      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,
      });