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

Fix RegexParser including double slashes in prompt #859

Merged

Conversation

jameshfisher
Copy link
Contributor

RegexParser was including the /regex/ slashes in its output, but those are already included when converting a RegExp to string. Therefore prompts looked like //0-9//, which is not a common regex notation. Models get confused and include literal // in their responses, which can be seen in the examples.

Fix: remove slashes from RegexParser output, and rely on those from converting RegExp to string.

Also included an example of how to use RegexParser.

Also re-ran examples and pasted output in comments.

RegexParser was including the /regex/ slashes in its output,
but those are already included when converting a RegExp to string.
Therefore prompts looked like //0-9//, which is not a common regex notation.
Models get confused and include literal // in their responses,
which can be seen in the examples.

Fix: remove slashes from RegexParser output, and rely on those from converting RegExp to string.

Also included an example of how to use RegexParser.

Also re-ran examples and pasted output in comments.
@vercel
Copy link

vercel bot commented Apr 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Apr 17, 2023 6:30pm

@nfcampos
Copy link
Collaborator

@jameshfisher Thanks!

@nfcampos nfcampos merged commit d8bd20f into langchain-ai:main Apr 18, 2023
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.

2 participants