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

Improve error message for invalid prompt elements #102

Open
rebornix opened this issue Oct 11, 2024 · 0 comments
Open

Improve error message for invalid prompt elements #102

rebornix opened this issue Oct 11, 2024 · 0 comments

Comments

@rebornix
Copy link
Member

While crafting the prompt in tsx, sometimes I make mistakes with the element types (which are valid in tsx itself unfortunately), I got error message as

Invalid ChatMessage child! Child must be a TSX component that extends PromptElement

To troubleshoot this I would have to

  • Put try catch around renderPrompt and enable Caught/uncaught Exceptions
  • Traverse through the invalid element's ancestors to figure out which element it is

We could in the error message point to the problematic child (e.g. -> -> child #2)

@connor4312's suggestion can help a lot already.

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

No branches or pull requests

1 participant