Feedback REST API

Use this API to collect feedback about Cortex Agents from end users.

Collect feedback about a Cortex Agent

POST /api/v2/databases/{database}/schemas/{schema}/agents/{name}:feedback

Creates a feedback event for a Cortex Agent response.

请求

路径参数

参数

描述

database

(Required) Identifier for the database to which the resource belongs. You can use the /api/v2/databases GET request to get a list of available databases.

schema

(Required) Identifier for the schema to which the resource belongs. You can use the /api/v2/databases/{database}/schemas GET request to get a list of available schemas for the specified database.

name

(Required) Identifier for the agent.

请求标头

标头

描述

Authorization

(必需)授权令牌。有关更多信息,请参阅 身份验证

Content-Type

(必需)应用程序/json

请求正文

The request body contains the feedback details for the agent response.

字段

类型

描述

orig_request_id

字符串

Request ID for the message associated with the feedback. If this value is not set, then feedback is logged for the agent.

positive

布尔

Whether the response was good (true) or bad (false).

feedback_message

字符串

The text for the detailed feedback message.

categories

array of strings

List of categories for the feedback. Each category is a string that represents a specific category of feedback.

thread_id

整数

The id of the thread.

Example request body for agent-level feedback

{
  "categories": [
    "Something worked well"
  ],
  "feedback_message": "this is fantastic!",
  "positive": true
}
Copy

Example request body for request-level feedback

{
  "orig_request_id": "aa123456-789a-a1-2a34-a1a234a56789",
  "categories": [
    "Something worked well"
  ],
  "feedback_message": "this is fantastic!",
  "positive": true
}
Copy

响应

A successful response returns a confirmation message.

Response headers

标头

描述

X-Snowflake-Request-ID

Unique ID of the API request.

Response body

{
  "status": "Feedback submitted successfully"
}
Copy

View feedback for Cortex Agents

For information about required privileges and how to query feedback events (including example SQL), see View feedback provided by users.

语言: 中文