-
-
Notifications
You must be signed in to change notification settings - Fork 641
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
chore: Include types to instructor.distil and tests #396
Conversation
b722827
to
2625661
Compare
msg = f"Return type hint for {fn} must subclass `pydantic.BaseModel'" | ||
assert is_return_type_base_model_or_instance(fn), msg | ||
return_base_model = inspect.signature(fn).return_annotation | ||
|
||
@functools.wraps(fn) | ||
def _dispatch(*args, **kwargs): | ||
def _dispatch(*args: Any, **kwargs: Any) -> Callable[..., T_Retval]: | ||
name = name if name else fn.__name__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note change here to include name when null, since openai_kwargs
requires non-null name. Alternative would be to set assert name is not None
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Something look wrong? You can customize Ellipsis by editing the ellipsis.yaml for this repository.
Generated with ❤️ by ellipsis.dev
e154310
to
0328afd
Compare
c56d1af
to
40078f6
Compare
5ba62e9
to
47c9fd7
Compare
47c9fd7
to
91d8b4d
Compare
Don't worry about the Docs one. Is this good to merge? |
@jxnl OK will do, just puzzled why It's good to merge. |
This PR adds types to the following files, as per #390.
Summary:
This PR enhances type safety by adding type hints to the
instructor.distil
module and its corresponding tests, and updates themypy.yml
workflow to include these files.Key points:
instructor.distil
module and its corresponding tests.mypy.yml
workflow file to include type checking forinstructor/distil.py
andtests/test_distil.py
.Generated with ❤️ by ellipsis.dev