poe-api-wrapper icon indicating copy to clipboard operation
poe-api-wrapper copied to clipboard

refactor(typing): update type annotations to use typing module

Open PJovy opened this issue 1 year ago • 1 comments

Summary

Updated type annotations from Python 3.9 built-in syntax to use the typing module for better compatibility and consistency across the codebase.

Pull Request Description

This pull request updates the typing annotations throughout the poe_api_wrapper project to use List, Dict, and Tuple from the typing module instead of the built-in list, dict, and tuple from PEP 585. This change ensures compatibility with older versions of Python that do not support the new style introduced in PEP 585.

Changes include:

poe_api_wrapper/llm.py:

Imported Dict from typing.

Updated PoeServer class constructor to use Dict[str, str] for the tokens parameter. poe_api_wrapper/openai/api.py:

Imported Dict and Tuple from typing.

Updated function signatures and return types to use List, Dict, and Tuple from typing. poe_api_wrapper/openai/type.py:

Imported Dict from typing.

Updated ChatData class to use Dict[str, Any] for the stream_options attribute.

PJovy avatar Jul 05 '24 04:07 PJovy

@snowby666 I just updated the latest version of poe-api-wrapper and found that there is an issue about type hint usage. Please review.

PJovy avatar Jul 05 '24 04:07 PJovy