Skip to content

Commit 1fdca0b

Browse files
authored
Merge pull request #3848 from wststone/feat/add-ai-options
feat: add options to for in ai submit options to allow sending other …
2 parents 802f27f + a1ad4ab commit 1fdca0b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.changeset/light-dolphins-nail.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@udecode/plate-ai": patch
3+
---
4+
5+
`submitAIChat`: add `ChatRequestOptions` options

packages/ai/src/react/ai-chat/utils/submitAIChat.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { ChatRequestOptions } from 'ai';
2+
13
import { type PlateEditor, getEditorPlugin } from '@udecode/plate-common/react';
24
import { isSelecting } from '@udecode/plate-selection';
35

@@ -10,10 +12,12 @@ export const submitAIChat = (
1012
editor: PlateEditor,
1113
{
1214
mode,
15+
options,
1316
prompt,
1417
system,
1518
}: {
1619
mode?: 'chat' | 'insert';
20+
options?: ChatRequestOptions;
1721
prompt?: EditorPrompt;
1822
system?: EditorPrompt;
1923
} = {}
@@ -60,6 +64,7 @@ export const submitAIChat = (
6064
promptTemplate: systemTemplate,
6165
}),
6266
},
67+
...options,
6368
}
6469
);
6570
};

0 commit comments

Comments
 (0)