Better type annotations and stricter mypy checks (#3 ) #4

Merged
ok merged 6 commits from mypy_fixes into main 2023-08-16 13:01:27 +02:00
Showing only changes of commit 380b7c1b67 - Show all commits

View File

@ -1,5 +1,5 @@
import pathlib import pathlib
from typing import TypedDict, Any from typing import TypedDict, Any, Union
class OpenAIConfig(TypedDict): class OpenAIConfig(TypedDict):
@ -15,7 +15,7 @@ class OpenAIConfig(TypedDict):
presence_penalty: float presence_penalty: float
def openai_config_valid(conf: dict[str, str | float | int]) -> bool: def openai_config_valid(conf: dict[str, Union[str, float, int]]) -> bool:
""" """
Checks if the given Open AI configuration dict is complete Checks if the given Open AI configuration dict is complete
and contains valid types and values. and contains valid types and values.