Skip to content

Commit

Permalink
Merge pull request #3848 from wststone/feat/add-ai-options
Browse files Browse the repository at this point in the history
feat: add options to for in ai submit options to allow sending other …
  • Loading branch information
zbeyens authored Dec 10, 2024
2 parents 802f27f + a1ad4ab commit 1fdca0b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/light-dolphins-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@udecode/plate-ai": patch
---

`submitAIChat`: add `ChatRequestOptions` options
5 changes: 5 additions & 0 deletions packages/ai/src/react/ai-chat/utils/submitAIChat.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { ChatRequestOptions } from 'ai';

import { type PlateEditor, getEditorPlugin } from '@udecode/plate-common/react';
import { isSelecting } from '@udecode/plate-selection';

Expand All @@ -10,10 +12,12 @@ export const submitAIChat = (
editor: PlateEditor,
{
mode,
options,
prompt,
system,
}: {
mode?: 'chat' | 'insert';
options?: ChatRequestOptions;
prompt?: EditorPrompt;
system?: EditorPrompt;
} = {}
Expand Down Expand Up @@ -60,6 +64,7 @@ export const submitAIChat = (
promptTemplate: systemTemplate,
}),
},
...options,
}
);
};

0 comments on commit 1fdca0b

Please sign in to comment.