langchain/libs/community/langchain_community/utils/openai.py
Leonid Ganeline b2fd41331e
docs: docstrings langchain_community update (#14889)
Addded missed docstrings. Fixed inconsistency in docstrings.

**Note** CC @efriis 
There were PR errors on
`langchain_experimental/prompt_injection_identifier/hugging_face_identifier.py`
But, I didn't touch this file in this PR! Can it be some cache problems?
I fixed this error.
2023-12-19 08:58:24 -05:00

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