Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CopilotForm prototype #285

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

CopilotForm prototype #285

wants to merge 6 commits into from

Conversation

mme
Copy link
Collaborator

@mme mme commented Mar 26, 2024

This is a prototype how a CopilotForm component could look like. It's implemented with actions and readables under the hood.

<CopilotForm
  name="recipe"
  description="Form to fill for a recipe"
  className="flex flex-col"
>
  <CopilotInput name="dish" placeholder="dish" />
  <CopilotInput name="ingredients" placeholder="ingredients" />
</CopilotForm>

A real-world form should:

  • have different types for different types of inputs (enums, bool, number etc)
    • now supports radio, checkbox, all text inputs
    • needs select, radio group
  • support external components (shadcn, radix ui, etc.)
  • be filled out while streaming?
  • be able to submit by itself?
  • have a handler that is called when the form gets submitted
  • play well with other libraries (react hook form, zod etc)
  • let the user manage the form values themselves?
  • support repeating elements
  • Optional works different from useCopilotAction
    • when required is false, it can be left out, even if the current value is empty
    • when required is true, it cannot be left out, unless the current value is empty
    • default is required

Slightly crazy ideas:

  • have "magic" button to autocomplete selected fields
  • have "magic" button to autocomplete the whole form
  • complete the whole form like CopilotTextarea (get suggestions and hit Tab key)
  • Form Verification: Let GPT verify the contents of a form and provide suggestions to improve it

@mme mme requested a review from ataibarkai March 26, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant