You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add type hints to the codebase. This includes adding a py.typed file (as per PEP 561) to enable type checkers to use aisuite's type information effectively.
Why is this needed?
Improves code readability and maintainability by explicitly defining function signatures and variable types.
Enables mypy, pyright, and other type checkers to utilize aisuite's type information when users check their code.
Provides completion suggestions for users of pylance or pyright.
Proposed Solution
Add Type Hints:
Review all functions, methods, and variables in the codebase and annotate them with appropriate type hints.
Add py.typed File:
Include a py.typed file in the package to mark it as PEP 561-compatible.
Integrate mypy:
Add mypy as a development dependency in the project.
Configure a mypy.ini file or equivalent to define type-checking rules.
This is not an easy task - you need to unify all the types returned by the different providers. For example what should be the return type of 'client.chat.completions.create' call and in particular of the choices[0].message field of that object?
But it would be very very useful if we got these unified types - without that you never know what fields to expect and even if it is an object or just a dictionary.
Summary
Add type hints to the codebase. This includes adding a py.typed file (as per PEP 561) to enable type checkers to use
aisuite
's type information effectively.Why is this needed?
aisuite
's type information when users check their code.Proposed Solution
Add Type Hints:
Add py.typed File:
Integrate mypy:
Additional Context
The text was updated successfully, but these errors were encountered: