GetChatCompletionByRequestIdResponseBody
The chat completion record including request details, token usage, and any associated feedback.
Example Usage
typescript
import { GetChatCompletionByRequestIdResponseBody } from "@meetkai/mka1/models/operations";
let value: GetChatCompletionByRequestIdResponseBody = {
id: "<id>",
requestId: "<id>",
userId: "<id>",
model: "A8",
promptTokens: 5107.45,
completionTokens: 6140.53,
totalTokens: 5450.88,
finishReason: null,
stream: true,
feedbackRating: "thumbs_up",
feedbackDescription: "<value>",
createdAt: new Date("2023-02-07T20:45:14.647Z"),
updatedAt: new Date("2025-01-21T04:20:55.754Z"),
};Fields
| Field | Type | Required | Description |
|---|---|---|---|
id | string | ✔️ | Unique database identifier for this chat completion record |
requestId | string | ✔️ | The chat completion request ID (chatcmpl-xxx) returned in the API response |
userId | string | ✔️ | The user ID who made this request, if provided in the original request |
model | string | ✔️ | The model that was used for this chat completion (e.g., 'gpt-4', 'claude-3-opus') |
promptTokens | number | ✔️ | Number of tokens used in the input/prompt |
completionTokens | number | ✔️ | Number of tokens generated in the output/completion |
totalTokens | number | ✔️ | Total number of tokens used (prompt + completion) |
finishReason | string | ✔️ | The reason the model stopped generating. Can be 'stop' (natural end), 'length' (max tokens), 'tool_calls' (function call), or 'content_filter' (filtered content). |
stream | boolean | ✔️ | Whether this was a streaming request (true) or non-streaming (false) |
messages | any | ➖ | The chat messages from the request stored as JSONB. Contains the conversation history sent to the model. |
feedbackRating | operations.FeedbackRating | ✔️ | User feedback rating for this completion, if provided. Can be 'thumbs_up' or 'thumbs_down'. |
feedbackDescription | string | ✔️ | Detailed user feedback description for this completion, if provided |
createdAt | Date | ✔️ | Timestamp when this chat completion was created |
updatedAt | Date | ✔️ | Timestamp when this record was last updated (e.g., when feedback was added) |