@copilotkit/react-core
Version:
<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />
38 lines (36 loc) • 1.3 kB
TypeScript
/**
* Options for the useCopilotReadable hook.
*/
interface UseCopilotReadableOptions {
/**
* The description of the information to be added to the Copilot context.
*/
description: string;
/**
* The value to be added to the Copilot context. Object values are automatically stringified.
*/
value: any;
/**
* The ID of the parent context, if any.
*/
parentId?: string;
/**
* An array of categories to control which context are visible where. Particularly useful
* with CopilotTextarea (see `useMakeAutosuggestionFunction`)
*/
categories?: string[];
/**
* Whether the context is available to the Copilot.
*/
available?: "enabled" | "disabled";
/**
* A custom conversion function to use to serialize the value to a string. If not provided, the value
* will be serialized using `JSON.stringify`.
*/
convert?: (description: string, value: any) => string;
}
/**
* Adds the given information to the Copilot context to make it readable by Copilot.
*/
declare function useCopilotReadable({ description, value, parentId, categories, convert, available, }: UseCopilotReadableOptions, dependencies?: any[]): string | undefined;
export { UseCopilotReadableOptions, useCopilotReadable };