snowby666 / poe-api-wrapper

👾 A Python API wrapper for Poe.com. With this, you will have free access to GPT-4, Claude, Llama, Gemini, Mistral and more! 🚀
https://pypi.org/project/poe-api-wrapper/
GNU General Public License v3.0
707 stars 83 forks source link

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

Open PJovy opened 2 weeks ago

PJovy commented 2 weeks ago

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 commented 2 weeks ago

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