Fix OpenAI LLM docstring (#2910)

This commit is contained in:
dev2049 2023-04-14 11:09:36 -07:00 committed by GitHub
parent 30573b2e30
commit 634358db5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,20 +114,7 @@ async def acompletion_with_retry(
class BaseOpenAI(BaseLLM): class BaseOpenAI(BaseLLM):
"""Wrapper around OpenAI large language models. """Wrapper around OpenAI large language models."""
To use, you should have the ``openai`` python package installed, and the
environment variable ``OPENAI_API_KEY`` set with your API key.
Any parameters that are valid to be passed to the openai.create call can be passed
in, even if not explicitly saved on this class.
Example:
.. code-block:: python
from langchain.llms import OpenAI
openai = OpenAI(model_name="text-davinci-003")
"""
client: Any #: :meta private: client: Any #: :meta private:
model_name: str = "text-davinci-003" model_name: str = "text-davinci-003"
@ -541,7 +528,20 @@ class BaseOpenAI(BaseLLM):
class OpenAI(BaseOpenAI): class OpenAI(BaseOpenAI):
"""Generic OpenAI class that uses model name.""" """Wrapper around OpenAI large language models.
To use, you should have the ``openai`` python package installed, and the
environment variable ``OPENAI_API_KEY`` set with your API key.
Any parameters that are valid to be passed to the openai.create call can be passed
in, even if not explicitly saved on this class.
Example:
.. code-block:: python
from langchain.llms import OpenAI
openai = OpenAI(model_name="text-davinci-003")
"""
@property @property
def _invocation_params(self) -> Dict[str, Any]: def _invocation_params(self) -> Dict[str, Any]:
@ -549,7 +549,20 @@ class OpenAI(BaseOpenAI):
class AzureOpenAI(BaseOpenAI): class AzureOpenAI(BaseOpenAI):
"""Azure specific OpenAI class that uses deployment name.""" """Wrapper around Azure-specific OpenAI large language models.
To use, you should have the ``openai`` python package installed, and the
environment variable ``OPENAI_API_KEY`` set with your API key.
Any parameters that are valid to be passed to the openai.create call can be passed
in, even if not explicitly saved on this class.
Example:
.. code-block:: python
from langchain.llms import AzureOpenAI
openai = AzureOpenAI(model_name="text-davinci-003")
"""
deployment_name: str = "" deployment_name: str = ""
"""Deployment name to use.""" """Deployment name to use."""