import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.conversations.createItems({
conversationId: "conv_abc123",
createItemsRequest: {
items: [
{
type: "message",
role: "user",
content: "What is the weather today?",
},
],
},
});
console.log(result);
}
run();{
"object": "list",
"data": [
{
"id": "item_abc123",
"response_id": "resp_abc123",
"type": "message",
"role": "user",
"content": "What is the weather today?"
}
],
"has_more": false,
"last_id": "item_abc123"
}Create items in a conversation with the given ID.
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.conversations.createItems({
conversationId: "conv_abc123",
createItemsRequest: {
items: [
{
type: "message",
role: "user",
content: "What is the weather today?",
},
],
},
});
console.log(result);
}
run();{
"object": "list",
"data": [
{
"id": "item_abc123",
"response_id": "resp_abc123",
"type": "message",
"role": "user",
"content": "What is the weather today?"
}
],
"has_more": false,
"last_id": "item_abc123"
}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.
The ID of the conversation
Items to add to the conversation. Min 1, max 20 items at a time.
1 - 20 elementsA message input item with a role and content. Represents a single turn in the conversation from a user, assistant, system, or developer.
Show child attributes
Additional fields to include (TODO: not implemented yet)
OK
A list of conversation items.
A message input item with a role and content. Represents a single turn in the conversation from a user, assistant, system, or developer.
Show child attributes
Whether there are more items
ID of the last item in the current page
Was this page helpful?