You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs/community/langchain_community/utils/openai.py

12 lines
264 B
Python

from __future__ import annotations
from importlib.metadata import version
from packaging.version import parse
def is_openai_v1() -> bool:
"""Return whether OpenAI API is v1 or more."""
_version = parse(version("openai"))
return _version.major >= 1