CopilotKit / CopilotKit

React UI + elegant infrastructure for AI Copilots, in-app AI agents, AI chatbots, and AI-powered Textareas 🪁
https://copilotkit.ai
MIT License
12.89k stars 2.08k forks source link

🐛 Bug: Text suggestions in <CopilotTextarea> are wrapped with <TextAfterCursor> tags. #772

Open Sujan-Koirala021 opened 1 month ago

Sujan-Koirala021 commented 1 month ago

♻️ Reproduction Steps

Steps to Reproduce:

  1. Add the <CopilotTextarea> component with the following configuration:

    <CopilotTextarea 
        placeholder="Enter your email..." 
        autosuggestionsConfig={{
            textareaPurpose: "assist in writing email",
            chatApiConfigs: {
                suggestionsApiConfig: {
                    maxTokens: 200,
                    stop: ["\n", "!"],
                },
            },
        }} 
    />
  2. Start typing in the textarea.

  3. When a suggestion is provided, observe that the suggestion is wrapped in <TextAfterCursor> tags.

✅ Expected Behavior

The text suggestion should be added to the textarea seamlessly without any additional tags or wrappers.

❌ Actual Behavior

The suggestion appears in the textarea but is wrapped with tags, causing the output to look like this: Screenshot (101)

𝌚 CopilotKit Version

@copilotkit/react-core@1.3.2
@copilotkit/react-textarea@1.3.2
@copilotkit/react-ui@1.3.2
@copilotkit/runtime@1.3.2

📄 Logs (Optional)

No response

Ruffzi069 commented 1 month ago

Hi @Sujan-Koirala021 ! I would like to work on this issue. Could you please assign it to me? Hoping for a positive reply! Thank you!

prankurpandeyy commented 1 month ago

/assign

NathanTarbert commented 1 month ago

@Ruffzi069 and @prankurpandeyy, we are looking into this, but feel free to work on it.