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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harrison/datetime parser #4693

Merged
merged 5 commits into from
May 29, 2023
Merged

Harrison/datetime parser #4693

merged 5 commits into from
May 29, 2023

Conversation

hwchase17
Copy link
Contributor

No description provided.

JacobFV and others added 4 commits May 14, 2023 16:06
feature: #4255

Note: Still need to add tests

---------

Co-authored-by: Jacob Valdez <jacob.valdez@limboid.ai>
Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>

def get_format_instructions(self) -> str:
examples = comma_list(_generate_random_datetime_strings(self.format))
return f"""Write a datetime string that matches the
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder whether it makes sense to ask for an ISO-8601 format. No idea what llms handle :)

from langchain.utils import comma_list


def _generate_random_datetime_strings(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this not a hard-coded pattern or at least using a seed?

tests/unit_tests/output_parsers/test_datetime_parser.py Outdated Show resolved Hide resolved

# Test invalid input
try:
sleep(0.001)
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should use freeze gun here, should avoid sleep in tests at all costs

Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
@hwchase17 hwchase17 merged commit 2da8c48 into master May 29, 2023
13 checks passed
@hwchase17 hwchase17 deleted the harrison/datetime-parser branch May 29, 2023 14:52
vowelparrot pushed a commit that referenced this pull request May 31, 2023
Co-authored-by: Jacob Valdez <jacobfv@msn.com>
Co-authored-by: Jacob Valdez <jacob.valdez@limboid.ai>
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
@danielchalef danielchalef mentioned this pull request Jun 5, 2023
Undertone0809 pushed a commit to Undertone0809/langchain that referenced this pull request Jun 19, 2023
Co-authored-by: Jacob Valdez <jacobfv@msn.com>
Co-authored-by: Jacob Valdez <jacob.valdez@limboid.ai>
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
This was referenced Jun 25, 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.

None yet

4 participants