Код: Выделить всё
class Batch(BaseModel):
id: str
# ...
status: Literal[
"validating", "failed", "in_progress", "finalizing", "completed", "expired", "cancelling", "cancelled"
]
"""The current status of the batch."""
Код: Выделить всё
from typing import Optional, TypedDict
import openai
class FileStatus(TypedDict):
filename: str
sha256: str
file_id: Optional[str]
batch_id: Optional[str]
batch_status: Optional[openai.types.Batch.status]
# ~~~~~~
# Variable not allowed in type expression Pylance(reportInvalidTypeForm)
Подробнее здесь: https://stackoverflow.com/questions/789 ... ther-class