diff --git a/.changeset/light-dolphins-nail.md b/.changeset/light-dolphins-nail.md new file mode 100644 index 0000000000..9b35736b14 --- /dev/null +++ b/.changeset/light-dolphins-nail.md @@ -0,0 +1,5 @@ +--- +"@udecode/plate-ai": patch +--- + +`submitAIChat`: add `ChatRequestOptions` options diff --git a/packages/ai/src/react/ai-chat/utils/submitAIChat.ts b/packages/ai/src/react/ai-chat/utils/submitAIChat.ts index cabf707d5a..2cca51570d 100644 --- a/packages/ai/src/react/ai-chat/utils/submitAIChat.ts +++ b/packages/ai/src/react/ai-chat/utils/submitAIChat.ts @@ -1,3 +1,5 @@ +import type { ChatRequestOptions } from 'ai'; + import { type PlateEditor, getEditorPlugin } from '@udecode/plate-common/react'; import { isSelecting } from '@udecode/plate-selection'; @@ -10,10 +12,12 @@ export const submitAIChat = ( editor: PlateEditor, { mode, + options, prompt, system, }: { mode?: 'chat' | 'insert'; + options?: ChatRequestOptions; prompt?: EditorPrompt; system?: EditorPrompt; } = {} @@ -60,6 +64,7 @@ export const submitAIChat = ( promptTemplate: systemTemplate, }), }, + ...options, } ); };