Former-commit-id: 9598b19dbd1aad7c65965cac81104de0f164f942
pull/160/head
Kye 2 years ago
parent bdd2cf4a8a
commit e709cbc9fc

@ -1,5 +1,6 @@
"""OpenAI chat wrapper.""" """OpenAI chat wrapper."""
from __future__ import annotations from __future__ import annotations
from abc import abstractmethod
import os import os
import logging import logging
@ -123,7 +124,7 @@ class ModelNotFoundException(Exception):
) )
class ChatOpenAI(BaseChatModel): class ChatOpenAI(BaseChatModel, BaseModel):
"""Wrapper around OpenAI Chat large language models. """Wrapper around OpenAI Chat large language models.
To use, you should have the ``openai`` python package installed, and the To use, you should have the ``openai`` python package installed, and the
@ -159,6 +160,13 @@ class ChatOpenAI(BaseChatModel):
extra = Extra.ignore extra = Extra.ignore
@abstractmethod
@property
def _llm_type(self) -> str:
# Return a string indicating the type of this language model
return 'ChatOpenAI'
def check_access(self) -> None: def check_access(self) -> None:
"""Check that the user has access to the model.""" """Check that the user has access to the model."""

Loading…
Cancel
Save