Skip to main content

LogSpanFunctionContent

Span content for custom application logic. Use this type when logging functions in your own codebase — data transformations, business rules, preprocessing steps, or any operation that isn’t an LLM call, tool invocation, or retrieval.

Import

Type Definition

Properties

  • type - Discriminator field, always 'Function' for this content type
  • input - The function arguments as a JSON string (JSON.stringify() of the input parameters)
  • output - The function return value as a JSON string (JSON.stringify() of the result)
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


  • LogSpanContent — union type that includes LogSpanFunctionContent
  • LogSpanToolContent — for external tool/function-call executions triggered by an LLM
  • Span — class that accepts LogSpanContent via span.update()