Skip to main content

Annotations

Create an Annotation

Attach one or more annotations to a specific span. Each annotation references an evaluator by key and supplies a value (string for text/single-select, number for range, array for multi-select).
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    orq.annotations.create(trace_id="<id>", span_id="<id>", annotations=[])

    # Use the SDK ...

Delete an Annotation

Remove one or more annotations from a specific span by their evaluator keys.
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    orq.annotations.delete(trace_id="<id>", span_id="<id>", keys=[
        "<value 1>",
    ])

    # Use the SDK ...