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

Iterable Workaround #737

Merged
merged 10 commits into from
Jun 11, 2024
Merged

Iterable Workaround #737

merged 10 commits into from
Jun 11, 2024

Conversation

ivanleomk
Copy link
Collaborator

This helps solve issue #668 which highlighted an issue with how we're handling Iterables in Python 3.9. There's a bunch of new tests and a new wrapper function which checks the system python version before running the iterable check.

Copy link

cloudflare-workers-and-pages bot commented Jun 9, 2024

Deploying instructor with  Cloudflare Pages  Cloudflare Pages

Latest commit: 43a47a7
Status:⚡️  Build in progress...

View logs

import typing


class SimpleTypeTests(unittest.TestCase):
Copy link
Owner

Choose a reason for hiding this comment

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

don't use unitests

@@ -31,14 +31,27 @@ def __class_getitem__(cls, response_model: type[BaseModel]) -> type[BaseModel]:
)


def validateIsSubClass(response_model: type):
Copy link
Owner

Choose a reason for hiding this comment

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

snake case

@@ -54,6 +54,7 @@ def ask_ai(content, model, client) -> DocumentExtraction:
"content": content,
},
],
max_retries=4,
Copy link
Owner

Choose a reason for hiding this comment

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

doubt 4 is the answer...

@jxnl jxnl merged commit b53afab into main Jun 11, 2024
4 of 13 checks passed
@jxnl jxnl deleted the fix-iterable-error branch June 11, 2024 17:41
bllchmbrs pushed a commit to bllchmbrs/instructor that referenced this pull request Jun 14, 2024
Co-authored-by: Jason Liu <jxnl@users.noreply.github.com>
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