Create Feedback

Create new feedback

post

This endpoint allows users to submit feedback for a particular interaction or response.

Authorizations
Body
trace_idstringRequired

Unique identifier for the request trace.

valueinteger · min: -10 · max: 10Required

Feedback value, an integer between -10 and 10.

weightnumber · float · max: 1Optional

Weight of the feedback, a float between 0 and 1. Default is 1.0.

Default: 1
Responses
200

Feedback successfully saved

application/json
post
from portkey_ai import Portkey

portkey = Portkey(api_key="PORTKEY_API_KEY")

feedback = portkey.feedback.create(
  trace_id="REQUEST_TRACE_ID",
  value=1
)

print(feedback)
200

Feedback successfully saved

{
  "status": "text",
  "message": "text",
  "feedback_ids": [
    "text"
  ]
}

Last updated

Was this helpful?