@copilotkit/react-textarea 0.13.0 → 0.14.1
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/.turbo/turbo-build.log +13 -13
- package/CHANGELOG.md +12 -0
- package/dist/{chunk-4YM33JFV.mjs → chunk-3A2CNIG5.mjs} +4 -1
- package/dist/chunk-3A2CNIG5.mjs.map +1 -0
- package/dist/{chunk-RXISUUUY.mjs → chunk-DRXBRCHN.mjs} +2 -2
- package/dist/{chunk-3OR5RMJQ.mjs → chunk-LGK56BTO.mjs} +2 -2
- package/dist/components/copilot-textarea/copilot-textarea.mjs +3 -3
- package/dist/components/index.mjs +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +3 -3
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.mjs +2 -2
- package/dist/types/standard-autosuggestions/autosuggestions-config.mjs +2 -2
- package/dist/types/standard-autosuggestions/chatlike-api-endpoint.d.ts +11 -0
- package/dist/types/standard-autosuggestions/chatlike-api-endpoint.mjs +1 -1
- package/dist/types/standard-autosuggestions/index.d.ts +1 -1
- package/dist/types/standard-autosuggestions/index.mjs +2 -2
- package/package.json +1 -1
- package/src/types/standard-autosuggestions/chatlike-api-endpoint.tsx +14 -1
- package/src/types/standard-autosuggestions/index.ts +2 -2
- package/dist/chunk-4YM33JFV.mjs.map +0 -1
- /package/dist/{chunk-RXISUUUY.mjs.map → chunk-DRXBRCHN.mjs.map} +0 -0
- /package/dist/{chunk-3OR5RMJQ.mjs.map → chunk-LGK56BTO.mjs.map} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @copilotkit/react-textarea@0.
|
|
2
|
+
> @copilotkit/react-textarea@0.14.1 build /home/runner/work/CopilotKit/CopilotKit/CopilotKit/packages/react-textarea
|
|
3
3
|
> tsup --treeshake
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx, src/components/index.ts, src/context/index.ts, src/hooks/index.ts, src/lib/debouncer.ts, src/lib/editor-to-text.ts, src/lib/get-text-around-cursor.ts, src/lib/utils.test.ts, src/lib/utils.ts, src/types/html-copilot-textarea-element.ts, src/types/index.ts, src/components/base-copilot-textarea/base-copilot-textarea.tsx, src/components/base-copilot-textarea/render-element.tsx, src/components/base-copilot-textarea/render-placeholder.tsx, src/components/base-copilot-textarea/use-add-branding-css.tsx, src/components/copilot-textarea/copilot-textarea.tsx, src/hooks/base-copilot-textarea-implementation/use-autosuggestions.ts, src/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.tsx, src/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.ts, src/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.tsx, src/lib/slatejs-edits/add-autocompletions.ts, src/lib/slatejs-edits/clear-autocompletions.ts, src/lib/slatejs-edits/replace-text.ts, src/lib/slatejs-edits/with-partial-history.ts, src/types/base/autosuggestion-state.ts, src/types/base/autosuggestions-bare-function.ts, src/types/base/base-autosuggestions-config.tsx, src/types/base/base-copilot-textarea-props.tsx, src/types/base/custom-editor.tsx, src/types/base/editor-autocomplete-state.ts, src/types/base/index.ts, src/types/standard-autosuggestions/autosuggestions-config.tsx, src/types/standard-autosuggestions/chatlike-api-endpoint.tsx, src/types/standard-autosuggestions/index.ts, src/types/standard-autosuggestions/minimal-chat-gpt-message.tsx
|
|
@@ -57,10 +57,10 @@ Generated an empty chunk: "chunk-H4VKQGVU".
|
|
|
57
57
|
[32mESM[39m [1mdist/components/copilot-textarea/copilot-textarea.mjs [22m[32m907.00 B[39m
|
|
58
58
|
[32mESM[39m [1mdist/index.mjs [22m[32m1.09 KB[39m
|
|
59
59
|
[32mESM[39m [1mdist/components/index.mjs [22m[32m888.00 B[39m
|
|
60
|
-
[32mESM[39m [1mdist/chunk-
|
|
60
|
+
[32mESM[39m [1mdist/chunk-DRXBRCHN.mjs [22m[32m1.23 KB[39m
|
|
61
61
|
[32mESM[39m [1mdist/chunk-4ES2IIB6.mjs [22m[32m1.76 KB[39m
|
|
62
|
-
[32mESM[39m [1mdist/chunk-
|
|
63
|
-
[32mESM[39m [1mdist/chunk-
|
|
62
|
+
[32mESM[39m [1mdist/chunk-LGK56BTO.mjs [22m[32m2.86 KB[39m
|
|
63
|
+
[32mESM[39m [1mdist/chunk-3A2CNIG5.mjs [22m[32m949.00 B[39m
|
|
64
64
|
[32mESM[39m [1mdist/chunk-M6QFKIBE.mjs [22m[32m5.99 KB[39m
|
|
65
65
|
[32mESM[39m [1mdist/chunk-HZGSG7ST.mjs [22m[32m3.02 KB[39m
|
|
66
66
|
[32mESM[39m [1mdist/chunk-UW3ITU2Y.mjs [22m[32m496.00 B[39m
|
|
@@ -122,10 +122,10 @@ Generated an empty chunk: "chunk-H4VKQGVU".
|
|
|
122
122
|
[32mESM[39m [1mdist/components/copilot-textarea/copilot-textarea.mjs.map [22m[32m51.00 B[39m
|
|
123
123
|
[32mESM[39m [1mdist/index.mjs.map [22m[32m51.00 B[39m
|
|
124
124
|
[32mESM[39m [1mdist/components/index.mjs.map [22m[32m51.00 B[39m
|
|
125
|
-
[32mESM[39m [1mdist/chunk-
|
|
125
|
+
[32mESM[39m [1mdist/chunk-DRXBRCHN.mjs.map [22m[32m2.17 KB[39m
|
|
126
126
|
[32mESM[39m [1mdist/chunk-4ES2IIB6.mjs.map [22m[32m4.41 KB[39m
|
|
127
|
-
[32mESM[39m [1mdist/chunk-
|
|
128
|
-
[32mESM[39m [1mdist/chunk-
|
|
127
|
+
[32mESM[39m [1mdist/chunk-LGK56BTO.mjs.map [22m[32m4.17 KB[39m
|
|
128
|
+
[32mESM[39m [1mdist/chunk-3A2CNIG5.mjs.map [22m[32m2.15 KB[39m
|
|
129
129
|
[32mESM[39m [1mdist/chunk-M6QFKIBE.mjs.map [22m[32m10.78 KB[39m
|
|
130
130
|
[32mESM[39m [1mdist/chunk-HZGSG7ST.mjs.map [22m[32m5.83 KB[39m
|
|
131
131
|
[32mESM[39m [1mdist/chunk-UW3ITU2Y.mjs.map [22m[32m878.00 B[39m
|
|
@@ -159,13 +159,13 @@ Generated an empty chunk: "chunk-H4VKQGVU".
|
|
|
159
159
|
[32mESM[39m [1mdist/types/standard-autosuggestions/autosuggestions-config.mjs.map [22m[32m51.00 B[39m
|
|
160
160
|
[32mESM[39m [1mdist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs.map [22m[32m51.00 B[39m
|
|
161
161
|
[32mESM[39m [1mdist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs.map [22m[32m51.00 B[39m
|
|
162
|
-
[32mESM[39m ⚡️ Build success in
|
|
162
|
+
[32mESM[39m ⚡️ Build success in 4388ms
|
|
163
163
|
Export "AutosuggestionsConfig" of module "src/types/standard-autosuggestions/autosuggestions-config.tsx" was reexported through module "src/types/standard-autosuggestions/index.ts" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
|
|
164
164
|
Either change the import in "src/components/copilot-textarea/copilot-textarea.tsx" to point directly to the exporting module or do not use "preserveModules" to ensure these modules end up in the same chunk.
|
|
165
165
|
Export "MakeSystemPrompt" of module "src/types/standard-autosuggestions/autosuggestions-config.tsx" was reexported through module "src/types/standard-autosuggestions/index.ts" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
|
|
166
166
|
Either change the import in "src/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.tsx" to point directly to the exporting module or do not use "preserveModules" to ensure these modules end up in the same chunk.
|
|
167
|
-
[32mDTS[39m ⚡️ Build success in
|
|
168
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m1.
|
|
167
|
+
[32mDTS[39m ⚡️ Build success in 7435ms
|
|
168
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m1.01 KB[39m
|
|
169
169
|
[32mDTS[39m [1mdist/components/base-copilot-textarea/base-copilot-textarea.d.ts [22m[32m669.00 B[39m
|
|
170
170
|
[32mDTS[39m [1mdist/components/copilot-textarea/copilot-textarea.d.ts [22m[32m875.00 B[39m
|
|
171
171
|
[32mDTS[39m [1mdist/types/base/base-autosuggestions-config.d.ts [22m[32m355.00 B[39m
|
|
@@ -174,7 +174,7 @@ Either change the import in "src/hooks/make-autosuggestions-function/use-make-st
|
|
|
174
174
|
[32mDTS[39m [1mdist/types/html-copilot-textarea-element.d.ts [22m[32m165.00 B[39m
|
|
175
175
|
[32mDTS[39m [1mdist/types/standard-autosuggestions/autosuggestions-config.d.ts [22m[32m963.00 B[39m
|
|
176
176
|
[32mDTS[39m [1mdist/types/standard-autosuggestions/minimal-chat-gpt-message.d.ts [22m[32m129.00 B[39m
|
|
177
|
-
[32mDTS[39m [1mdist/types/standard-autosuggestions/chatlike-api-endpoint.d.ts [22m[
|
|
177
|
+
[32mDTS[39m [1mdist/types/standard-autosuggestions/chatlike-api-endpoint.d.ts [22m[32m1004.00 B[39m
|
|
178
178
|
[32mDTS[39m [1mdist/components/index.d.ts [22m[32m630.00 B[39m
|
|
179
179
|
[32mDTS[39m [1mdist/context/index.d.ts [22m[32m1.00 B[39m
|
|
180
180
|
[32mDTS[39m [1mdist/hooks/index.d.ts [22m[32m1.00 B[39m
|
|
@@ -184,7 +184,7 @@ Either change the import in "src/hooks/make-autosuggestions-function/use-make-st
|
|
|
184
184
|
[32mDTS[39m [1mdist/types/base/editor-autocomplete-state.d.ts [22m[32m342.00 B[39m
|
|
185
185
|
[32mDTS[39m [1mdist/lib/utils.test.d.ts [22m[32m1.00 B[39m
|
|
186
186
|
[32mDTS[39m [1mdist/lib/utils.d.ts [22m[32m638.00 B[39m
|
|
187
|
-
[32mDTS[39m [1mdist/types/index.d.ts [22m[
|
|
187
|
+
[32mDTS[39m [1mdist/types/index.d.ts [22m[32m786.00 B[39m
|
|
188
188
|
[32mDTS[39m [1mdist/components/base-copilot-textarea/render-element.d.ts [22m[32m292.00 B[39m
|
|
189
189
|
[32mDTS[39m [1mdist/components/base-copilot-textarea/render-placeholder.d.ts [22m[32m321.00 B[39m
|
|
190
190
|
[32mDTS[39m [1mdist/components/base-copilot-textarea/use-add-branding-css.d.ts [22m[32m158.00 B[39m
|
|
@@ -199,4 +199,4 @@ Either change the import in "src/hooks/make-autosuggestions-function/use-make-st
|
|
|
199
199
|
[32mDTS[39m [1mdist/lib/slatejs-edits/replace-text.d.ts [22m[32m139.00 B[39m
|
|
200
200
|
[32mDTS[39m [1mdist/lib/slatejs-edits/with-partial-history.d.ts [22m[32m542.00 B[39m
|
|
201
201
|
[32mDTS[39m [1mdist/types/base/index.d.ts [22m[32m287.00 B[39m
|
|
202
|
-
[32mDTS[39m [1mdist/types/standard-autosuggestions/index.d.ts [22m[
|
|
202
|
+
[32mDTS[39m [1mdist/types/standard-autosuggestions/index.d.ts [22m[32m377.00 B[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
+
## 0.14.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 20bed44: added custom static factory method to ChatlikeApiEndpoint
|
|
8
|
+
|
|
9
|
+
## 0.14.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- cfdc367: export ChatlikeApiEndpoint types in original name
|
|
14
|
+
|
|
3
15
|
## 0.13.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -21,8 +21,11 @@ var ChatlikeApiEndpoint = class {
|
|
|
21
21
|
})
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
|
+
static custom(run) {
|
|
25
|
+
return new ChatlikeApiEndpoint(run);
|
|
26
|
+
}
|
|
24
27
|
};
|
|
25
28
|
|
|
26
29
|
export { ChatlikeApiEndpoint };
|
|
27
30
|
//# sourceMappingURL=out.js.map
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
31
|
+
//# sourceMappingURL=chunk-3A2CNIG5.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/types/standard-autosuggestions/chatlike-api-endpoint.tsx"],"names":[],"mappings":";;;;;;;AAQO,IAAM,sBAAN,MAA0B;AAAA,EAG/B,YAAY,KAA8B;AACxC,SAAK,MAAM;AAAA,EACb;AAAA,EAOA,OAAO,uBAAuB,aAA0C;AACtE,WAAO,IAAI;AAAA,MACT,CACE,aACA,UACA,mBACG;AACH,cAAM,MAAM,MAAM,MAAM,aAAa;AAAA,UACnC,QAAQ;AAAA,UACR,MAAM,KAAK,UAAU,iCAChB,iBADgB;AAAA,YAEnB;AAAA,UACF,EAAC;AAAA,UACD,QAAQ;AAAA,QACV,CAAC;AAED,cAAM,OAAO,MAAM,IAAI,KAAK;AAC5B,cAAM,aAAa,KAAK,QAAQ,GAAG,QAAQ;AAC3C,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAAA,EAOA,OAAO,OAAO,KAAmD;AAC/D,WAAO,IAAI,oBAAoB,GAAG;AAAA,EACpC;AACF","sourcesContent":["import { MinimalChatGPTMessage } from \"..\";\n\nexport type ChatlikeApiEndpointImpl = (\n abortSignal: AbortSignal,\n messages: MinimalChatGPTMessage[],\n forwardedProps?: { [key: string]: any }\n) => Promise<string>;\n\nexport class ChatlikeApiEndpoint {\n public run: ChatlikeApiEndpointImpl;\n\n constructor(run: ChatlikeApiEndpointImpl) {\n this.run = run;\n }\n\n /**\n * Creates a new instance of ChatlikeApiEndpoint with the provided API endpoint.\n * @param apiEndpoint The URL of the OpenAI-compatible API endpoint.\n * @returns A new instance of ChatlikeApiEndpoint.\n */\n static standardOpenAIEndpoint(apiEndpoint: string): ChatlikeApiEndpoint {\n return new ChatlikeApiEndpoint(\n async (\n abortSignal: AbortSignal,\n messages: MinimalChatGPTMessage[],\n forwardedProps?: { [key: string]: any }\n ) => {\n const res = await fetch(apiEndpoint, {\n method: \"POST\",\n body: JSON.stringify({\n ...forwardedProps,\n messages: messages,\n }),\n signal: abortSignal,\n });\n\n const json = await res.json();\n const suggestion = json.choices[0].message.content;\n return suggestion;\n }\n );\n }\n\n /**\n * Creates a fully customized instance of ChatlikeApiEndpoint.\n * @param run - The implementation of the ChatlikeApiEndpointImpl interface.\n * @returns A new instance of ChatlikeApiEndpoint .\n */\n static custom(run: ChatlikeApiEndpointImpl): ChatlikeApiEndpoint {\n return new ChatlikeApiEndpoint(run);\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMakeStandardAutosuggestionFunction } from './chunk-4ES2IIB6.mjs';
|
|
2
|
-
import { defaultAutosuggestionsConfig } from './chunk-
|
|
2
|
+
import { defaultAutosuggestionsConfig } from './chunk-LGK56BTO.mjs';
|
|
3
3
|
import { BaseCopilotTextarea } from './chunk-M6QFKIBE.mjs';
|
|
4
4
|
import { __spreadValues, __spreadProps } from './chunk-MRXNTQOX.mjs';
|
|
5
5
|
import React from 'react';
|
|
@@ -29,4 +29,4 @@ var CopilotTextarea = React.forwardRef(
|
|
|
29
29
|
|
|
30
30
|
export { CopilotTextarea };
|
|
31
31
|
//# sourceMappingURL=out.js.map
|
|
32
|
-
//# sourceMappingURL=chunk-
|
|
32
|
+
//# sourceMappingURL=chunk-DRXBRCHN.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChatlikeApiEndpoint } from './chunk-
|
|
1
|
+
import { ChatlikeApiEndpoint } from './chunk-3A2CNIG5.mjs';
|
|
2
2
|
import { defaultBaseAutosuggestionsConfig } from './chunk-7KWRVIYV.mjs';
|
|
3
3
|
import { __spreadProps, __spreadValues } from './chunk-MRXNTQOX.mjs';
|
|
4
4
|
|
|
@@ -69,4 +69,4 @@ var defaultAutosuggestionsConfig = __spreadProps(__spreadValues({}, defaultBaseA
|
|
|
69
69
|
|
|
70
70
|
export { defaultAutosuggestionsConfig, defaultFewShotMessages, defaultMakeSystemPrompt };
|
|
71
71
|
//# sourceMappingURL=out.js.map
|
|
72
|
-
//# sourceMappingURL=chunk-
|
|
72
|
+
//# sourceMappingURL=chunk-LGK56BTO.mjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { CopilotTextarea } from '../../chunk-
|
|
1
|
+
export { CopilotTextarea } from '../../chunk-DRXBRCHN.mjs';
|
|
2
2
|
import '../../chunk-4ES2IIB6.mjs';
|
|
3
3
|
import '../../chunk-AZQCUNBV.mjs';
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
4
|
+
import '../../chunk-LGK56BTO.mjs';
|
|
5
|
+
import '../../chunk-3A2CNIG5.mjs';
|
|
6
6
|
import '../../chunk-M6QFKIBE.mjs';
|
|
7
7
|
import '../../chunk-HZGSG7ST.mjs';
|
|
8
8
|
import '../../chunk-UW3ITU2Y.mjs';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import '../chunk-MMVDU6DF.mjs';
|
|
2
|
-
export { CopilotTextarea } from '../chunk-
|
|
2
|
+
export { CopilotTextarea } from '../chunk-DRXBRCHN.mjs';
|
|
3
3
|
import '../chunk-4ES2IIB6.mjs';
|
|
4
4
|
import '../chunk-AZQCUNBV.mjs';
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-LGK56BTO.mjs';
|
|
6
|
+
import '../chunk-3A2CNIG5.mjs';
|
|
7
7
|
export { BaseCopilotTextarea } from '../chunk-M6QFKIBE.mjs';
|
|
8
8
|
import '../chunk-HZGSG7ST.mjs';
|
|
9
9
|
import '../chunk-UW3ITU2Y.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ export { BaseCopilotTextareaProps } from './types/base/base-copilot-textarea-pro
|
|
|
6
6
|
export { HTMLCopilotTextAreaElement } from './types/html-copilot-textarea-element.js';
|
|
7
7
|
export { AutosuggestionsConfig, MakeSystemPrompt, defaultAutosuggestionsConfig, defaultFewShotMessages, defaultMakeSystemPrompt } from './types/standard-autosuggestions/autosuggestions-config.js';
|
|
8
8
|
export { MinimalChatGPTMessage } from './types/standard-autosuggestions/minimal-chat-gpt-message.js';
|
|
9
|
-
export { ChatlikeApiEndpoint
|
|
9
|
+
export { ChatlikeApiEndpoint, ChatlikeApiEndpointImpl } from './types/standard-autosuggestions/chatlike-api-endpoint.js';
|
|
10
10
|
import 'react';
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import './chunk-DE5K76I2.mjs';
|
|
2
2
|
import './chunk-WADHCMPK.mjs';
|
|
3
3
|
import './chunk-MMVDU6DF.mjs';
|
|
4
|
-
export { CopilotTextarea } from './chunk-
|
|
4
|
+
export { CopilotTextarea } from './chunk-DRXBRCHN.mjs';
|
|
5
5
|
import './chunk-4ES2IIB6.mjs';
|
|
6
6
|
import './chunk-AZQCUNBV.mjs';
|
|
7
|
-
export { defaultAutosuggestionsConfig, defaultFewShotMessages, defaultMakeSystemPrompt } from './chunk-
|
|
8
|
-
import './chunk-
|
|
7
|
+
export { defaultAutosuggestionsConfig, defaultFewShotMessages, defaultMakeSystemPrompt } from './chunk-LGK56BTO.mjs';
|
|
8
|
+
import './chunk-3A2CNIG5.mjs';
|
|
9
9
|
export { BaseCopilotTextarea } from './chunk-M6QFKIBE.mjs';
|
|
10
10
|
import './chunk-HZGSG7ST.mjs';
|
|
11
11
|
import './chunk-UW3ITU2Y.mjs';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export { BaseCopilotTextareaProps } from './base/base-copilot-textarea-props.js'
|
|
|
4
4
|
export { HTMLCopilotTextAreaElement } from './html-copilot-textarea-element.js';
|
|
5
5
|
export { AutosuggestionsConfig, MakeSystemPrompt, defaultAutosuggestionsConfig, defaultFewShotMessages, defaultMakeSystemPrompt } from './standard-autosuggestions/autosuggestions-config.js';
|
|
6
6
|
export { MinimalChatGPTMessage } from './standard-autosuggestions/minimal-chat-gpt-message.js';
|
|
7
|
-
export { ChatlikeApiEndpoint
|
|
7
|
+
export { ChatlikeApiEndpoint, ChatlikeApiEndpointImpl } from './standard-autosuggestions/chatlike-api-endpoint.js';
|
|
8
8
|
import 'react';
|
package/dist/types/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '../chunk-DE5K76I2.mjs';
|
|
2
2
|
import '../chunk-WADHCMPK.mjs';
|
|
3
3
|
import '../chunk-AZQCUNBV.mjs';
|
|
4
|
-
export { defaultAutosuggestionsConfig, defaultFewShotMessages, defaultMakeSystemPrompt } from '../chunk-
|
|
5
|
-
import '../chunk-
|
|
4
|
+
export { defaultAutosuggestionsConfig, defaultFewShotMessages, defaultMakeSystemPrompt } from '../chunk-LGK56BTO.mjs';
|
|
5
|
+
import '../chunk-3A2CNIG5.mjs';
|
|
6
6
|
import '../chunk-WJHSY5T6.mjs';
|
|
7
7
|
export { defaultBaseAutosuggestionsConfig } from '../chunk-7KWRVIYV.mjs';
|
|
8
8
|
import '../chunk-MRXNTQOX.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { defaultAutosuggestionsConfig, defaultFewShotMessages, defaultMakeSystemPrompt } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
export { defaultAutosuggestionsConfig, defaultFewShotMessages, defaultMakeSystemPrompt } from '../../chunk-LGK56BTO.mjs';
|
|
2
|
+
import '../../chunk-3A2CNIG5.mjs';
|
|
3
3
|
import '../../chunk-WJHSY5T6.mjs';
|
|
4
4
|
import '../../chunk-7KWRVIYV.mjs';
|
|
5
5
|
import '../../chunk-MRXNTQOX.mjs';
|
|
@@ -6,7 +6,18 @@ type ChatlikeApiEndpointImpl = (abortSignal: AbortSignal, messages: MinimalChatG
|
|
|
6
6
|
declare class ChatlikeApiEndpoint {
|
|
7
7
|
run: ChatlikeApiEndpointImpl;
|
|
8
8
|
constructor(run: ChatlikeApiEndpointImpl);
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new instance of ChatlikeApiEndpoint with the provided API endpoint.
|
|
11
|
+
* @param apiEndpoint The URL of the OpenAI-compatible API endpoint.
|
|
12
|
+
* @returns A new instance of ChatlikeApiEndpoint.
|
|
13
|
+
*/
|
|
9
14
|
static standardOpenAIEndpoint(apiEndpoint: string): ChatlikeApiEndpoint;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a fully customized instance of ChatlikeApiEndpoint.
|
|
17
|
+
* @param run - The implementation of the ChatlikeApiEndpointImpl interface.
|
|
18
|
+
* @returns A new instance of ChatlikeApiEndpoint .
|
|
19
|
+
*/
|
|
20
|
+
static custom(run: ChatlikeApiEndpointImpl): ChatlikeApiEndpoint;
|
|
10
21
|
}
|
|
11
22
|
|
|
12
23
|
export { ChatlikeApiEndpoint, ChatlikeApiEndpointImpl };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { AutosuggestionsConfig, MakeSystemPrompt, defaultAutosuggestionsConfig, defaultFewShotMessages, defaultMakeSystemPrompt } from './autosuggestions-config.js';
|
|
2
2
|
export { MinimalChatGPTMessage } from './minimal-chat-gpt-message.js';
|
|
3
|
-
export { ChatlikeApiEndpoint
|
|
3
|
+
export { ChatlikeApiEndpoint, ChatlikeApiEndpointImpl } from './chatlike-api-endpoint.js';
|
|
4
4
|
import '../base/base-autosuggestions-config.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../chunk-AZQCUNBV.mjs';
|
|
2
|
-
export { defaultAutosuggestionsConfig, defaultFewShotMessages, defaultMakeSystemPrompt } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
2
|
+
export { defaultAutosuggestionsConfig, defaultFewShotMessages, defaultMakeSystemPrompt } from '../../chunk-LGK56BTO.mjs';
|
|
3
|
+
import '../../chunk-3A2CNIG5.mjs';
|
|
4
4
|
import '../../chunk-WJHSY5T6.mjs';
|
|
5
5
|
import '../../chunk-7KWRVIYV.mjs';
|
|
6
6
|
import '../../chunk-MRXNTQOX.mjs';
|
package/package.json
CHANGED
|
@@ -13,7 +13,11 @@ export class ChatlikeApiEndpoint {
|
|
|
13
13
|
this.run = run;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new instance of ChatlikeApiEndpoint with the provided API endpoint.
|
|
18
|
+
* @param apiEndpoint The URL of the OpenAI-compatible API endpoint.
|
|
19
|
+
* @returns A new instance of ChatlikeApiEndpoint.
|
|
20
|
+
*/
|
|
17
21
|
static standardOpenAIEndpoint(apiEndpoint: string): ChatlikeApiEndpoint {
|
|
18
22
|
return new ChatlikeApiEndpoint(
|
|
19
23
|
async (
|
|
@@ -36,4 +40,13 @@ export class ChatlikeApiEndpoint {
|
|
|
36
40
|
}
|
|
37
41
|
);
|
|
38
42
|
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Creates a fully customized instance of ChatlikeApiEndpoint.
|
|
46
|
+
* @param run - The implementation of the ChatlikeApiEndpointImpl interface.
|
|
47
|
+
* @returns A new instance of ChatlikeApiEndpoint .
|
|
48
|
+
*/
|
|
49
|
+
static custom(run: ChatlikeApiEndpointImpl): ChatlikeApiEndpoint {
|
|
50
|
+
return new ChatlikeApiEndpoint(run);
|
|
51
|
+
}
|
|
39
52
|
}
|
|
@@ -11,6 +11,6 @@ export type {
|
|
|
11
11
|
export type { MinimalChatGPTMessage } from "./minimal-chat-gpt-message";
|
|
12
12
|
|
|
13
13
|
export type {
|
|
14
|
-
ChatlikeApiEndpoint
|
|
15
|
-
ChatlikeApiEndpointImpl
|
|
14
|
+
ChatlikeApiEndpoint,
|
|
15
|
+
ChatlikeApiEndpointImpl,
|
|
16
16
|
} from "./chatlike-api-endpoint";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/standard-autosuggestions/chatlike-api-endpoint.tsx"],"names":[],"mappings":";;;;;;;AAQO,IAAM,sBAAN,MAA0B;AAAA,EAG/B,YAAY,KAA8B;AACxC,SAAK,MAAM;AAAA,EACb;AAAA,EAGA,OAAO,uBAAuB,aAA0C;AACtE,WAAO,IAAI;AAAA,MACT,CACE,aACA,UACA,mBACG;AACH,cAAM,MAAM,MAAM,MAAM,aAAa;AAAA,UACnC,QAAQ;AAAA,UACR,MAAM,KAAK,UAAU,iCAChB,iBADgB;AAAA,YAEnB;AAAA,UACF,EAAC;AAAA,UACD,QAAQ;AAAA,QACV,CAAC;AAED,cAAM,OAAO,MAAM,IAAI,KAAK;AAC5B,cAAM,aAAa,KAAK,QAAQ,GAAG,QAAQ;AAC3C,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF","sourcesContent":["import { MinimalChatGPTMessage } from \"..\";\n\nexport type ChatlikeApiEndpointImpl = (\n abortSignal: AbortSignal,\n messages: MinimalChatGPTMessage[],\n forwardedProps?: { [key: string]: any }\n) => Promise<string>;\n\nexport class ChatlikeApiEndpoint {\n public run: ChatlikeApiEndpointImpl;\n\n constructor(run: ChatlikeApiEndpointImpl) {\n this.run = run;\n }\n\n // Static method\n static standardOpenAIEndpoint(apiEndpoint: string): ChatlikeApiEndpoint {\n return new ChatlikeApiEndpoint(\n async (\n abortSignal: AbortSignal,\n messages: MinimalChatGPTMessage[],\n forwardedProps?: { [key: string]: any }\n ) => {\n const res = await fetch(apiEndpoint, {\n method: \"POST\",\n body: JSON.stringify({\n ...forwardedProps,\n messages: messages,\n }),\n signal: abortSignal,\n });\n\n const json = await res.json();\n const suggestion = json.choices[0].message.content;\n return suggestion;\n }\n );\n }\n}\n"]}
|
|
File without changes
|
|
File without changes
|