Skip to content

Llm.Feedback

Overview

Available Operations

createCompletionFeedback

Submit user feedback for a specific chat completion to track satisfaction and model performance. Each completion can only receive feedback once.

Example Usage

typescript
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();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await llmFeedbackCreateCompletionFeedback(sdk, {
    createFeedbackRequest: {
      id: "chatcmpl-abc123def456",
      rating: "thumbs_up",
      description: "The response was accurate and helpful.",
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmFeedbackCreateCompletionFeedback 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.
  useLlmFeedbackCreateCompletionFeedbackMutation
} from "@meetkai/mka1/react-query/llmFeedbackCreateCompletionFeedback.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.CreateCompletionFeedbackRequest✔️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.CreateFeedbackResponse>

Errors

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

listCompletionFeedback

Retrieves a paginated list of feedback entries recorded on the caller's chat completions, ordered by the completion's creation date. Supports filtering by rating. An after cursor that no longer resolves to a completion visible to the caller returns 400; restart pagination from the first page.

Example Usage

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

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.feedback.listCompletionFeedback({
    after: "chatcmpl-abc123def456",
    limit: 25,
    rating: "thumbs_up",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await llmFeedbackListCompletionFeedback(sdk, {
    after: "chatcmpl-abc123def456",
    limit: 25,
    rating: "thumbs_up",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmFeedbackListCompletionFeedback 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.
  useLlmFeedbackListCompletionFeedback,
  useLlmFeedbackListCompletionFeedbackSuspense,

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

Parameters

ParameterTypeRequiredDescription
requestoperations.ListCompletionFeedbackRequest✔️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.ListFeedbackResponse>

Errors

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

getCompletionFeedback

Retrieves the existing feedback rating and description for a specific chat completion.

Example Usage

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

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.feedback.getCompletionFeedback({
    id: "chatcmpl-abc123def456",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await llmFeedbackGetCompletionFeedback(sdk, {
    id: "chatcmpl-abc123def456",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmFeedbackGetCompletionFeedback 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.
  useLlmFeedbackGetCompletionFeedback,
  useLlmFeedbackGetCompletionFeedbackSuspense,

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

Parameters

ParameterTypeRequiredDescription
requestoperations.GetCompletionFeedbackRequest✔️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.GetFeedbackResponse>

Errors

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

updateCompletionFeedback

Updates or modifies existing feedback for a specific chat completion. Useful for allowing users to revise their initial submissions.

Example Usage

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

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.feedback.updateCompletionFeedback({
    id: "chatcmpl-abc123def456",
    requestBody: {
      rating: "thumbs_down",
      description: "Could be more detailed.",
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await llmFeedbackUpdateCompletionFeedback(sdk, {
    id: "chatcmpl-abc123def456",
    requestBody: {
      rating: "thumbs_down",
      description: "Could be more detailed.",
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmFeedbackUpdateCompletionFeedback 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.
  useLlmFeedbackUpdateCompletionFeedbackMutation
} from "@meetkai/mka1/react-query/llmFeedbackUpdateCompletionFeedback.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.UpdateCompletionFeedbackRequest✔️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.UpdateFeedbackResponse>

Errors

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

batchGetCompletionFeedback

Retrieves feedback for multiple chat completions in a single batch request.

Example Usage

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

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.feedback.batchGetCompletionFeedback({
    batchGetFeedbackRequest: {
      ids: [
        "chatcmpl-abc123def456",
        "chatcmpl-missing123",
      ],
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await llmFeedbackBatchGetCompletionFeedback(sdk, {
    batchGetFeedbackRequest: {
      ids: [
        "chatcmpl-abc123def456",
        "chatcmpl-missing123",
      ],
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmFeedbackBatchGetCompletionFeedback 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.
  useLlmFeedbackBatchGetCompletionFeedbackMutation
} from "@meetkai/mka1/react-query/llmFeedbackBatchGetCompletionFeedback.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.BatchGetCompletionFeedbackRequest✔️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.BatchGetFeedbackResponse>

Errors

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

createResponseFeedback

Submit user feedback for a specific agent response to track satisfaction and model performance. Each response can only receive feedback once.

Example Usage

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

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.feedback.createResponseFeedback({
    createFeedbackRequest: {
      id: "resp-xyz789",
      rating: "thumbs_down",
      description: "The response missed key details.",
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await llmFeedbackCreateResponseFeedback(sdk, {
    createFeedbackRequest: {
      id: "resp-xyz789",
      rating: "thumbs_down",
      description: "The response missed key details.",
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmFeedbackCreateResponseFeedback 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.
  useLlmFeedbackCreateResponseFeedbackMutation
} from "@meetkai/mka1/react-query/llmFeedbackCreateResponseFeedback.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.CreateResponseFeedbackRequest✔️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.CreateFeedbackResponse>

Errors

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

listResponseFeedback

Retrieves a paginated list of feedback entries recorded on the caller's agent responses, ordered by the response's creation date. Supports filtering by rating. An after cursor that no longer resolves to a response visible to the caller — including responses that have since been deleted — returns 400; restart pagination from the first page.

Example Usage

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

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.feedback.listResponseFeedback({
    after: "resp-xyz789",
    limit: 25,
    rating: "thumbs_down",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await llmFeedbackListResponseFeedback(sdk, {
    after: "resp-xyz789",
    limit: 25,
    rating: "thumbs_down",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmFeedbackListResponseFeedback 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.
  useLlmFeedbackListResponseFeedback,
  useLlmFeedbackListResponseFeedbackSuspense,

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

Parameters

ParameterTypeRequiredDescription
requestoperations.ListResponseFeedbackRequest✔️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.ListFeedbackResponse>

Errors

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

getResponseFeedback

Retrieves the existing feedback rating and description for a specific agent response.

Example Usage

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

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.feedback.getResponseFeedback({
    id: "resp-xyz789",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await llmFeedbackGetResponseFeedback(sdk, {
    id: "resp-xyz789",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmFeedbackGetResponseFeedback 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.
  useLlmFeedbackGetResponseFeedback,
  useLlmFeedbackGetResponseFeedbackSuspense,

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

Parameters

ParameterTypeRequiredDescription
requestoperations.GetResponseFeedbackRequest✔️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.GetFeedbackResponse>

Errors

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

updateResponseFeedback

Updates or modifies existing feedback for a specific agent response. Useful for allowing users to revise their initial submissions.

Example Usage

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

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.feedback.updateResponseFeedback({
    id: "resp-xyz789",
    requestBody: {
      rating: "thumbs_up",
      description: "Updated after retry, now good.",
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await llmFeedbackUpdateResponseFeedback(sdk, {
    id: "resp-xyz789",
    requestBody: {
      rating: "thumbs_up",
      description: "Updated after retry, now good.",
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmFeedbackUpdateResponseFeedback 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.
  useLlmFeedbackUpdateResponseFeedbackMutation
} from "@meetkai/mka1/react-query/llmFeedbackUpdateResponseFeedback.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.UpdateResponseFeedbackRequest✔️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.UpdateFeedbackResponse>

Errors

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

batchGetResponseFeedback

Retrieves feedback for multiple agent responses in a single batch request.

Example Usage

typescript
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();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await llmFeedbackBatchGetResponseFeedback(sdk, {
    batchGetFeedbackRequest: {
      ids: [
        "resp-xyz789",
        "resp-missing123",
      ],
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmFeedbackBatchGetResponseFeedback 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.
  useLlmFeedbackBatchGetResponseFeedbackMutation
} from "@meetkai/mka1/react-query/llmFeedbackBatchGetResponseFeedback.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.BatchGetResponseFeedbackRequest✔️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.BatchGetFeedbackResponse>

Errors

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

exportCompletionFeedback

Synchronously exports the completion feedback entries visible to the caller as a CSV file, ordered by the creation date of the underlying request. Visibility matches the list endpoint: callers see their own feedback; org owners and admins see their whole team. Supports filtering by rating. The export is capped at 50,000 rows; when the cap is hit the response carries an X-Export-Truncated header and older rows (with the default descending order) are omitted.

Example Usage

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

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.feedback.exportCompletionFeedback({
    rating: "thumbs_up",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await llmFeedbackExportCompletionFeedback(sdk, {
    rating: "thumbs_up",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmFeedbackExportCompletionFeedback 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.
  useLlmFeedbackExportCompletionFeedback,
  useLlmFeedbackExportCompletionFeedbackSuspense,

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

Parameters

ParameterTypeRequiredDescription
requestoperations.ExportCompletionFeedbackRequest✔️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.ExportCompletionFeedbackResponse>

Errors

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

exportResponseFeedback

Synchronously exports the response feedback entries visible to the caller as a CSV file, ordered by the creation date of the underlying request. Visibility matches the list endpoint: callers see their own feedback; org owners and admins see their whole team. Supports filtering by rating. The export is capped at 50,000 rows; when the cap is hit the response carries an X-Export-Truncated header and older rows (with the default descending order) are omitted.

Example Usage

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

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.feedback.exportResponseFeedback({
    rating: "thumbs_up",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await llmFeedbackExportResponseFeedback(sdk, {
    rating: "thumbs_up",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmFeedbackExportResponseFeedback 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.
  useLlmFeedbackExportResponseFeedback,
  useLlmFeedbackExportResponseFeedbackSuspense,

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

Parameters

ParameterTypeRequiredDescription
requestoperations.ExportResponseFeedbackRequest✔️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.ExportResponseFeedbackResponse>

Errors

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

startExport

Starts a background job to export all feedback data across every tenant to parquet files in S3/R2. Only one export can run simultaneously. Restricted to cluster administrators.

Example Usage

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

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.feedback.startExport();

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await llmFeedbackStartExport(sdk);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmFeedbackStartExport 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.
  useLlmFeedbackStartExportMutation
} from "@meetkai/mka1/react-query/llmFeedbackStartExport.js";

Parameters

ParameterTypeRequiredDescription
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.StartExportFeedbackResponse>

Errors

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

getExportStatus

Checks the status and progress of the currently running or most recently completed feedback export job. Restricted to cluster administrators.

Example Usage

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

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.feedback.getExportStatus();

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await llmFeedbackGetExportStatus(sdk);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmFeedbackGetExportStatus 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.
  useLlmFeedbackGetExportStatus,
  useLlmFeedbackGetExportStatusSuspense,

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

Parameters

ParameterTypeRequiredDescription
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.GetExportStatusResponse>

Errors

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