[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

community[patch]: update oai deprecation message #15681

Merged
merged 3 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fmt
  • Loading branch information
baskaryan committed Jan 9, 2024
commit e37924e9c9d860c7137319587c7c24684f4799f2
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@


@deprecated(
since="0.1.0",
since="0.0.10",
removal="0.2.0",
message=(
"The class langchain_community.chat_models.azure_openai.AzureChatOpenAI was "
"deprecated in langchain-community 0.1.0 and will be removed in "
"deprecated in langchain-community 0.0.10 and will be removed in "
"langchain-community 0.2.0. An updated version of the class lives in the "
"langchain-openai package and should be used instead. To use it run "
"`pip install -U langchain-openai` and import as "
Expand Down
13 changes: 12 additions & 1 deletion libs/community/langchain_community/chat_models/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,18 @@ def _convert_delta_to_message_chunk(
return default_class(content=content)


@deprecated(since="0.1.0", removal="0.2.0", alternative="langchain_openai.ChatOpenAI")
@deprecated(
since="0.0.10",
removal="0.2.0",
message=(
"The class langchain_community.chat_models.openai.ChatOpenAI was "
"deprecated in langchain-community 0.0.10 and will be removed in "
"langchain-community 0.2.0. An updated version of the class lives in the "
"langchain-openai package and should be used instead. To use it run "
"`pip install -U langchain-openai` and import as "
"`from langchain_openai import ChatOpenAI`."
),
)
class ChatOpenAI(BaseChatModel):
"""`OpenAI` Chat large language models API.

Expand Down
39 changes: 36 additions & 3 deletions libs/community/langchain_community/llms/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,18 @@ def max_tokens_for_prompt(self, prompt: str) -> int:
return self.max_context_size - num_tokens


@deprecated(since="0.1.0", removal="0.2.0", alternative="langchain_openai.OpenAI")
@deprecated(
since="0.0.10",
removal="0.2.0",
message=(
"The class langchain_community.llms.openai.OpenAI was "
"deprecated in langchain-community 0.0.10 and will be removed in "
"langchain-community 0.2.0. An updated version of the class lives in the "
"langchain-openai package and should be used instead. To use it run "
"`pip install -U langchain-openai` and import as "
"`from langchain_openai import OpenAI`."
),
)
class OpenAI(BaseOpenAI):
"""OpenAI large language models.

Expand All @@ -752,7 +763,18 @@ def _invocation_params(self) -> Dict[str, Any]:
return {**{"model": self.model_name}, **super()._invocation_params}


@deprecated(since="0.1.0", removal="0.2.0", alternative="langchain_openai.AzureOpenAI")
@deprecated(
since="0.0.10",
removal="0.2.0",
message=(
"The class langchain_community.llms.openai.AzureOpenAI was "
"deprecated in langchain-community 0.0.10 and will be removed in "
"langchain-community 0.2.0. An updated version of the class lives in the "
"langchain-openai package and should be used instead. To use it run "
"`pip install -U langchain-openai` and import as "
"`from langchain_openai import AzureOpenAI`."
),
)
class AzureOpenAI(BaseOpenAI):
"""Azure-specific OpenAI large language models.

Expand Down Expand Up @@ -956,7 +978,18 @@ def lc_attributes(self) -> Dict[str, Any]:
}


@deprecated(since="0.1.0", removal="0.2.0", alternative="langchain_openai.ChatOpenAI")
@deprecated(
since="0.0.1",
removal="0.2.0",
message=(
"The class langchain_community.llms.openai.OpenAIChat was "
"deprecated in langchain-community 0.0.1 and will be removed in "
"langchain-community 0.2.0. An updated version of the class lives in the "
"langchain-openai package and should be used instead. To use it run "
"`pip install -U langchain-openai` and import as "
"`from langchain_openai import ChatOpenAI`."
),
)
class OpenAIChat(BaseLLM):
"""OpenAI Chat large language models.

Expand Down
Loading