UNPKG

@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;" />

27 lines (25 loc) 915 B
import { __spreadProps, __spreadValues } from "./chunk-SKC7AJIV.mjs"; // src/hooks/use-copilot-chat-suggestions.tsx import { useConfigureSuggestions, useCopilotChatConfiguration } from "@copilotkitnext/react"; function useCopilotChatSuggestions(config, dependencies = []) { var _a, _b; const existingConfig = useCopilotChatConfiguration(); const resolvedAgentId = (_a = existingConfig == null ? void 0 : existingConfig.agentId) != null ? _a : "default"; const available = (_b = config.available === "enabled" ? "always" : config.available) != null ? _b : "before-first-message"; const finalSuggestionConfig = __spreadProps(__spreadValues({}, config), { available, consumerAgentId: resolvedAgentId // Use chatConfig.agentId here }); useConfigureSuggestions(finalSuggestionConfig, dependencies); } export { useCopilotChatSuggestions }; //# sourceMappingURL=chunk-XDFVCQD3.mjs.map