Fix OpenAI LLM docstring (#2910)

fix_agent_callbacks
dev2049 1 year ago committed by GitHub
parent 30573b2e30
commit 634358db5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -114,20 +114,7 @@ async def acompletion_with_retry(
class BaseOpenAI(BaseLLM):
"""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")
"""
"""Wrapper around OpenAI large language models."""
client: Any #: :meta private:
model_name: str = "text-davinci-003"
@ -541,7 +528,20 @@ class BaseOpenAI(BaseLLM):
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
def _invocation_params(self) -> Dict[str, Any]:
@ -549,7 +549,20 @@ class OpenAI(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 to use."""

Loading…
Cancel
Save