GPT-4 support (#1778)

tool-patch
Nils Durner 1 year ago committed by GitHub
parent 3d6fcb85dc
commit 3161ced4bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -163,7 +163,8 @@ class BaseOpenAI(BaseLLM, BaseModel):
def __new__(cls, **data: Any) -> Union[OpenAIChat, BaseOpenAI]: # type: ignore
"""Initialize the OpenAI object."""
if data.get("model_name", "").startswith("gpt-3.5-turbo"):
model_name = data.get("model_name", "")
if model_name.startswith("gpt-3.5-turbo") or model_name.startswith("gpt-4"):
return OpenAIChat(**data)
return super().__new__(cls)

Loading…
Cancel
Save