ckeditor / ckeditor5-react

Official CKEditor 5 React component.
https://ckeditor.com/ckeditor-5
Other
426 stars 100 forks source link

Cannot use AI Assistant: CKEditorError: aiadapter-text-adapter-not-set #472

Closed dobri1408 closed 7 months ago

dobri1408 commented 7 months ago

This is my checkout.ts file `/**

import { ClassicEditor } from "@ckeditor/ckeditor5-editor-classic";

import { AIAssistant } from "@ckeditor/ckeditor5-ai"; import { Autoformat } from "@ckeditor/ckeditor5-autoformat"; import { Bold, Italic } from "@ckeditor/ckeditor5-basic-styles"; import { BlockQuote } from "@ckeditor/ckeditor5-block-quote"; import { OpenAITextAdapter } from "@ckeditor/ckeditor5-ai"; import { CKBox } from "@ckeditor/ckeditor5-ckbox"; import { CloudServices } from "@ckeditor/ckeditor5-cloud-services"; import type { EditorConfig } from "@ckeditor/ckeditor5-core"; import { Essentials } from "@ckeditor/ckeditor5-essentials"; import { Heading } from "@ckeditor/ckeditor5-heading"; import { Image, ImageCaption, ImageStyle, ImageToolbar, ImageUpload, PictureEditing, } from "@ckeditor/ckeditor5-image"; import { Indent } from "@ckeditor/ckeditor5-indent"; import { AutoLink, Link } from "@ckeditor/ckeditor5-link"; import { List } from "@ckeditor/ckeditor5-list"; import { MediaEmbed } from "@ckeditor/ckeditor5-media-embed"; import { Paragraph } from "@ckeditor/ckeditor5-paragraph"; import { PasteFromOffice } from "@ckeditor/ckeditor5-paste-from-office"; import { Table, TableToolbar } from "@ckeditor/ckeditor5-table"; import { TextTransformation } from "@ckeditor/ckeditor5-typing"; import { Undo } from "@ckeditor/ckeditor5-undo";

// You can read more about extending the build with additional plugins in the "Installing plugins" guide. // See https://ckeditor.com/docs/ckeditor5/latest/installation/plugins/installing-plugins.html for details.

class Editor extends ClassicEditor { public static override builtinPlugins = [ AIAssistant, OpenAITextAdapter, AutoLink, Autoformat, BlockQuote, Bold, CKBox, CloudServices, Essentials, Heading, Image, ImageCaption, ImageStyle, ImageToolbar, ImageUpload, Indent, Italic, Link, List, MediaEmbed, Paragraph, PasteFromOffice, PictureEditing, Table, TableToolbar, TextTransformation, Undo, ];

public static override defaultConfig: EditorConfig = { toolbar: { items: [ "heading", "|", "bold", "italic", "link", "bulletedList", "numberedList", "|", "outdent", "indent", "|", "imageUpload", "blockQuote", "insertTable", "mediaEmbed", "undo", "redo", "ckbox", "aiAssistant", "aiCommands", ], }, language: "ro", image: { toolbar: [ "imageTextAlternative", "toggleImageCaption", "imageStyle:inline", "imageStyle:block", "imageStyle:side", ], }, table: { contentToolbar: ["tableColumn", "tableRow", "mergeTableCells"], }, }; }

export default Editor; `

You can see that I have added the OpenAITextAdapter, but it is still not working