You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/ai-gateway/evaluations/add-human-feedback-api.mdx
+23-12Lines changed: 23 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,16 +44,19 @@ This method allows you to directly find the `cf-aig-log-id` within the header of
44
44
The steps below outline how to do this.
45
45
46
46
1.**Make a Request to the AI Gateway**: This could be a request your application sends to the AI Gateway. Once the request is made, the response will contain various pieces of metadata.
47
-
2.**Check the Response Body**: The response body will include a field named `cf-aig-log-id`. This is the identifier you will need to submit feedback.
47
+
2.**Check the Response Headers**: The response will include a header named `cf-aig-log-id`. This is the identifier you will need to submit feedback.
48
48
49
49
In the example below, the `cf-aig-log-id` is `01JADMCQQQBWH3NXZ5GCRN98DP`.
50
50
51
51
```json
52
52
{
53
53
"status": "success",
54
+
"headers": {
55
+
"cf-aig-log-id": "01JADMCQQQBWH3NXZ5GCRN98DP"
56
+
// other headers...
57
+
},
54
58
"data": {
55
59
"response": "Sample response data",
56
-
"cf-aig-log-id": "01JADMCQQQBWH3NXZ5GCRN98DP"
57
60
}
58
61
}
59
62
```
@@ -126,18 +129,26 @@ In the example below, the `id` is `01JADMCQQQBWH3NXZ5GCRN98DP`.
126
129
127
130
You can also retrieve the `cf-aig-log-id` using a binding, which streamlines the process. Here’s how to retrieve the log ID directly:
The `aiGatewayLogId` property, will only old the last inference call log id.
148
+
149
+
150
+
:::
151
+
141
152
## 4. Submit feedback via PATCH request
142
153
143
154
Once you have both the API token and the `cf-aig-log-id`, you can send a PATCH request to submit feedback. Use the following URL format, replacing the `{account_id}`, `{gateway_id}`, and `{log_id}` with your specific details:
0 commit comments