From e709cbc9fccc6f8016b288f315d51a63c5d6ee49 Mon Sep 17 00:00:00 2001 From: Kye Date: Thu, 13 Jul 2023 06:49:37 -0400 Subject: [PATCH] clean up Former-commit-id: 9598b19dbd1aad7c65965cac81104de0f164f942 --- swarms/agents/utils/ChatOpenAI.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/swarms/agents/utils/ChatOpenAI.py b/swarms/agents/utils/ChatOpenAI.py index 9be5d125..a51125a8 100644 --- a/swarms/agents/utils/ChatOpenAI.py +++ b/swarms/agents/utils/ChatOpenAI.py @@ -1,5 +1,6 @@ """OpenAI chat wrapper.""" from __future__ import annotations +from abc import abstractmethod import os import logging @@ -123,7 +124,7 @@ class ModelNotFoundException(Exception): ) -class ChatOpenAI(BaseChatModel): +class ChatOpenAI(BaseChatModel, BaseModel): """Wrapper around OpenAI Chat large language models. To use, you should have the ``openai`` python package installed, and the @@ -158,6 +159,13 @@ class ChatOpenAI(BaseChatModel): """Configuration for this pydantic object.""" 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: """Check that the user has access to the model."""