Skip to content

Commit

Permalink
feat: try to add for prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Sep 23, 2024
1 parent 830847c commit 94e9e24
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions web/core/lib/editor/extensions/advice/advice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export interface Advice {
}

export const newAdvice = (content: string): Advice => {
if (typeof content !== "string") {
console.log("content is: typeof content", typeof content);
}

return {
id: `a${v4()}a`,
content,
Expand Down
6 changes: 3 additions & 3 deletions web/core/lib/editor/menu/menu-bubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const MenuBubble = ({ editor }: {
setIsOpen(false);
setLoading(true);

const text = editor.commands?.callLlm(menu);
const text = await editor.commands?.callLlm(menu)
setLoading(false);

const newComment = newAdvice(text || '');
Expand All @@ -93,10 +93,10 @@ export const MenuBubble = ({ editor }: {
return <li key={index}>
<Button
className="dropdown-item w-full"
onClick={(event) => {
onClick={async (event) => {
event.preventDefault();
setIsOpen(false);
editor.chain().callLlm(menu);
await editor.chain().callLlm(menu);
editor.view?.focus();
}}
>
Expand Down
2 changes: 1 addition & 1 deletion web/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@studio-b3/web-core",
"version": "0.2.10",
"version": "0.2.11",
"type": "module",
"main": "dist/main.js",
"types": "dist-types/main.d.ts",
Expand Down

0 comments on commit 94e9e24

Please sign in to comment.