Skip to main content

LogSpanOtherContent

Catch-all span content for any operation that doesn’t fit the predefined categories. Use this type when you need to log a step that isn’t an LLM call, embedding, tool execution, retrieval, guardrail, or custom function — for example, cache lookups, external API calls, queue operations, or any other custom workflow step.

Import

import type { LogSpanOtherContent } from '@adaline/api';
import { LogSpanOtherContentTypeEnum } from '@adaline/api';

Type Definition

interface LogSpanOtherContent {
  type: 'Other';
  input: string;                   // JSON string (must be valid JSON)
  output: string;                  // JSON string (must be valid JSON)
}

Properties

  • type - Discriminator field, always 'Other' for this content type
  • input - The operation input as a JSON string (JSON.stringify() of the input data)
  • output - The operation result as a JSON string (JSON.stringify() of the output data)
Both input and output must be valid, parseable JSON strings (the result of JSON.stringify()). Passing a plain string that isn’t valid JSON will cause the span to be rejected.

Example

async function checkCache(key: string) {
  const cached = await redis.get(key);
  return cached ? { hit: true, value: JSON.parse(cached) } : { hit: false };
}

const input = { key: 'user:123:preferences', store: 'redis' };
const result = await checkCache(input.key);

span.update({
  content: {
    type: 'Other',
    input: JSON.stringify(input),
    output: JSON.stringify(result),
  },
});

  • LogSpanContent — union type that includes LogSpanOtherContent
  • Span — class that accepts LogSpanContent via span.update()