@ckeditor/ckeditor5-ai 48.0.0-alpha.8 → 48.0.0-alpha.9
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/LICENSE.md +0 -4
- package/dist/aiactions/model/aiactionsinteraction.d.ts +4 -0
- package/dist/aiassistant/adapters/awstextadapter.d.ts +15 -156
- package/dist/aiassistant/aiassistant.d.ts +2 -0
- package/dist/index.js +6 -6
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +12 -13
package/LICENSE.md
CHANGED
|
@@ -12,10 +12,6 @@ Sources of Intellectual Property Included in CKEditor 5
|
|
|
12
12
|
|
|
13
13
|
Where not otherwise indicated, all CKEditor 5 content is authored by CKSource engineers and consists of CKSource-owned intellectual property.
|
|
14
14
|
|
|
15
|
-
The following libraries are included in CKEditor 5 under the [Apache-2.0 license](https://opensource.org/licenses/Apache-2.0):
|
|
16
|
-
|
|
17
|
-
* @aws-sdk/client-bedrock-runtime - Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
18
|
-
|
|
19
15
|
The following libraries are included in CKEditor 5 under the [BSD-2-Clause license](https://opensource.org/licenses/BSD-2-Clause):
|
|
20
16
|
|
|
21
17
|
* domhandler - Copyright (c) Felix Böhm.
|
|
@@ -36,6 +36,10 @@ export declare class AIActionsInteraction extends AIInteraction {
|
|
|
36
36
|
*/
|
|
37
37
|
readonly model?: string;
|
|
38
38
|
hasError: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Set when this interaction fires `interactionStopped` (see {@link module:ai/aicore/model/aiinteraction~AIInteraction#stop}).
|
|
41
|
+
*/
|
|
42
|
+
stoppedExplicitly: boolean;
|
|
39
43
|
constructor(options: AIActionsInteractionOptions);
|
|
40
44
|
sendRequest(): Promise<AIConnectorRequest>;
|
|
41
45
|
getDocumentContext(): AIContextItem | undefined;
|
|
@@ -6,13 +6,16 @@
|
|
|
6
6
|
* @module ai/aiassistant/adapters/awstextadapter
|
|
7
7
|
* @publicApi
|
|
8
8
|
*/
|
|
9
|
-
import { type Editor } from '@ckeditor/ckeditor5-core';
|
|
10
9
|
import { AITextAdapter, type AITextAdapterRequestData, type AIRequestHeaders, type AIRequestParameters } from './aitextadapter.js';
|
|
11
|
-
import { type BedrockRuntimeClientConfig } from '@aws-sdk/client-bedrock-runtime';
|
|
12
10
|
/**
|
|
13
11
|
* Adapter for AI text-related requests that supports the Amazon Bedrock service.
|
|
14
12
|
*
|
|
13
|
+
* **This adapter is no longer supported and will throw an error when used.**
|
|
14
|
+
* Please contact CKEditor support at https://support.ckeditor.com for more information about available AI adapters.
|
|
15
|
+
*
|
|
15
16
|
* See also {@link module:ai/aiassistant/adapters/aitextadapter~AITextAdapter}.
|
|
17
|
+
*
|
|
18
|
+
* @deprecated
|
|
16
19
|
*/
|
|
17
20
|
export declare class AWSTextAdapter extends AITextAdapter {
|
|
18
21
|
/**
|
|
@@ -22,171 +25,27 @@ export declare class AWSTextAdapter extends AITextAdapter {
|
|
|
22
25
|
/**
|
|
23
26
|
* @inheritDoc
|
|
24
27
|
*/
|
|
25
|
-
|
|
28
|
+
init(): void;
|
|
26
29
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* If you want to extend this adapter, you can overload this method to do some additional processing or make an external call.
|
|
30
|
+
* Always throws an error as the AWS integration is no longer supported.
|
|
30
31
|
*/
|
|
31
|
-
sendRequest(
|
|
32
|
-
/**
|
|
33
|
-
* Prepares the actual full prompt for the request to the Amazon Bedrock API.
|
|
34
|
-
*
|
|
35
|
-
* The prompt may differ depending on what model is used.
|
|
36
|
-
*
|
|
37
|
-
* You can overload this method to customize the prompts that are sent to the AI service.
|
|
38
|
-
*
|
|
39
|
-
* @param query The user's query. The instruction which the model should perform.
|
|
40
|
-
* @param context The context for the instruction. Usually this will be a part of the editor content. Can be empty.
|
|
41
|
-
* @param model Model that is used to perform the request.
|
|
42
|
-
* @param actionId ID of the performed action.
|
|
43
|
-
* See {@link module:ai/aiassistant/adapters/aitextadapter~AITextAdapterRequestData#actionId}.
|
|
44
|
-
*/
|
|
45
|
-
preparePrompt(query: string, context: string, model: string, actionId: string): Promise<string>;
|
|
46
|
-
/**
|
|
47
|
-
* For a given model, it returns the family to which this model belongs.
|
|
48
|
-
*
|
|
49
|
-
* For example, for `anthropic.claude-instant-v1` it will return `anthropic.claude`.
|
|
50
|
-
*
|
|
51
|
-
* Throws {@link module:ai/aiassistant/adapters/aiadapter~AIRequestError `AIRequestError`} if a given model is not supported.
|
|
52
|
-
*/
|
|
53
|
-
getModelFamily(model: string): AIAWSModelFamily;
|
|
32
|
+
sendRequest(requestData: AITextAdapterRequestData): Promise<void>;
|
|
54
33
|
}
|
|
55
34
|
/**
|
|
56
35
|
* The configuration for the Amazon Bedrock adapter.
|
|
57
36
|
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* ```ts
|
|
61
|
-
* ClassicEditor
|
|
62
|
-
* .create( {
|
|
63
|
-
* ai: {
|
|
64
|
-
* assistant: {
|
|
65
|
-
* adapter: {
|
|
66
|
-
* aws: {
|
|
67
|
-
* apiUrl: 'https://url.to.your.application/ai'
|
|
68
|
-
* }
|
|
69
|
-
* }
|
|
70
|
-
* }
|
|
71
|
-
* }
|
|
72
|
-
* } )
|
|
73
|
-
* .then( ... )
|
|
74
|
-
* .catch( ... );
|
|
75
|
-
* ```
|
|
37
|
+
* **This adapter is no longer supported.**
|
|
38
|
+
* Please contact CKEditor support at https://support.ckeditor.com for more information about available AI adapters.
|
|
76
39
|
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
|
40
|
+
* @deprecated
|
|
80
41
|
*/
|
|
81
42
|
export interface AIAWSTextAdapterConfig {
|
|
82
|
-
/**
|
|
83
|
-
* The URL to which the AI service request will be sent.
|
|
84
|
-
*
|
|
85
|
-
* Set this value only if you want to connect to Amazon Bedrock using a proxy endpoint.
|
|
86
|
-
*
|
|
87
|
-
* If `apiUrl` is not provided, the AWS-SDK library will be used to process the request. It will set a proper URL on its own.
|
|
88
|
-
*/
|
|
89
43
|
apiUrl?: string;
|
|
90
|
-
/**
|
|
91
|
-
* An object with headers to set in the request to the AI service.
|
|
92
|
-
*
|
|
93
|
-
* **These headers are only used when connecting to AWS through the proxy endpoint (that is, when `apiUrl` is set).**
|
|
94
|
-
*
|
|
95
|
-
* Otherwise, the AWS-SDK library is used, and it sets the request headers on its own. In this mode, the request headers cannot be
|
|
96
|
-
* customized.
|
|
97
|
-
*
|
|
98
|
-
* If the provided value is an object, it is simply used as provided.
|
|
99
|
-
*
|
|
100
|
-
* ```js
|
|
101
|
-
* {
|
|
102
|
-
* ai: {
|
|
103
|
-
* assistant: {
|
|
104
|
-
* adapter: {
|
|
105
|
-
* aws: {
|
|
106
|
-
* requestHeaders: {
|
|
107
|
-
* 'Authorization': 'Bearer YOUR_API_KEY'
|
|
108
|
-
* }
|
|
109
|
-
* }
|
|
110
|
-
* // ...
|
|
111
|
-
* }
|
|
112
|
-
* }
|
|
113
|
-
* }
|
|
114
|
-
* }
|
|
115
|
-
* ```
|
|
116
|
-
*
|
|
117
|
-
* If the provided value is a function, it should be a function that returns a promise which resolves with the headers object.
|
|
118
|
-
* This way, you can perform an authorization request to your application and receive the authorization token (and also implement
|
|
119
|
-
* any custom logic on the backend side). The headers object is then used to make the actual call to the AI service.
|
|
120
|
-
*
|
|
121
|
-
* ```js
|
|
122
|
-
* {
|
|
123
|
-
* ai: {
|
|
124
|
-
* assistant: {
|
|
125
|
-
* adapter: {
|
|
126
|
-
* aws: {
|
|
127
|
-
* requestHeaders: async () => {
|
|
128
|
-
* const jwt = await fetch( 'https://example.com/jwt-endpoint' );
|
|
129
|
-
*
|
|
130
|
-
* return {
|
|
131
|
-
* 'Authorization': 'Bearer ' + jwt
|
|
132
|
-
* }
|
|
133
|
-
* }
|
|
134
|
-
* }
|
|
135
|
-
* // ...
|
|
136
|
-
* }
|
|
137
|
-
* }
|
|
138
|
-
* }
|
|
139
|
-
* }
|
|
140
|
-
* ```
|
|
141
|
-
*
|
|
142
|
-
* The function is passed the {@link module:ai/aiassistant/adapters/aitextadapter~AITextAdapterRequestData#actionId `actionId`}
|
|
143
|
-
* parameter to make it possible to further customize the headers.
|
|
144
|
-
*
|
|
145
|
-
* If the function fails for any reason, the promise should be rejected. In this case, a feature that made the request should display
|
|
146
|
-
* an error notification.
|
|
147
|
-
*/
|
|
148
44
|
requestHeaders?: AIRequestHeaders;
|
|
149
|
-
/**
|
|
150
|
-
* Additional configuration parameters for the AI service request. Use it to customize how the AI service generates responses.
|
|
151
|
-
* Note that the value you will set here will fully overwrite the default value.
|
|
152
|
-
*
|
|
153
|
-
* The exact configuration (available parameters) depends on the used model. Keep in mind that some properties are not supported by some
|
|
154
|
-
* models.
|
|
155
|
-
*
|
|
156
|
-
* See [AWS model parameters reference](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html) to learn more.
|
|
157
|
-
*
|
|
158
|
-
* If the provided value is an object, it is passed to the request as provided.
|
|
159
|
-
*
|
|
160
|
-
* If the provided value is a function, it should be a function that returns a promise which resolves with the request parameters
|
|
161
|
-
* object. This gives you more flexibility to provide parameters for the AI model.
|
|
162
|
-
*
|
|
163
|
-
* The function is passed the {@link module:ai/aiassistant/adapters/aitextadapter~AITextAdapterRequestData#actionId `actionId`}
|
|
164
|
-
* parameter to make it possible to further customize the parameters.
|
|
165
|
-
*
|
|
166
|
-
* If the function fails for any reason, the promise should be rejected. In this case, the feature that made the request should display
|
|
167
|
-
* an error notification.
|
|
168
|
-
*
|
|
169
|
-
* Defaults to:
|
|
170
|
-
*
|
|
171
|
-
* ```json
|
|
172
|
-
* {
|
|
173
|
-
* model: 'anthropic.claude-v2',
|
|
174
|
-
* max_tokens_to_sample: 500,
|
|
175
|
-
* temperature: 1,
|
|
176
|
-
* top_k: 250,
|
|
177
|
-
* top_p: 1,
|
|
178
|
-
* anthropic_version: 'bedrock-2023-05-31',
|
|
179
|
-
* stream: true
|
|
180
|
-
* }
|
|
181
|
-
* ```
|
|
182
|
-
*/
|
|
183
45
|
requestParameters?: AIRequestParameters;
|
|
184
|
-
|
|
185
|
-
* The configuration for AWS-SDK Bedrock Runtime Client.
|
|
186
|
-
*
|
|
187
|
-
* If `apiUrl` is not provided, this configuration will be used to initialize the Bedrock Runtime Client which will be used to process
|
|
188
|
-
* the requests. The adapter will make requests directly to the Amazon Bedrock service.
|
|
189
|
-
*/
|
|
190
|
-
bedrockClientConfig?: BedrockRuntimeClientConfig;
|
|
46
|
+
bedrockClientConfig?: unknown;
|
|
191
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated
|
|
50
|
+
*/
|
|
192
51
|
export type AIAWSModelFamily = 'anthropic.claude' | 'ai21.j2' | 'cohere.command' | 'meta.llama';
|
|
@@ -379,6 +379,8 @@ export interface AIAssistantConfig {
|
|
|
379
379
|
* This is required only if you connect to Amazon Bedrock service.
|
|
380
380
|
*
|
|
381
381
|
* Read more in {@link module:ai/aiassistant/adapters/awstextadapter~AIAWSTextAdapterConfig}.
|
|
382
|
+
*
|
|
383
|
+
* @deprecated
|
|
382
384
|
*/
|
|
383
385
|
aws?: AIAWSTextAdapterConfig;
|
|
384
386
|
};
|