Skip to main content

LogSpanEmbeddingsContent

Span content for embedding generation calls. Use this type when logging operations that convert text into vector representations, such as calls to OpenAI’s text-embedding-3-large or similar models.

Import

Type Definition

Properties

  • type - Discriminator field, always 'Embeddings' for this content type
  • input - The embedding request as a JSON string (JSON.stringify() of the request object)
  • output - The embedding response as a JSON string (JSON.stringify() of the response object)
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 LogSpanEmbeddingsContent
  • LogSpanRetrievalContent — often used alongside embeddings for RAG pipelines
  • Span — class that accepts LogSpanContent via span.update()