LogSpanRetrievalContent
Span content for retrieval operations. Use this type when logging RAG (Retrieval-Augmented Generation) queries — vector similarity searches, keyword lookups, or any step that fetches context documents before passing them to an LLM.Import
Type Definition
Properties
type- Discriminator field, always'Retrieval'for this content typeinput- The retrieval query as a JSON string (JSON.stringify()of the search parameters)output- The retrieved results as a JSON string (JSON.stringify()of the documents/chunks)
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
Related
- LogSpanContent — union type that includes
LogSpanRetrievalContent - LogSpanEmbeddingsContent — often used before retrieval to generate query embeddings
- Span — class that accepts
LogSpanContentviaspan.update()