Skip to content

Commit 3d1cce0

Browse files
minor fixes
1 parent 42d641f commit 3d1cce0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/content/docs/ai-gateway/evaluations/add-human-feedback-api.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar:
77

88
This guide will walk you through the steps of adding human feedback to an AI Gateway request using the Cloudflare API. You will learn how to retrieve the relevant request logs, and submit feedback using the API.
99

10-
## Step 1. Create an API Token
10+
## 1. Create an API Token
1111

1212
1. [Create an API token](/fundamentals/api/get-started/create-token/) with the following permissions:
1313

@@ -17,11 +17,11 @@ This guide will walk you through the steps of adding human feedback to an AI Gat
1717
2. Get your [Account ID](/fundamentals/setup/find-account-and-zone-ids/).
1818
3. Using that API token and Account ID, send a [`POST` request](/api/operations/aig-config-create-gateway) to the Cloudflare API.
1919

20-
## Step 2. Using the API Token
20+
## 2. Using the API Token
2121

2222
Once you have the token, you can use it in API requests by adding it to the authorization header as a bearer token. Here is an example of how to use it in a request:
2323

24-
```bash
24+
````bash
2525
curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/logs" \
2626
--header "Authorization: Bearer {your_api_token}"
2727

@@ -53,7 +53,7 @@ In the example below, the `cf-aig-log-id` is `01JADMCQQQBWH3NXZ5GCRN98DP`.
5353
"cf-aig-log-id": "01JADMCQQQBWH3NXZ5GCRN98DP"
5454
}
5555
}
56-
```
56+
````
5757
5858
### Method 2: Retrieve the `cf-aig-log-id` via API (GET request)
5959
@@ -119,7 +119,7 @@ In the example below, the `id` is `01JADMCQQQBWH3NXZ5GCRN98DP`.
119119
}
120120
```
121121
122-
## Step 4. Submit feedback via PATCH request
122+
## 4. Submit feedback via PATCH request
123123
124124
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:
125125
@@ -143,7 +143,7 @@ Add the following in the request body to submit negative feedback:
143143
}
144144
```
145145
146-
## Step 5. Verify the feedback submission
146+
## 5. Verify the feedback submission
147147
148148
You can verify the feedback submission in two ways:
149149

0 commit comments

Comments
 (0)