mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-02 01:23:07 +00:00
GPT-4 support (#1778)
This commit is contained in:
parent
3d6fcb85dc
commit
3161ced4bc
@ -163,7 +163,8 @@ class BaseOpenAI(BaseLLM, BaseModel):
|
|||||||
|
|
||||||
def __new__(cls, **data: Any) -> Union[OpenAIChat, BaseOpenAI]: # type: ignore
|
def __new__(cls, **data: Any) -> Union[OpenAIChat, BaseOpenAI]: # type: ignore
|
||||||
"""Initialize the OpenAI object."""
|
"""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 OpenAIChat(**data)
|
||||||
return super().__new__(cls)
|
return super().__new__(cls)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user