Python 3.9 compatibility.

This commit is contained in:
Oleksandr Kozachuk 2023-08-16 12:24:03 +02:00
parent e8343fde01
commit 380b7c1b67

View File

@ -1,5 +1,5 @@
import pathlib
from typing import TypedDict, Any
from typing import TypedDict, Any, Union
class OpenAIConfig(TypedDict):
@ -15,7 +15,7 @@ class OpenAIConfig(TypedDict):
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
and contains valid types and values.