@copilotkit/react-textarea 1.78.0 → 1.79.1-canary.1792034358
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.
- package/dist/index.cjs +1 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +2 -6
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +1 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +7 -7
- package/src/hooks/make-autosuggestions-function/__tests__/use-make-standard-autosuggestions-function.headers.test.tsx +71 -0
- package/src/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.tsx +5 -17
- package/vitest.config.mjs +1 -1
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { twMerge } from "tailwind-merge";
|
|
|
8
8
|
import { clsx } from "clsx";
|
|
9
9
|
import { HistoryEditor } from "slate-history";
|
|
10
10
|
import { defaultCopilotContextCategories, useCopilotContext } from "@copilotkit/react-core";
|
|
11
|
-
import {
|
|
11
|
+
import { isMacOS } from "@copilotkit/shared";
|
|
12
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { css, cx } from "@emotion/css";
|
|
14
14
|
import ReactDOM from "react-dom";
|
|
@@ -1400,11 +1400,7 @@ function retry(fn, retriesLeft = 2, interval = 200, backoff = 1.5) {
|
|
|
1400
1400
|
*/
|
|
1401
1401
|
function useMakeStandardAutosuggestionFunction(textareaPurpose, contextCategories, apiConfig) {
|
|
1402
1402
|
const { getContextString, copilotApiConfig } = useCopilotContext();
|
|
1403
|
-
const { chatApiEndpoint: url,
|
|
1404
|
-
({
|
|
1405
|
-
...copilotApiConfig.headers,
|
|
1406
|
-
...publicApiKey ? { [COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: publicApiKey } : {}
|
|
1407
|
-
});
|
|
1403
|
+
const { chatApiEndpoint: url, credentials, properties } = copilotApiConfig;
|
|
1408
1404
|
const { maxTokens, stop, temperature = 0 } = apiConfig;
|
|
1409
1405
|
return useCallback(async (editorState, abortSignal) => {
|
|
1410
1406
|
return await retry(async () => {
|