import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.feedback.createCompletionFeedback({
createFeedbackRequest: {
id: "chatcmpl-abc123def456",
rating: "thumbs_up",
description: "The response was accurate and helpful.",
},
});
console.log(result);
}
run();{
"id": "chatcmpl-abc123def456",
"rating": "thumbs_up",
"description": "The response was accurate and helpful.",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}Submit user feedback for a specific chat completion to track satisfaction and model performance. Each completion can only receive feedback once.
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.feedback.createCompletionFeedback({
createFeedbackRequest: {
id: "chatcmpl-abc123def456",
rating: "thumbs_up",
description: "The response was accurate and helpful.",
},
});
console.log(result);
}
run();{
"id": "chatcmpl-abc123def456",
"rating": "thumbs_up",
"description": "The response was accurate and helpful.",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}Authenticate with your MKA1 API key at the API gateway: Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, also send X-On-Behalf-Of to identify the end user making the request.
Optional external user identifier for multi-user server-side integrations. Use this when acting on behalf of one of your end users.
Request parameters for creating feedback. Allows users to rate and comment on model outputs.
Request ID to associate this feedback with. Use chat completion request ID or response ID.
Optional feedback rating. Can be 'thumbs_up' for positive feedback or 'thumbs_down' for negative feedback.
thumbs_up, thumbs_down Optional detailed feedback description. Use this to provide specific comments, suggestions, or explain the rating (max 2000 characters).
2000OK
Response containing the created feedback entry with generated ID and timestamps.
The request ID that this feedback is associated with
The feedback rating indicating user satisfaction
thumbs_up, thumbs_down Optional detailed feedback description providing additional context or explanation (max 2000 characters)
2000Timestamp when the feedback was created
Timestamp when the feedback was last updated
Was this page helpful?