AgentVersions
Overview
Inspect an agent's configuration history and roll back to a prior version.
Available Operations
- listAgentVersions - List agent versions
- getAgentVersion - Retrieve an agent version
- rollbackAgentVersion - Roll back an agent to a version
listAgentVersions
Lists the configuration history for an agent. Each committed change (create, update, rollback) appends a version.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.agentVersions.listAgentVersions({
agentId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { agentVersionsListAgentVersions } from "@meetkai/mka1/funcs/agentVersionsListAgentVersions.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 agentVersionsListAgentVersions(sdk, {
agentId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("agentVersionsListAgentVersions 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.
import {
// Query hooks for fetching data.
useAgentVersionsListAgentVersions,
useAgentVersionsListAgentVersionsSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchAgentVersionsListAgentVersions,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateAgentVersionsListAgentVersions,
invalidateAllAgentVersionsListAgentVersions,
} from "@meetkai/mka1/react-query/agentVersionsListAgentVersions.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListAgentVersionsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options 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.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.AgentVersionList>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorEnvelope | 401, 404 | application/json |
| errors.APIError | 4XX, 5XX | */* |
getAgentVersion
Retrieve an agent version
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.agentVersions.getAgentVersion({
agentId: "<id>",
version: 652149,
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { agentVersionsGetAgentVersion } from "@meetkai/mka1/funcs/agentVersionsGetAgentVersion.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 agentVersionsGetAgentVersion(sdk, {
agentId: "<id>",
version: 652149,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("agentVersionsGetAgentVersion 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.
import {
// Query hooks for fetching data.
useAgentVersionsGetAgentVersion,
useAgentVersionsGetAgentVersionSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchAgentVersionsGetAgentVersion,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateAgentVersionsGetAgentVersion,
invalidateAllAgentVersionsGetAgentVersion,
} from "@meetkai/mka1/react-query/agentVersionsGetAgentVersion.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetAgentVersionRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options 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.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.AgentVersion>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorEnvelope | 401, 404 | application/json |
| errors.APIError | 4XX, 5XX | */* |
rollbackAgentVersion
Restores the target version's configuration as a new current version. History is preserved: the restore is appended as a new version rather than deleting later ones.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.agentVersions.rollbackAgentVersion({
agentId: "<id>",
version: 880902,
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { agentVersionsRollbackAgentVersion } from "@meetkai/mka1/funcs/agentVersionsRollbackAgentVersion.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 agentVersionsRollbackAgentVersion(sdk, {
agentId: "<id>",
version: 880902,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("agentVersionsRollbackAgentVersion 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.
import {
// Mutation hook for triggering the API call.
useAgentVersionsRollbackAgentVersionMutation
} from "@meetkai/mka1/react-query/agentVersionsRollbackAgentVersion.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.RollbackAgentVersionRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options 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.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.Agent>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorEnvelope | 401, 404 | application/json |
| errors.APIError | 4XX, 5XX | */* |