mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-10 15:06:18 +00:00
Allow 3.5-turbo instruct models in the OpenAI LLM class (#10750)
@baskaryan @hwchase17
This commit is contained in:
parent
4c80978ec6
commit
579d14fbc1
@ -196,7 +196,9 @@ class BaseOpenAI(BaseLLM):
|
||||
def __new__(cls, **data: Any) -> Union[OpenAIChat, BaseOpenAI]: # type: ignore
|
||||
"""Initialize the OpenAI object."""
|
||||
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(
|
||||
"You are trying to use a chat model. This way of initializing it is "
|
||||
"no longer supported. Instead, please use: "
|
||||
|
Loading…
Reference in New Issue
Block a user