@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;" />
1,547 lines • 62.2 kB
text/typescript
import { $n as LangGraphInterruptActionSetter, Cr as FrontendActionAvailability, Jn as CopilotContext, Kn as CoagentInChatRenderFunction, Qn as LangGraphInterruptAction, Sr as FrontendAction, X as useAgent, Xn as useCopilotContext, Yn as CopilotContextParams, Zn as CoAgentStateRender, _r as ActionRenderPropsNoArgs, ar as CrewsAgentState, br as CatchAllActionRenderProps, cr as CrewsStateItem, dr as CopilotChatSuggestionConfiguration, er as LangGraphInterruptActionSetterArgs, fr as SystemMessageFunction, gr as ActionRenderProps, hr as TreeNode, ir as QueuedInterruptEvent, lr as CrewsTaskStateItem, mr as Tree, n as defaultCopilotContextCategories, nr as LangGraphInterruptRenderHandlerProps, or as CrewsResponse, pr as DocumentPointer, qn as CopilotApiConfig, r as CopilotKitProps, rr as LangGraphInterruptRenderProps, sr as CrewsResponseStatus, t as CopilotKit, tr as LangGraphInterruptRender, ur as CrewsToolStateItem, vr as ActionRenderPropsNoArgsWait, wr as RenderFunctionStatus, xr as CatchAllFrontendAction, yr as ActionRenderPropsWait, yt as useRenderToolCall$1 } from "./copilotkit-Hl1t9Y1v.cjs";
import "./v2/index.cjs";
import * as react_jsx_runtime0 from "react/jsx-runtime";
import { CopilotRuntimeClient, CopilotRuntimeClientOptions, ForwardedParametersInput, Message } from "@copilotkit/runtime-client-gql";
import React, { ReactNode, RefObject, SetStateAction } from "react";
import { AIMessage, CopilotErrorHandler, Message as Message$1, Parameter } from "@copilotkit/shared";
import { StaticSuggestionsConfig, Suggestion } from "@copilotkit/core";
//#region src/v1-deprecated/context/copilot-messages-context.d.ts
interface CopilotMessagesContextParams {
messages: Message[];
setMessages: React.Dispatch<React.SetStateAction<Message[]>>;
suggestions: Suggestion[];
setSuggestions: React.Dispatch<React.SetStateAction<Suggestion[]>>;
}
declare const CopilotMessagesContext: React.Context<CopilotMessagesContextParams>;
declare function useCopilotMessagesContext(): CopilotMessagesContextParams;
//#endregion
//#region src/v1-deprecated/context/coagent-state-renders-context.d.ts
interface StateRenderClaim {
stateRenderId: string;
stateSnapshot?: any;
runId?: string;
messageIndex?: number;
locked?: boolean;
}
type ClaimsRef = Record<string, StateRenderClaim>;
interface CoAgentStateRendersContextValue {
coAgentStateRenders: Record<string, CoAgentStateRender<any>>;
setCoAgentStateRender: (id: string, stateRender: CoAgentStateRender<any>) => void;
removeCoAgentStateRender: (id: string) => void;
claimsRef: RefObject<ClaimsRef>;
}
declare const CoAgentStateRendersContext: React.Context<CoAgentStateRendersContextValue | undefined>;
declare function CoAgentStateRendersProvider({
children
}: {
children: ReactNode;
}): react_jsx_runtime0.JSX.Element;
declare function useCoAgentStateRenders(): CoAgentStateRendersContextValue;
//#endregion
//#region src/v1-deprecated/context/threads-context.d.ts
interface ThreadsContextValue {
threadId: string;
setThreadId: (value: SetStateAction<string>) => void;
isThreadIdExplicit: boolean;
}
declare const ThreadsContext: React.Context<ThreadsContextValue | undefined>;
interface ThreadsProviderProps {
children: ReactNode;
threadId?: string;
}
declare function ThreadsProvider({
children,
threadId: explicitThreadId
}: ThreadsProviderProps): react_jsx_runtime0.JSX.Element;
declare function useThreads(): ThreadsContextValue;
//#endregion
//#region src/v1-deprecated/hooks/use-copilot-chat_internal.d.ts
/**
* The type of suggestions to use in the chat.
*
* `auto` - Suggestions are generated automatically.
* `manual` - Suggestions are controlled programmatically.
* `SuggestionItem[]` - Static suggestions array.
*/
type ChatSuggestions = "auto" | "manual" | Omit<Suggestion, "isLoading">[];
interface AppendMessageOptions {
/**
* Whether to run the chat completion after appending the message. Defaults to `true`.
*/
followUp?: boolean;
/**
* Whether to clear the suggestions after appending the message. Defaults to `true`.
*/
clearSuggestions?: boolean;
}
interface OnStopGenerationArguments {
/**
* The name of the currently executing agent.
*/
currentAgentName: string | undefined;
/**
* The messages in the chat.
*/
messages: Message$1[];
}
type OnReloadMessagesArguments = OnStopGenerationArguments & {
/**
* The message on which "regenerate" was pressed
*/
messageId: string;
};
type OnStopGeneration = (args: OnStopGenerationArguments) => void;
type OnReloadMessages = (args: OnReloadMessagesArguments) => void;
interface UseCopilotChatOptions {
/**
* A unique identifier for the chat. If not provided, a random one will be
* generated. When provided, the `useChat` hook with the same `id` will
* have shared states across components.
*/
id?: string;
/**
* HTTP headers to be sent with the API request.
*/
headers?: Record<string, string> | Headers;
/**
* Initial messages to populate the chat with.
*/
initialMessages?: Message$1[];
/**
* A function to generate the system message. Defaults to `defaultSystemMessage`.
*/
makeSystemMessage?: SystemMessageFunction;
/**
* Disables inclusion of CopilotKit’s default system message. When true, no system message is sent (this also suppresses any custom message from <code>makeSystemMessage</code>).
*/
disableSystemMessage?: boolean;
/**
* Controls the behavior of suggestions in the chat interface.
*
* `auto` (default) - Suggestions are generated automatically:
* - When the chat is first opened (empty state)
* - After each message exchange completes
* - Uses configuration from `useCopilotChatSuggestions` hooks
*
* `manual` - Suggestions are controlled programmatically:
* - Use `setSuggestions()` to set custom suggestions
* - Use `generateSuggestions()` to trigger AI generation
* - Access via `useCopilotChat` hook
*
* `SuggestionItem[]` - Static suggestions array:
* - Always shows the same suggestions
* - No AI generation involved
*/
suggestions?: ChatSuggestions;
onInProgress?: (isLoading: boolean) => void;
onSubmitMessage?: (messageContent: string) => Promise<void> | void;
onStopGeneration?: OnStopGeneration;
onReloadMessages?: OnReloadMessages;
}
interface MCPServerConfig {
endpoint: string;
apiKey?: string;
}
interface UseCopilotChatReturn$1 {
/**
* @deprecated use `messages` instead, this is an old non ag-ui version of the messages
* Array of messages currently visible in the chat interface
*
* This is the visible messages, not the raw messages from the runtime client.
*/
visibleMessages: Message[];
/**
* The messages that are currently in the chat in AG-UI format.
*/
messages: Message$1[];
/** @deprecated use `sendMessage` in `useCopilotChatHeadless_c` instead. This will be removed in a future major version. */
appendMessage: (message: Message, options?: AppendMessageOptions) => Promise<void>;
/**
* Send a new message to the chat
*
* ```tsx
* await sendMessage({
* id: "123",
* role: "user",
* content: "Hello, process this request",
* });
* ```
*/
sendMessage: (message: Message$1, options?: AppendMessageOptions) => Promise<void>;
/**
* Replace all messages in the chat
*
* ```tsx
* setMessages([
* { id: "123", role: "user", content: "Hello, process this request" },
* { id: "456", role: "assistant", content: "Hello, I'm the assistant" },
* ]);
* ```
*
* **Deprecated** non-ag-ui version:
*
* ```tsx
* setMessages([
* new TextMessage({
* content: "Hello, process this request",
* role: gqlRole.User,
* }),
* new TextMessage({
* content: "Hello, I'm the assistant",
* role: gqlRole.Assistant,
* ]);
* ```
*
*/
setMessages: (messages: Message$1[] | Message[]) => void;
/**
* Remove a specific message by ID
*
* ```tsx
* deleteMessage("123");
* ```
*/
deleteMessage: (messageId: string) => void;
/**
* Regenerate the response for a specific message
*
* ```tsx
* reloadMessages("123");
* ```
*/
reloadMessages: (messageId: string) => Promise<void>;
/**
* Stop the current message generation
*
* ```tsx
* if (isLoading) {
* stopGeneration();
* }
* ```
*/
stopGeneration: () => void;
/**
* Clear all messages and reset chat state
*
* ```tsx
* reset();
* console.log(messages); // []
* ```
*/
reset: () => void;
/**
* Whether the chat is currently generating a response
*
* ```tsx
* if (isLoading) {
* console.log("Loading...");
* } else {
* console.log("Not loading");
* }
*/
isLoading: boolean;
/**
* Whether the chat agent is available to generate responses
*
* ```tsx
* if (isAvailable) {
* console.log("Loading...");
* } else {
* console.log("Not loading");
* }
*/
isAvailable: boolean;
/** Manually trigger chat completion (advanced usage) */
runChatCompletion: () => Promise<Message$1[]>;
/** MCP (Model Context Protocol) server configurations */
mcpServers: MCPServerConfig[];
/** Update MCP server configurations */
setMcpServers: (mcpServers: MCPServerConfig[]) => void;
/**
* Current suggestions array
* Use this to read the current suggestions or in conjunction with setSuggestions for manual control
*/
suggestions: Suggestion[];
/**
* Manually set suggestions
* Useful for manual mode or custom suggestion workflows
*/
setSuggestions: (suggestions: Omit<Suggestion, "isLoading">[]) => void;
/**
* Trigger AI-powered suggestion generation
* Uses configurations from useCopilotChatSuggestions hooks
* Respects global debouncing - only one generation can run at a time
*
* ```tsx
* generateSuggestions();
* console.log(suggestions); // [suggestion1, suggestion2, suggestion3]
* ```
*/
generateSuggestions: () => Promise<void>;
/**
* Clear all current suggestions
* Also resets suggestion generation state
*/
resetSuggestions: () => void;
/** Whether suggestions are currently being generated */
isLoadingSuggestions: boolean;
/** Interrupt content for human-in-the-loop workflows */
interrupt: string | React.ReactElement | null;
agent?: ReturnType<typeof useAgent>["agent"];
threadId?: string;
}
declare function useCopilotChatInternal({
suggestions,
onInProgress,
onSubmitMessage,
onStopGeneration,
onReloadMessages
}?: UseCopilotChatOptions): UseCopilotChatReturn$1;
//#endregion
//#region src/v1-deprecated/hooks/use-copilot-chat.d.ts
type UseCopilotChatReturn = Omit<UseCopilotChatReturn$1, "messages" | "sendMessage" | "suggestions" | "setSuggestions" | "generateSuggestions" | "isLoadingSuggestions" | "resetSuggestions" | "interrupt" | "setMessages" | "deleteMessage">;
/**
* A lightweight React hook for headless chat interactions.
* Perfect for programmatic messaging, background operations, and custom UI implementations.
*
* **Open Source Friendly** - Works without requiring a `publicApiKey`.
*/
declare function useCopilotChat(options?: UseCopilotChatOptions): UseCopilotChatReturn;
//#endregion
//#region src/v1-deprecated/hooks/use-copilot-chat-headless_c.d.ts
/**
* CopilotKit Intelligence React hook that provides complete chat functionality for fully custom UI implementations.
* Includes all advanced features like direct message access, suggestions array, interrupt handling, and MCP support.
*
* @param options - Configuration options for the chat
* @returns Complete chat interface with all CopilotKit Intelligence features
*
* @example
* ```tsx
* const { messages, sendMessage, suggestions, interrupt } = useCopilotChatHeadless_c();
* ```
*/
declare function useCopilotChatHeadless_c(options?: UseCopilotChatOptions): UseCopilotChatReturn$1;
//#endregion
//#region src/v1-deprecated/hooks/use-copilot-action.d.ts
/**
* useCopilotAction is a legacy hook maintained for backwards compatibility.
*
* To avoid violating React's Rules of Hooks (which prohibit conditional hook calls),
* we use a registration pattern:
* 1. This hook registers the action configuration with the CopilotContext
* 2. A renderer component in CopilotKit actually renders the appropriate hook wrapper
* 3. React properly manages hook state since components are rendered, not conditionally called
*
* This allows action types to change between renders without corrupting React's hook state.
*/
declare function useCopilotAction<const T extends Parameter[] | [] = []>(action: FrontendAction<T> | CatchAllFrontendAction, dependencies?: any[]): void;
//#endregion
//#region src/v1-deprecated/hooks/use-coagent-state-render.d.ts
/**
* This hook is used to render agent state with custom UI components or text. This is particularly
* useful for showing intermediate state or progress during Agentic Copilot operations.
* To get started using rendering intermediate state through this hook, checkout the documentation.
*
* https://docs.copilotkit.ai/langgraph-python/shared-state/predictive-state-updates
*/
declare function useCoAgentStateRender<T = any>(action: CoAgentStateRender<T>, dependencies?: any[]): void;
//#endregion
//#region src/v1-deprecated/hooks/use-make-copilot-document-readable.d.ts
/**
* Makes a document readable by Copilot.
* @param document The document to make readable.
* @param categories The categories to associate with the document.
* @param dependencies The dependencies to use for the effect.
* @returns The id of the document.
*/
declare function useMakeCopilotDocumentReadable(document: DocumentPointer, categories?: string[], dependencies?: any[]): string | undefined;
//#endregion
//#region src/v1-deprecated/hooks/use-copilot-readable.d.ts
/**
* 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.
*
* @deprecated This option is currently ignored. The context store backing this
* hook is flat and has no parent/child relationships, so no hierarchy is applied.
* Accepted for source compatibility only.
*/
parentId?: string;
/**
* An array of categories to control which context are visible where. Particularly useful
* with CopilotTextarea (see `useMakeAutosuggestionFunction`)
*
* @deprecated This option is currently ignored. The context store backing this
* hook does not filter by category. Accepted for source compatibility only.
*/
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.
* @deprecated The v1 SDK is deprecated. Use v2 instead. Use `useAgentContext` from `@copilotkit/react-core/v2` instead.
*
* ```tsx
* import { useAgentContext } from "@copilotkit/react-core/v2";
*
* function UserContext() {
* useAgentContext({
* description: "The current user",
* value: { name: "Ada" },
* });
* return null;
* }
* ```
* See https://docs.copilotkit.ai/reference/v2/hooks/useAgentContext
*/
declare function useCopilotReadable({
description,
value,
convert,
available
}: UseCopilotReadableOptions, dependencies?: any[]): string | undefined;
//#endregion
//#region src/v1-deprecated/hooks/use-coagent.d.ts
interface UseCoagentOptionsBase {
/**
* The name of the agent being used.
*/
name: string;
/**
* @deprecated - use "config.configurable"
* Config to pass to a LangGraph Agent
*/
configurable?: Record<string, any>;
/**
* Config to pass to a LangGraph Agent
*/
config?: {
configurable?: Record<string, any>;
[key: string]: any;
};
}
interface WithInternalStateManagementAndInitial<T> extends UseCoagentOptionsBase {
/**
* The initial state of the agent.
*/
initialState: T;
}
interface WithInternalStateManagement extends UseCoagentOptionsBase {
/**
* Optional initialState with default type any
*/
initialState?: any;
}
interface WithExternalStateManagement<T> extends UseCoagentOptionsBase {
/**
* The current state of the agent.
*/
state: T;
/**
* A function to update the state of the agent.
*/
setState: (newState: T | ((prevState: T | undefined) => T)) => void;
}
type UseCoagentOptions<T> = WithInternalStateManagementAndInitial<T> | WithInternalStateManagement | WithExternalStateManagement<T>;
interface UseCoagentReturnType<T> {
/**
* The name of the agent being used.
*/
name: string;
/**
* The name of the current LangGraph node.
*/
nodeName?: string;
/**
* The ID of the thread the agent is running in.
*/
threadId?: string;
/**
* A boolean indicating if the agent is currently running.
*/
running: boolean;
/**
* The current state of the agent.
*/
state: T;
/**
* A function to update the state of the agent.
*/
setState: (newState: T | ((prevState: T | undefined) => T)) => void;
/**
* A function to start the agent.
*/
start: () => void;
/**
* A function to stop the agent.
*/
stop: () => void;
/**
* A function to (re-)run the agent. In v2 this maps to the underlying
* agent's `runAgent()`.
*/
run: (...args: any[]) => Promise<any>;
}
interface HintFunctionParams {
/**
* The previous state of the agent.
*/
previousState: any;
/**
* The current state of the agent.
*/
currentState: any;
}
type HintFunction = (params: HintFunctionParams) => Message$1 | undefined;
/**
* This hook is used to integrate an agent into your application. With its use, you can
* render and update the state of the agent, allowing for a dynamic and interactive experience.
* We call these shared state experiences "agentic copilots". To get started using agentic copilots, which
* we refer to as CoAgents, checkout the documentation at https://docs.copilotkit.ai/langgraph-python/quickstart.
*/
declare function useCoAgent<T = any>(options: UseCoagentOptions<T>): UseCoagentReturnType<T>;
//#endregion
//#region src/v1-deprecated/hooks/use-copilot-runtime-client.d.ts
interface CopilotRuntimeClientHookOptions extends CopilotRuntimeClientOptions {
showDevConsole?: boolean;
onError: CopilotErrorHandler;
}
declare const useCopilotRuntimeClient: (options: CopilotRuntimeClientHookOptions) => CopilotRuntimeClient;
//#endregion
//#region src/v1-deprecated/hooks/use-copilot-authenticated-action.d.ts
/**
* Hook to create an authenticated action that requires user sign-in before execution.
*
* @internal Defunct — retained for backward compatibility.
*
* @param action - The frontend action to be wrapped with authentication
* @param dependencies - Optional array of dependencies that will trigger recreation of the action when changed
*/
declare function useCopilotAuthenticatedAction_c<T extends Parameter[]>(action: FrontendAction<T>, dependencies?: any[]): void;
//#endregion
//#region src/v1-deprecated/hooks/use-langgraph-interrupt.d.ts
/**
* @deprecated The v1 SDK is deprecated. Use v2 instead. Use `useInterrupt` from `@copilotkit/react-core/v2` instead.
*
* ```tsx
* import { useInterrupt } from "@copilotkit/react-core/v2";
*
* function ApprovalInterrupt() {
* useInterrupt({
* render: ({ resolve }) => (
* <button onClick={() => resolve({ approved: true })}>Approve</button>
* ),
* });
* return null;
* }
* ```
* See https://docs.copilotkit.ai/reference/v2/hooks/useInterrupt
*/
declare function useLangGraphInterrupt<TEventValue = any>(action: Omit<LangGraphInterruptRender<TEventValue>, "id">, _dependencies?: any[]): void;
//#endregion
//#region src/v1-deprecated/hooks/use-copilot-additional-instructions.d.ts
/**
* Options for the useCopilotAdditionalInstructions hook.
*/
interface UseCopilotAdditionalInstructionsOptions {
/**
* The instructions to be added to the Copilot. Will be added to the instructions like so:
*
* ```txt
* You are a helpful assistant.
* Additionally, follow these instructions:
* - Do not answer questions about the weather.
* - Do not answer questions about the stock market.
* ```
*/
instructions: string;
/**
* Whether the instructions are available to the Copilot.
*/
available?: "enabled" | "disabled";
}
/**
* Adds the given instructions to the Copilot context.
*/
declare function useCopilotAdditionalInstructions({
instructions,
available
}: UseCopilotAdditionalInstructionsOptions, dependencies?: any[]): void;
//#endregion
//#region src/v1-deprecated/hooks/use-frontend-tool.d.ts
type UseFrontendToolArgs<T extends Parameter[] | [] = []> = {
available?: "disabled" | "enabled";
} & Pick<FrontendAction<T>, "name" | "description" | "parameters" | "handler" | "followUp" | "render">;
/**
* @deprecated The v1 SDK is deprecated. Use v2 instead. Use `useFrontendTool` from `@copilotkit/react-core/v2` instead.
*
* ```tsx
* import { useFrontendTool } from "@copilotkit/react-core/v2";
* import { z } from "zod";
*
* function MyComponent() {
* useFrontendTool({
* name: "myTool",
* description: "Run my tool",
* parameters: z.object({}),
* handler: async () => "done",
* });
* return null;
* }
* ```
* See https://docs.copilotkit.ai/reference/v2/hooks/useFrontendTool
*/
declare function useFrontendTool<const T extends Parameter[] = []>(tool: UseFrontendToolArgs<T>, dependencies?: any[]): void;
//#endregion
//#region src/v1-deprecated/hooks/use-human-in-the-loop.d.ts
type UseHumanInTheLoopArgs<T extends Parameter[] | [] = []> = {
available?: "disabled" | "enabled";
render: FrontendAction<T>["renderAndWaitForResponse"];
followUp?: FrontendAction<T>["followUp"];
} & Pick<FrontendAction<T>, "name" | "description" | "parameters">;
/**
* @deprecated The v1 SDK is deprecated. Use v2 instead. Use `useHumanInTheLoop` from `@copilotkit/react-core/v2` instead.
*
* ```tsx
* import { useHumanInTheLoop } from "@copilotkit/react-core/v2";
* import { z } from "zod";
*
* function Confirmation() {
* useHumanInTheLoop({
* name: "confirmAction",
* description: "Ask the user to confirm",
* parameters: z.object({}),
* render: ({ respond }) => (
* <button onClick={() => respond?.(true)}>Confirm</button>
* ),
* });
* return null;
* }
* ```
* See https://docs.copilotkit.ai/reference/v2/hooks/useHumanInTheLoop
*/
declare function useHumanInTheLoop<const T extends Parameter[] | [] = []>(tool: UseHumanInTheLoopArgs<T>, dependencies?: any[]): void;
//#endregion
//#region src/v1-deprecated/hooks/use-render-tool-call.d.ts
type UseRenderToolCallArgs<T extends Parameter[] | [] = []> = Pick<FrontendAction<T>, "name" | "description" | "parameters"> & {
available?: "disabled" | "enabled";
render: T extends [] ? (props: ActionRenderPropsNoArgs<T>) => React.ReactElement : (props: ActionRenderProps<T>) => React.ReactElement;
};
/**
* @deprecated The v1 SDK is deprecated. Use v2 instead. Use `useRenderTool` from `@copilotkit/react-core/v2` instead.
*
* ```tsx
* import { useRenderTool } from "@copilotkit/react-core/v2";
* import { z } from "zod";
*
* function StatusTool() {
* useRenderTool({
* name: "showStatus",
* parameters: z.object({}),
* render: ({ status, result }) => (
* <div>{status === "complete" ? result : "Running..."}</div>
* ),
* });
* return null;
* }
* ```
* See https://docs.copilotkit.ai/reference/v2/hooks/useRenderTool
*/
declare function useRenderToolCall<const T extends Parameter[] | [] = []>(tool: UseRenderToolCallArgs<T>, dependencies?: any[]): void;
//#endregion
//#region src/v1-deprecated/hooks/use-default-tool.d.ts
declare function useDefaultTool(tool: Omit<CatchAllFrontendAction, "name">, dependencies?: any[]): void;
//#endregion
//#region src/v1-deprecated/hooks/use-lazy-tool-renderer.d.ts
declare function useLazyToolRenderer(): (message?: AIMessage, messages?: Message$1[]) => null | (() => ReturnType<ReturnType<typeof useRenderToolCall$1>> | null);
//#endregion
//#region src/v1-deprecated/hooks/use-copilot-chat-suggestions.d.ts
type StaticSuggestionInput = Omit<Suggestion, "isLoading"> & Partial<Pick<Suggestion, "isLoading">>;
type StaticSuggestionsConfigInput = Omit<StaticSuggestionsConfig, "suggestions"> & {
suggestions: StaticSuggestionInput[];
};
type DynamicSuggestionsConfigInput = {
/**
* A prompt or instructions for the GPT to generate suggestions.
*/
instructions: string;
/**
* The minimum number of suggestions to generate. Defaults to `1`.
* @default 1
*/
minSuggestions?: number;
/**
* The maximum number of suggestions to generate. Defaults to `3`.
* @default 1
*/
maxSuggestions?: number;
/**
* Whether the suggestions are available. Defaults to `enabled`.
* @default enabled
*/
available?: "enabled" | "disabled" | "always" | "before-first-message" | "after-first-message";
/**
* An optional class name to apply to the suggestions.
*/
className?: string;
};
type UseCopilotChatSuggestionsConfiguration = DynamicSuggestionsConfigInput | StaticSuggestionsConfigInput;
declare function useCopilotChatSuggestions(config: UseCopilotChatSuggestionsConfiguration, dependencies?: any[]): void;
//#endregion
//#region src/v1-deprecated/lib/copilot-task.d.ts
interface CopilotTaskConfig {
/**
* The instructions to be given to the assistant.
*/
instructions: string;
/**
* An array of action definitions that can be called.
*/
actions?: FrontendAction<any>[];
/**
* Whether to include the copilot readable context in the task.
*/
includeCopilotReadable?: boolean;
/**
* Whether to include actions defined via useCopilotAction in the task.
*/
includeCopilotActions?: boolean;
/**
* The forwarded parameters to use for the task.
*/
forwardedParameters?: ForwardedParametersInput;
}
declare class CopilotTask<T = any> {
private instructions;
private actions;
private includeCopilotReadable;
private includeCopilotActions;
private forwardedParameters?;
constructor(config: CopilotTaskConfig);
/**
* Run the task.
* @param context The CopilotContext to use for the task. Use `useCopilotContext` to obtain the current context.
* @param data The data to use for the task.
*/
run(context: CopilotContextParams, data?: T): Promise<void>;
}
//#endregion
//#region src/v1-deprecated/utils/suggestions-constants.d.ts
/**
* Constants for suggestions retry logic
*/
declare const SUGGESTION_RETRY_CONFIG: {
readonly MAX_RETRIES: 3;
readonly COOLDOWN_MS: 5000;
};
//#endregion
//#region src/v1-deprecated/utils/dev-console.d.ts
declare function shouldShowDevConsole(showDevConsole?: boolean): boolean;
//#endregion
export { /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Tool rendering): https://docs.copilotkit.ai/generative-ui/tool-rendering
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type ActionRenderProps, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Tool rendering): https://docs.copilotkit.ai/generative-ui/tool-rendering
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type ActionRenderPropsNoArgs, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Tool rendering): https://docs.copilotkit.ai/generative-ui/tool-rendering
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type ActionRenderPropsNoArgsWait, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Tool rendering): https://docs.copilotkit.ai/generative-ui/tool-rendering
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type ActionRenderPropsWait, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Tool rendering): https://docs.copilotkit.ai/generative-ui/tool-rendering
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type CatchAllActionRenderProps, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Tool-based generative UI): https://docs.copilotkit.ai/generative-ui/tool-based
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type CatchAllFrontendAction, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Chat suggestions): https://docs.copilotkit.ai/reference/v2/hooks/useConfigureSuggestions
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type ChatSuggestions, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (State rendering): https://docs.copilotkit.ai/generative-ui/state-rendering
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
CoAgentStateRendersContext, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (State rendering): https://docs.copilotkit.ai/generative-ui/state-rendering
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type CoAgentStateRendersContextValue, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (State rendering): https://docs.copilotkit.ai/generative-ui/state-rendering
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
CoAgentStateRendersProvider, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (State rendering): https://docs.copilotkit.ai/generative-ui/state-rendering
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type CoagentInChatRenderFunction, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Runtime server adapter): https://docs.copilotkit.ai/runtime-server-adapter
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type CopilotApiConfig, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Chat suggestions): https://docs.copilotkit.ai/reference/v2/hooks/useConfigureSuggestions
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type CopilotChatSuggestionConfiguration, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (CopilotKit provider): https://docs.copilotkit.ai/reference/v2/components/CopilotKit
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
CopilotContext, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (CopilotKit provider): https://docs.copilotkit.ai/reference/v2/components/CopilotKit
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type CopilotContextParams, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* Use `CopilotKit` from `@copilotkit/react-core/v2` instead.
* Import and usage example:
* ```ts
* import { CopilotKit } from "@copilotkit/react-core/v2";
* <CopilotKit />;
* ```
* See https://docs.copilotkit.ai/reference/v2/components/CopilotKit
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
CopilotKit, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* Use `CopilotKitProps` from `@copilotkit/react-core/v2` instead.
* Import and usage example:
* ```ts
* import type { CopilotKitProps } from "@copilotkit/react-core/v2";
* type V2CopilotKitProps = CopilotKitProps;
* ```
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type CopilotKitProps, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
CopilotMessagesContext, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type CopilotMessagesContextParams, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Tool-based generative UI): https://docs.copilotkit.ai/generative-ui/tool-based
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
CopilotTask, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Tool-based generative UI): https://docs.copilotkit.ai/generative-ui/tool-based
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type CopilotTaskConfig, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type CrewsAgentState, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type CrewsResponse, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type CrewsResponseStatus, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type CrewsStateItem, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type CrewsTaskStateItem, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type CrewsToolStateItem, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Agent context): https://docs.copilotkit.ai/agent-app-context
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type DocumentPointer, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Tool-based generative UI): https://docs.copilotkit.ai/generative-ui/tool-based
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type FrontendAction, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Tool-based generative UI): https://docs.copilotkit.ai/generative-ui/tool-based
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type FrontendActionAvailability, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type HintFunction, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Human-in-the-loop): https://docs.copilotkit.ai/human-in-the-loop
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type LangGraphInterruptAction, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Human-in-the-loop): https://docs.copilotkit.ai/human-in-the-loop
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type LangGraphInterruptActionSetter, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Human-in-the-loop): https://docs.copilotkit.ai/human-in-the-loop
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type LangGraphInterruptActionSetterArgs, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Human-in-the-loop): https://docs.copilotkit.ai/human-in-the-loop
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type LangGraphInterruptRender, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Human-in-the-loop): https://docs.copilotkit.ai/human-in-the-loop
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type LangGraphInterruptRenderHandlerProps, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Human-in-the-loop): https://docs.copilotkit.ai/human-in-the-loop
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type LangGraphInterruptRenderProps, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type OnReloadMessages, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type OnStopGeneration, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Human-in-the-loop): https://docs.copilotkit.ai/human-in-the-loop
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type QueuedInterruptEvent, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Tool rendering): https://docs.copilotkit.ai/generative-ui/tool-rendering
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type RenderFunctionStatus, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Chat suggestions): https://docs.copilotkit.ai/reference/v2/hooks/useConfigureSuggestions
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
SUGGESTION_RETRY_CONFIG, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type SystemMessageFunction, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Conversation threads): https://docs.copilotkit.ai/prebuilt-components/copilot-threads-drawer
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
ThreadsContext, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Conversation threads): https://docs.copilotkit.ai/prebuilt-components/copilot-threads-drawer
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type ThreadsContextValue, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Conversation threads): https://docs.copilotkit.ai/prebuilt-components/copilot-threads-drawer
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
ThreadsProvider, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Conversation threads): https://docs.copilotkit.ai/prebuilt-components/copilot-threads-drawer
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type ThreadsProviderProps, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Agent context): https://docs.copilotkit.ai/agent-app-context
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type Tree, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Agent context): https://docs.copilotkit.ai/agent-app-context
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type TreeNode, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type UseCopilotChatOptions, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type UseCopilotChatOptions as UseCopilotChatOptions_c, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type UseCopilotChatReturn, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type UseCopilotChatReturn$1 as UseCopilotChatReturn_c, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Chat suggestions): https://docs.copilotkit.ai/reference/v2/hooks/useConfigureSuggestions
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
type UseCopilotChatSuggestionsConfiguration, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Agent context): https://docs.copilotkit.ai/agent-app-context
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
defaultCopilotContextCategories, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
shouldShowDevConsole, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* Use `useAgent` from `@copilotkit/react-core/v2` instead.
* Import and usage example:
* ```ts
* import { useAgent } from "@copilotkit/react-core/v2";
* useAgent({});
* ```
* See https://docs.copilotkit.ai/reference/v2/hooks/useAgent
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useCoAgent, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* Use `useAgent` from `@copilotkit/react-core/v2` instead.
* Import and usage example:
* ```ts
* import { useAgent, UseAgentUpdate } from "@copilotkit/react-core/v2";
* function AgentStateView() {
* const { agent } = useAgent({
* agentId: "basic_agent",
* updates: [UseAgentUpdate.OnStateChanged, UseAgentUpdate.OnRunStatusChanged],
* });
* const state = agent.state;
* return (
* <YourComponent
* agentStateProperty={state.agent_state_property}
* isRunning={agent.isRunning}
* />
* );
* }
* ```
* See https://docs.copilotkit.ai/generative-ui/state-rendering
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useCoAgentStateRender, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (State rendering): https://docs.copilotkit.ai/generative-ui/state-rendering
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useCoAgentStateRenders, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* Use `useFrontendTool` from `@copilotkit/react-core/v2` instead.
* Import and usage example:
* ```ts
* import { useFrontendTool } from "@copilotkit/react-core/v2";
* useFrontendTool({});
* ```
* See https://docs.copilotkit.ai/reference/v2/hooks/useFrontendTool
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useCopilotAction, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* Use `useAgentContext` from `@copilotkit/react-core/v2` instead.
* Import and usage example:
* ```ts
* import { useAgentContext } from "@copilotkit/react-core/v2";
* useAgentContext({});
* ```
* See https://docs.copilotkit.ai/reference/v2/hooks/useAgentContext
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useCopilotAdditionalInstructions, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useCopilotAuthenticatedAction_c, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* Use `useAgent` from `@copilotkit/react-core/v2` instead.
* Import and usage example:
* ```ts
* import { useAgent } from "@copilotkit/react-core/v2";
* useAgent({});
* ```
* See https://docs.copilotkit.ai/reference/v2/hooks/useAgent
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useCopilotChat, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useCopilotChatHeadless_c, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useCopilotChatInternal, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* Use `useConfigureSuggestions` from `@copilotkit/react-core/v2` instead.
* Import and usage example:
* ```ts
* import { useConfigureSuggestions } from "@copilotkit/react-core/v2";
* function Suggestions() {
* useConfigureSuggestions({
* suggestions: [
* { title: "Help", message: "Help me get started" },
* ],
* });
* return null;
* }
* ```
* See https://docs.copilotkit.ai/reference/v2/hooks/useConfigureSuggestions
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useCopilotChatSuggestions, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (CopilotKit provider): https://docs.copilotkit.ai/reference/v2/components/CopilotKit
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useCopilotContext, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useCopilotMessagesContext, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* Use `useAgentContext` from `@copilotkit/react-core/v2` instead.
* Import and usage example:
* ```ts
* import { useAgentContext } from "@copilotkit/react-core/v2";
* function UserContext() {
* useAgentContext({
* description: "The current user",
* value: { name: "Ada" },
* });
* return null;
* }
* ```
* See https://docs.copilotkit.ai/reference/v2/hooks/useAgentContext
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useCopilotReadable, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Runtime server adapter): https://docs.copilotkit.ai/runtime-server-adapter
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useCopilotRuntimeClient, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* Use `useDefaultRenderTool` from `@copilotkit/react-core/v2` instead.
* Import and usage example:
* ```ts
* import { useDefaultRenderTool } from "@copilotkit/react-core/v2";
* useDefaultRenderTool({});
* ```
* See https://docs.copilotkit.ai/reference/v2/hooks/useDefaultRenderTool
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useDefaultTool, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* Use `useFrontendTool` from `@copilotkit/react-core/v2` instead.
* Import and usage example:
* ```ts
* import { useFrontendTool } from "@copilotkit/react-core/v2";
* import { z } from "zod";
* function MyComponent() {
* useFrontendTool({
* name: "myTool",
* description: "Run my tool",
* parameters: z.object({}),
* handler: async () => "done",
* });
* return null;
* }
* ```
* See https://docs.copilotkit.ai/reference/v2/hooks/useFrontendTool
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useFrontendTool, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* Use `useHumanInTheLoop` from `@copilotkit/react-core/v2` instead.
* Import and usage example:
* ```ts
* import { useHumanInTheLoop } from "@copilotkit/react-core/v2";
* import { z } from "zod";
* function Confirmation() {
* useHumanInTheLoop({
* name: "confirmAction",
* description: "Ask the user to confirm",
* parameters: z.object({}),
* render: ({ respond }) => (
* <button onClick={() => respond?.(true)}>Confirm</button>
* ),
* });
* return null;
* }
* ```
* See https://docs.copilotkit.ai/reference/v2/hooks/useHumanInTheLoop
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useHumanInTheLoop, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* Use `useInterrupt` from `@copilotkit/react-core/v2` instead.
* Import and usage example:
* ```ts
* import { useInterrupt } from "@copilotkit/react-core/v2";
* function ApprovalInterrupt() {
* useInterrupt({
* render: ({ resolve }) => (
* <button onClick={() => resolve({ approved: true })}>Approve</button>
* ),
* });
* return null;
* }
* ```
* See https://docs.copilotkit.ai/reference/v2/hooks/useInterrupt
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useLangGraphInterrupt, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Tool rendering): https://docs.copilotkit.ai/generative-ui/tool-rendering
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useLazyToolRenderer, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* No 1:1 v2 replacement is available.
* Related v2 docs (Agent context): https://docs.copilotkit.ai/agent-app-context
* Start with `@copilotkit/react-core/v2`.
* V2 docs: https://docs.copilotkit.ai/
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useMakeCopilotDocumentReadable, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* Use `useRenderTool` from `@copilotkit/react-core/v2` instead.
* Import and usage example:
* ```ts
* import { useRenderTool } from "@copilotkit/react-core/v2";
* import { z } from "zod";
* function StatusTool() {
* useRenderTool({
* name: "showStatus",
* parameters: z.object({}),
* render: ({ status, result }) => (
* <div>{status === "complete" ? result : "Running..."}</div>
* ),
* });
* return null;
* }
* ```
* See https://docs.copilotkit.ai/reference/v2/hooks/useRenderTool
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useRenderToolCall, /**
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
* Use `useThreads` from `@copilotkit/react-core/v2` instead.
* Import and usage example:
* ```ts
* import { useThreads } from "@copilotkit/react-core/v2";
* useThreads({});
* ```
* See https://docs.copilotkit.ai/reference/v2/hooks/useThreads
* Migration guide: https://docs.copilotkit.ai/migrate/v2
*/
useThreads };
//# sourceMappingURL=index.d.cts.map