@copilotkit/react-textarea 0.35.0-mme-cloud.4 → 0.35.0-mme-cloud.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CopilotTextarea
3
- } from "../../chunk-HWM2CVKO.mjs";
4
- import "../../chunk-RT4UTBH3.mjs";
3
+ } from "../../chunk-PQIOU3E5.mjs";
4
+ import "../../chunk-SJ2TM5GA.mjs";
5
5
  import "../../chunk-QCPS6IYI.mjs";
6
6
  import "../../chunk-RUV6NBIF.mjs";
7
7
  import "../../chunk-DKE57EAC.mjs";
@@ -1789,6 +1789,7 @@ function makeSemiFakeReactTextAreaEvent(currentText) {
1789
1789
  var import_react15 = __toESM(require("react"));
1790
1790
 
1791
1791
  // src/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.tsx
1792
+ var import_shared = require("@copilotkit/shared");
1792
1793
  var import_react_core3 = require("@copilotkit/react-core");
1793
1794
  var import_react13 = require("react");
1794
1795
 
@@ -1811,6 +1812,8 @@ function retry(fn, retriesLeft = 2, interval = 200, backoff = 1.5) {
1811
1812
  var import_react_core4 = require("@copilotkit/react-core");
1812
1813
  function useMakeStandardAutosuggestionFunction(textareaPurpose, contextCategories, apiConfig) {
1813
1814
  const { getContextString, copilotApiConfig } = (0, import_react13.useContext)(import_react_core3.CopilotContext);
1815
+ const publicApiKey = copilotApiConfig.publicApiKey;
1816
+ const headers = __spreadValues({}, publicApiKey ? { [import_shared.COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: publicApiKey } : {});
1814
1817
  return (0, import_react13.useCallback)(
1815
1818
  (editorState2, abortSignal) => __async(this, null, function* () {
1816
1819
  const res = yield retry(() => __async(this, null, function* () {
@@ -1838,7 +1841,8 @@ function useMakeStandardAutosuggestionFunction(textareaPurpose, contextCategorie
1838
1841
  messages
1839
1842
  }, apiConfig.forwardedParams), {
1840
1843
  copilotConfig: copilotApiConfig,
1841
- signal: abortSignal
1844
+ signal: abortSignal,
1845
+ headers
1842
1846
  }));
1843
1847
  if (!response.events) {
1844
1848
  throw new Error("Failed to fetch chat completion");