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

Add regex dict: #1616

Merged

Conversation

LuisLechugaRuiz
Copy link
Contributor

This class enables us to send a dictionary containing an output key and the expected format, which in turn allows us to retrieve the result of the matching formats and extract specific information from it.

To exclude irrelevant information from our return dictionary, we can prompt the LLM to use a specific command that notifies us when it doesn't know the answer. We refer to this variable as the "no_update_value".

Regarding the updated regular expression pattern (r"{}:\s?([^.'\n']*).?"), it enables us to retrieve a format as 'Output Key':'value'.

We have improved the regex by adding an optional space between ':' and 'value' with "s?", and by excluding points and line jumps from the matches using "[^.'\n']*".

@LuisLechugaRuiz LuisLechugaRuiz force-pushed the luis/add_parser_regex_dict branch 6 times, most recently from a88584b to fd66cef Compare March 13, 2023 00:52
This class allows us to send a dictionary containing an output key and the expected format,
which in turn enables us to retrieve the result of the matching formats and extract specific information from it.

To exclude irrelevant information from our return dictionary, we can instruct the LLM to
use a specific command that notifies us when it doesn't know the answer. We call this variable the "no_update_value"
Copy link
Contributor

@hwchase17 hwchase17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome

@hwchase17 hwchase17 merged commit 562d989 into langchain-ai:master Mar 14, 2023
@LuisLechugaRuiz LuisLechugaRuiz deleted the luis/add_parser_regex_dict branch March 16, 2023 21:48
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

2 participants