Skip to main content
POST
/
spans
/
{span_id}
/
feedback
Python
from opperai import Opper

opper = Opper()

# Submit positive feedback (thumbs up)
response = opper.spans.submit_feedback(
    span_id="550e8400-e29b-41d4-a716-446655440000",
    score=1.0,
    comment="Great response, short and concise as I needed!"
)

print(f"Feedback submitted for span: {response.span_id}")
print(f"Score: {response.score}")
print(f"Example saved to dataset: {response.example_saved}")
{
  "span_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "score": 123,
  "example_saved": true
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

span_id
string<uuid>
required

The ID of the span to provide feedback on

Body

application/json
score
number
required

Feedback score (0.0=negative, 1.0=positive)

Required range: 0 <= x <= 1
comment
string | null

Optional comment explaining the feedback

Example:

"Great output, exactly what I needed"

save_to_dataset
boolean | null

Force save to dataset (True=force save, False=never save, None=use auto-save config)

Response

Successful Response

span_id
string<uuid>
required

The ID of the span

score
number
required

The feedback score that was submitted

example_saved
boolean
required

Whether the example was saved to the dataset