mirror of
https://github.com/kennethreitz/langchain.git
synced 2026-06-05 23:00:18 +00:00
GPT-4 support (#1778)
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user