openai/openai-python
Publicmirrored from https://github.com/openai/openai-pythonAvailable
src/openai/cli/_models.py
17lines · modecode
| 1 | from typing import Any |
| 2 | from typing_extensions import ClassVar |
| 3 | |
| 4 | import pydantic |
| 5 | |
| 6 | from .. import _models |
| 7 | from .._compat import PYDANTIC_V1, ConfigDict |
| 8 | |
| 9 | |
| 10 | class BaseModel(_models.BaseModel): |
| 11 | if PYDANTIC_V1: |
| 12 | |
| 13 | class Config(pydantic.BaseConfig): # type: ignore |
| 14 | extra: Any = pydantic.Extra.ignore # type: ignore |
| 15 | arbitrary_types_allowed: bool = True |
| 16 | else: |
| 17 | model_config: ClassVar[ConfigDict] = ConfigDict(extra="ignore", arbitrary_types_allowed=True) |