Skip to content

Llm.Conversations

Overview

Available Operations

create

Create a conversation to store and retrieve conversation state across Response API calls.

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  serverURL: "https://api.example.com",
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.conversations.create({});

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmConversationsCreate } from "@meetkai/mka1/funcs/llmConversationsCreate.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  serverURL: "https://api.example.com",
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmConversationsCreate(sdk, {});
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmConversationsCreate failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmConversationsCreateMutation
} from "@meetkai/mka1/react-query/llmConversationsCreate.js";

Parameters

ParameterTypeRequiredDescription
requestcomponents.CreateConversationRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ConversationObject>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

list

List all conversations for the authenticated user with pagination support.

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  serverURL: "https://api.example.com",
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.conversations.list({});

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmConversationsList } from "@meetkai/mka1/funcs/llmConversationsList.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  serverURL: "https://api.example.com",
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmConversationsList(sdk, {});
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmConversationsList failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Query hooks for fetching data.
  useLlmConversationsList,
  useLlmConversationsListSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchLlmConversationsList,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateLlmConversationsList,
  invalidateAllLlmConversationsList,
} from "@meetkai/mka1/react-query/llmConversationsList.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.ConversationsListRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ConversationListObject>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

get

Get a conversation by ID.

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  serverURL: "https://api.example.com",
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.conversations.get({
    conversationId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmConversationsGet } from "@meetkai/mka1/funcs/llmConversationsGet.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  serverURL: "https://api.example.com",
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmConversationsGet(sdk, {
    conversationId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmConversationsGet failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Query hooks for fetching data.
  useLlmConversationsGet,
  useLlmConversationsGetSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchLlmConversationsGet,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateLlmConversationsGet,
  invalidateAllLlmConversationsGet,
} from "@meetkai/mka1/react-query/llmConversationsGet.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.ConversationsRetrieveRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ConversationObject>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

update

Update a conversation's metadata.

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  serverURL: "https://api.example.com",
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.conversations.update({
    conversationId: "<id>",
    update: {
      metadata: {
        "key": "<value>",
        "key1": "<value>",
      },
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmConversationsUpdate } from "@meetkai/mka1/funcs/llmConversationsUpdate.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  serverURL: "https://api.example.com",
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmConversationsUpdate(sdk, {
    conversationId: "<id>",
    update: {
      metadata: {
        "key": "<value>",
        "key1": "<value>",
      },
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmConversationsUpdate failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmConversationsUpdateMutation
} from "@meetkai/mka1/react-query/llmConversationsUpdate.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.ConversationsUpdateRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ConversationObject>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

delete

Delete a conversation. Items in the conversation will not be deleted.

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  serverURL: "https://api.example.com",
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.conversations.delete({
    conversationId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmConversationsDelete } from "@meetkai/mka1/funcs/llmConversationsDelete.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  serverURL: "https://api.example.com",
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmConversationsDelete(sdk, {
    conversationId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmConversationsDelete failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmConversationsDeleteMutation
} from "@meetkai/mka1/react-query/llmConversationsDelete.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.ConversationsDeleteRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ConversationDeletedObject>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

listItems

List all items for a conversation with the given ID.

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  serverURL: "https://api.example.com",
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.conversations.listItems({
    conversationId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmConversationsListItems } from "@meetkai/mka1/funcs/llmConversationsListItems.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  serverURL: "https://api.example.com",
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmConversationsListItems(sdk, {
    conversationId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmConversationsListItems failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Query hooks for fetching data.
  useLlmConversationsListItems,
  useLlmConversationsListItemsSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchLlmConversationsListItems,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateLlmConversationsListItems,
  invalidateAllLlmConversationsListItems,
} from "@meetkai/mka1/react-query/llmConversationsListItems.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.ConversationsItemsListRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ItemListObject>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

createItems

Create items in a conversation with the given ID.

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  serverURL: "https://api.example.com",
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.conversations.createItems({
    conversationId: "<id>",
    createItemsRequest: {
      items: [],
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmConversationsCreateItems } from "@meetkai/mka1/funcs/llmConversationsCreateItems.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  serverURL: "https://api.example.com",
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmConversationsCreateItems(sdk, {
    conversationId: "<id>",
    createItemsRequest: {
      items: [],
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmConversationsCreateItems failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmConversationsCreateItemsMutation
} from "@meetkai/mka1/react-query/llmConversationsCreateItems.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.ConversationsItemsCreateRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ItemListObject>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

getItem

Get a single item from a conversation with the given IDs.

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  serverURL: "https://api.example.com",
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.conversations.getItem({
    conversationId: "<id>",
    itemId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmConversationsGetItem } from "@meetkai/mka1/funcs/llmConversationsGetItem.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  serverURL: "https://api.example.com",
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmConversationsGetItem(sdk, {
    conversationId: "<id>",
    itemId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmConversationsGetItem failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Query hooks for fetching data.
  useLlmConversationsGetItem,
  useLlmConversationsGetItemSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchLlmConversationsGetItem,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateLlmConversationsGetItem,
  invalidateAllLlmConversationsGetItem,
} from "@meetkai/mka1/react-query/llmConversationsGetItem.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.ConversationsItemsRetrieveRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.ConversationsItemsRetrieveResponseBody>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

deleteItem

Delete an item from a conversation with the given IDs.

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  serverURL: "https://api.example.com",
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.conversations.deleteItem({
    conversationId: "<id>",
    itemId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmConversationsDeleteItem } from "@meetkai/mka1/funcs/llmConversationsDeleteItem.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  serverURL: "https://api.example.com",
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmConversationsDeleteItem(sdk, {
    conversationId: "<id>",
    itemId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmConversationsDeleteItem failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmConversationsDeleteItemMutation
} from "@meetkai/mka1/react-query/llmConversationsDeleteItem.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.ConversationsItemsDeleteRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ConversationObject>

Errors

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*