OpenInference JS
    Preparing search index...
    • Generates attributes for document operations.

      Creates OpenTelemetry attributes for individual document processing, including content, ID, metadata, and score information.

      Parameters

      • document: Document

        The document to generate attributes for

      • documentIndex: number

        The index of the document in a collection

      • keyPrefix: string

        The prefix for attribute keys (e.g., "reranker.input_documents")

      Returns Attributes

      OpenTelemetry attributes for the document

      const attrs = getDocumentAttributes(
      { content: "Sample document", id: "doc123", score: 0.8 },
      0,
      "reranker.input_documents"
      );