Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions modules/ROOT/pages/8.9.0-release-notes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,23 @@ The {productname} {release-version} release includes an accompanying release of

For information on the **<Premium plugin name 1>** plugin, see: xref:<plugincode>.adoc[<Premium plugin name 1>].

=== TinyMCE AI

The {productname} {release-version} release includes an accompanying release of the **TinyMCE AI** premium plugin.

**TinyMCE AI** includes the following addition.

==== New option `tinymceai_chat_default_sources` to allow specifying predefined sources as chat default context.
// #TINYMCE-14703

Previously, the **TinyMCE AI** plugin applied only the current document to the context of a new AI Chat conversation. Users had to add every other context source, such as a style guide or a reference document, to each new conversation by hand.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Previously, the **TinyMCE AI** plugin applied only the current document to the context of a new AI Chat conversation. Users had to add every other context source, such as a style guide or a reference document, to each new conversation by hand.
Previously, the **TinyMCE AI** plugin applied only the current document to the context of a new AI Chat conversation. Users had to manually add every other context source, such as a style guide or a reference document, to each new conversation.


In {productname} {release-version}, the **TinyMCE AI** plugin supports the xref:tinymceai.adoc#tinymceai_chat_default_sources[`+tinymceai_chat_default_sources+`] option. The option accepts an array of source identifiers taken from the list supplied by xref:tinymceai.adoc#tinymceai_chat_fetch_sources[`+tinymceai_chat_fetch_sources+`], and the plugin applies those sources to the context of every new conversation. Users can remove a default source from a conversation and add it again from the sources menu.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In {productname} {release-version}, the **TinyMCE AI** plugin supports the xref:tinymceai.adoc#tinymceai_chat_default_sources[`+tinymceai_chat_default_sources+`] option. The option accepts an array of source identifiers taken from the list supplied by xref:tinymceai.adoc#tinymceai_chat_fetch_sources[`+tinymceai_chat_fetch_sources+`], and the plugin applies those sources to the context of every new conversation. Users can remove a default source from a conversation and add it again from the sources menu.
In {productname} {release-version}, the **TinyMCE AI** plugin supports the xref:tinymceai.adoc#tinymceai_chat_default_sources[`+tinymceai_chat_default_sources+`] option. The option accepts an array of source identifiers from xref:tinymceai.adoc#tinymceai_chat_fetch_sources[`+tinymceai_chat_fetch_sources+`], and the plugin applies those sources to the context of every new conversation. A default source can be removed or added again from the sources menu.


For details on configuring conversation context, see xref:tinymceai-chat.adoc#context-configuration[Adding custom context sources].

For information on the **TinyMCE AI** plugin, see: xref:tinymceai.adoc[TinyMCE AI].


[[accompanying-premium-plugin-end-of-life-announcement]]
== Accompanying Premium plugin end-of-life announcement
Expand Down
2 changes: 2 additions & 0 deletions modules/ROOT/pages/tinymceai-chat.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ To add custom external sources for users to select from, configure:

Full schemas, return types, and examples are documented under xref:tinymceai.adoc#tinymceai_chat_fetch_sources[Chat configuration options].

To apply a custom source to every new conversation without requiring users to select it, list its ID in xref:tinymceai.adoc#tinymceai_chat_default_sources[`tinymceai_chat_default_sources`].

[source,js]
----
tinymce.init({
Expand Down
1 change: 1 addition & 0 deletions modules/ROOT/pages/tinymceai.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ tinymce.init({
const filename = `\$\{id\}.pdf`;
return { type: 'file', file: new File([blob], filename, { type: blob.type }) };
},
tinymceai_chat_default_sources: [ 'doc-1' ],
tinymceai_quickactions_custom: [
{ title: 'Explain like I am five', prompt: 'Explain the following text in simple terms.', type: 'chat' }
]
Expand Down
44 changes: 44 additions & 0 deletions modules/ROOT/partials/configuration/tinymceai_options.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,50 @@ tinymce.init({
});
----

[[tinymceai_chat_default_sources]]
=== `+tinymceai_chat_default_sources+`

Adds one or more sources to the context of every new chat conversation, alongside the current document. Without this option, users add each source to a conversation themselves.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Adds one or more sources to the context of every new chat conversation, alongside the current document. Without this option, users add each source to a conversation themselves.
Adds one or more predefined sources as the default context to a chat conversation, alongside the current document. The sources can be removed or re-added from the sources menu.


Takes an array of source identifiers. Each identifier is the `+id+` of a source supplied by xref:tinymceai.adoc#tinymceai_chat_fetch_sources[`tinymceai_chat_fetch_sources`], and the content of each source is loaded through xref:tinymceai.adoc#tinymceai_chat_fetch_source[`tinymceai_chat_fetch_source`]. Identifiers that do not match a supplied source are ignored.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Takes an array of source identifiers. Each identifier is the `+id+` of a source supplied by xref:tinymceai.adoc#tinymceai_chat_fetch_sources[`tinymceai_chat_fetch_sources`], and the content of each source is loaded through xref:tinymceai.adoc#tinymceai_chat_fetch_source[`tinymceai_chat_fetch_source`]. Identifiers that do not match a supplied source are ignored.
Takes an array of source identifiers. Each identifier is the `+id+` of a source predefined in xref:tinymceai.adoc#tinymceai_chat_fetch_sources[`tinymceai_chat_fetch_sources`], and the content of each source is loaded through xref:tinymceai.adoc#tinymceai_chat_fetch_source[`tinymceai_chat_fetch_source`]. A invalid identified is will be ignored.


Users can remove a default source from a conversation and add it again from the sources menu.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Users can remove a default source from a conversation and add it again from the sources menu.


*Type:* `+Array+` (`+string[]+`)

*Default value:* `+[]+`

.Example
[source,js]
----
tinymce.init({
selector: 'textarea',
plugins: 'tinymceai',
toolbar: 'tinymceai-chat tinymceai-quickactions tinymceai-review',
tinymceai_chat_fetch_sources: async () => [
{
label: 'My Documents',
icon: 'folder',
sources: [
{ id: 'doc-1', label: 'Style guide', type: 'file' },
{ id: 'doc-2', label: 'Document 2', type: 'file' }
]
}
],
tinymceai_chat_fetch_source: async (id) => {
const res = await fetch(`/api/documents/\$\{id\}`);
const blob = await res.blob();
const filename = `\$\{id\}.pdf`;
return { type: 'file', file: new File([blob], filename, { type: blob.type }) };
},
tinymceai_chat_default_sources: [ 'doc-1' ],
// Required for authentication
tinymceai_token_provider: () => {
return fetch('/api/token').then(r => r.json());
}
});
----

[[tinymceai_chat_welcome_message]]
=== `+tinymceai_chat_welcome_message+`

Expand Down
Loading