Python (SDK)
from meetkai_mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.llm.feedback.batch_get_response_feedback(ids=[
"resp-xyz789",
"resp-missing123",
])
# Handle response
print(res)import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.feedback.batchGetResponseFeedback({
batchGetFeedbackRequest: {
ids: [
"resp-xyz789",
"resp-missing123",
],
},
});
console.log(result);
}
run();using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
using System.Collections.Generic;
var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Llm.Feedback.BatchGetResponseFeedbackAsync(body: new BatchGetFeedbackRequest() {
Ids = new List<string>() {
"resp-xyz789",
"resp-missing123",
},
});
// handle responsecurl --request POST \
--url https://apigw.mka1.com/api/v1/llm/feedback/responses/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
"resp-xyz789",
"resp-missing123"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ids: ['resp-xyz789', 'resp-missing123']})
};
fetch('https://apigw.mka1.com/api/v1/llm/feedback/responses/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apigw.mka1.com/api/v1/llm/feedback/responses/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ids' => [
'resp-xyz789',
'resp-missing123'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apigw.mka1.com/api/v1/llm/feedback/responses/batch"
payload := strings.NewReader("{\n \"ids\": [\n \"resp-xyz789\",\n \"resp-missing123\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apigw.mka1.com/api/v1/llm/feedback/responses/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n \"resp-xyz789\",\n \"resp-missing123\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.mka1.com/api/v1/llm/feedback/responses/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ids\": [\n \"resp-xyz789\",\n \"resp-missing123\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "resp-xyz789",
"rating": "thumbs_down",
"description": "The response missed key details.",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
{
"id": "resp-missing123",
"error": "not_found"
}
]
}Feedback
Batch retrieve feedback for multiple responses
Retrieves feedback for multiple agent responses in a single batch request.
POST
/
api
/
v1
/
llm
/
feedback
/
responses
/
batch
Python (SDK)
from meetkai_mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.llm.feedback.batch_get_response_feedback(ids=[
"resp-xyz789",
"resp-missing123",
])
# Handle response
print(res)import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.feedback.batchGetResponseFeedback({
batchGetFeedbackRequest: {
ids: [
"resp-xyz789",
"resp-missing123",
],
},
});
console.log(result);
}
run();using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
using System.Collections.Generic;
var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Llm.Feedback.BatchGetResponseFeedbackAsync(body: new BatchGetFeedbackRequest() {
Ids = new List<string>() {
"resp-xyz789",
"resp-missing123",
},
});
// handle responsecurl --request POST \
--url https://apigw.mka1.com/api/v1/llm/feedback/responses/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
"resp-xyz789",
"resp-missing123"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ids: ['resp-xyz789', 'resp-missing123']})
};
fetch('https://apigw.mka1.com/api/v1/llm/feedback/responses/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apigw.mka1.com/api/v1/llm/feedback/responses/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ids' => [
'resp-xyz789',
'resp-missing123'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apigw.mka1.com/api/v1/llm/feedback/responses/batch"
payload := strings.NewReader("{\n \"ids\": [\n \"resp-xyz789\",\n \"resp-missing123\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apigw.mka1.com/api/v1/llm/feedback/responses/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n \"resp-xyz789\",\n \"resp-missing123\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.mka1.com/api/v1/llm/feedback/responses/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ids\": [\n \"resp-xyz789\",\n \"resp-missing123\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "resp-xyz789",
"rating": "thumbs_down",
"description": "The response missed key details.",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
{
"id": "resp-missing123",
"error": "not_found"
}
]
}Authorizations
Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.
Headers
Optional external end-user identifier forwarded by the API gateway.
Body
application/json
Request parameters for batch retrieving feedback by multiple request IDs.
Array of request IDs (chatcmpl-xxx or resp-xxx) to retrieve feedback for
Required array length:
1 - 100 elementsResponse
200 - application/json
OK
Response containing batch feedback results. Each result is either the feedback data or a not_found error.
Array of feedback results in the same order as the input IDs
Error result when the completion/response ID doesn't exist
- Option 1
- Option 2
Show child attributes
Show child attributes
Was this page helpful?
⌘I