|
|
@ -196,7 +196,9 @@ class BaseOpenAI(BaseLLM):
|
|
|
|
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."""
|
|
|
|
model_name = data.get("model_name", "")
|
|
|
|
model_name = data.get("model_name", "")
|
|
|
|
if model_name.startswith("gpt-3.5-turbo") or model_name.startswith("gpt-4"):
|
|
|
|
if (
|
|
|
|
|
|
|
|
model_name.startswith("gpt-3.5-turbo") or model_name.startswith("gpt-4")
|
|
|
|
|
|
|
|
) and not model_name.endswith("-instruct"):
|
|
|
|
warnings.warn(
|
|
|
|
warnings.warn(
|
|
|
|
"You are trying to use a chat model. This way of initializing it is "
|
|
|
|
"You are trying to use a chat model. This way of initializing it is "
|
|
|
|
"no longer supported. Instead, please use: "
|
|
|
|
"no longer supported. Instead, please use: "
|
|
|
|