feat: fix copilotkit

This commit is contained in:
Nevo David 2025-04-26 19:48:32 +07:00
parent 97f0ff0a66
commit a0d0466944
3 changed files with 15 additions and 13 deletions

View File

@ -536,7 +536,14 @@ export const AddEditModal: FC<{
title: 'AI Content Assistant',
}}
className="!z-[499]"
instructions="You are an assistant that help the user to schedule their social media posts, everytime somebody write something, try to use a function call, if not prompt the user that the request is invalid and you are here to assists with social media posts"
instructions={`
You are an assistant that help the user to schedule their social media posts,
Here are the things you can do:
- Add a new comment / post to the list of posts
- Delete a comment / post from the list of posts
- Add content to the comment / post
- Activate or deactivate the comment / post
`}
/>
)}
<div
@ -651,15 +658,6 @@ export const AddEditModal: FC<{
<Editor
order={index}
height={value.length > 1 ? 150 : 250}
commands={
[
// ...commands
// .getCommands()
// .filter((f) => f.name === 'image'),
// newImage,
// postSelector(dateState),
]
}
value={p.content}
preview="edit"
onPaste={pasteImages(index, p.image || [])}

View File

@ -9,7 +9,7 @@ export const AddPostButton: FC<{ onClick: () => void; num: number }> = (
useCopilotAction({
name: 'addPost_' + num,
description: 'Add a post after the post number ' + (num + 1),
description: 'Add a post after the post number ' + num,
handler: () => {
onClick();
},

View File

@ -32,12 +32,16 @@ export const Editor = forwardRef<
useCopilotReadable({
description: 'Content of the post number ' + (props.order + 1),
value: props.value,
value: JSON.stringify({
content: props.value,
order: props.order,
allowAddContent: props?.value?.length === 0,
})
});
useCopilotAction({
name: 'editPost_' + props.order,
description: `Edit the content of post number ${props.order + 1}`,
description: `Edit the content of post number ${props.order}`,
parameters: [
{
name: 'content',