docs: Fix URL formatting in deprecation warnings (#23075)

**Description**

Updated the URLs in deprecation warning messages. The URLs were
previously written as raw strings and are now formatted to be clickable
HTML links.

Example of a broken link in the current API Reference:
https://api.python.langchain.com/en/latest/chains/langchain.chains.openai_functions.extraction.create_extraction_chain_pydantic.html

<img width="942" alt="Screenshot 2024-06-18 at 13 21 07"
src="https://github.com/langchain-ai/langchain/assets/4854600/a1b1863c-cd03-4af2-a9bc-70375407fb00">
This commit is contained in:
Artem Mukhin 2024-06-18 20:49:58 +02:00 committed by GitHub
parent c6660df58e
commit e271f75bee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 25 additions and 25 deletions

View File

@ -54,7 +54,7 @@ class ZapierToolkit(BaseToolkit):
since="0.0.319", since="0.0.319",
message=( message=(
"This tool will be deprecated on 2023-11-17. See " "This tool will be deprecated on 2023-11-17. See "
"https://nla.zapier.com/sunset/ for details" "<https://nla.zapier.com/sunset/> for details"
), ),
) )
return self.tools return self.tools

View File

@ -22,7 +22,7 @@ DEFAULT_CONNECTION_STRING = "postgresql://postgres:mypassword@localhost/chat_his
"You can swap to using the `PostgresChatMessageHistory`" "You can swap to using the `PostgresChatMessageHistory`"
" implementation in `langchain_postgres`. " " implementation in `langchain_postgres`. "
"Please do not submit further PRs to this class." "Please do not submit further PRs to this class."
"See https://github.com/langchain-ai/langchain-postgres" "See <https://github.com/langchain-ai/langchain-postgres>"
), ),
alternative="from langchain_postgres import PostgresChatMessageHistory;", alternative="from langchain_postgres import PostgresChatMessageHistory;",
pending=True, pending=True,

View File

@ -134,7 +134,7 @@ class ZapierNLARunAction(BaseTool):
since="0.0.319", since="0.0.319",
message=( message=(
"This tool will be deprecated on 2023-11-17. See " "This tool will be deprecated on 2023-11-17. See "
"https://nla.zapier.com/sunset/ for details" "<https://nla.zapier.com/sunset/> for details"
), ),
) )
return self.api_wrapper.run_as_str(self.action_id, instructions, self.params) return self.api_wrapper.run_as_str(self.action_id, instructions, self.params)
@ -149,7 +149,7 @@ class ZapierNLARunAction(BaseTool):
since="0.0.319", since="0.0.319",
message=( message=(
"This tool will be deprecated on 2023-11-17. See " "This tool will be deprecated on 2023-11-17. See "
"https://nla.zapier.com/sunset/ for details" "<https://nla.zapier.com/sunset/> for details"
), ),
) )
return await self.api_wrapper.arun_as_str( return await self.api_wrapper.arun_as_str(
@ -186,7 +186,7 @@ class ZapierNLAListActions(BaseTool):
since="0.0.319", since="0.0.319",
message=( message=(
"This tool will be deprecated on 2023-11-17. See " "This tool will be deprecated on 2023-11-17. See "
"https://nla.zapier.com/sunset/ for details" "<https://nla.zapier.com/sunset/> for details"
), ),
) )
return self.api_wrapper.list_as_str() return self.api_wrapper.list_as_str()
@ -201,7 +201,7 @@ class ZapierNLAListActions(BaseTool):
since="0.0.319", since="0.0.319",
message=( message=(
"This tool will be deprecated on 2023-11-17. See " "This tool will be deprecated on 2023-11-17. See "
"https://nla.zapier.com/sunset/ for details" "<https://nla.zapier.com/sunset/> for details"
), ),
) )
return await self.api_wrapper.alist_as_str() return await self.api_wrapper.alist_as_str()

View File

@ -218,7 +218,7 @@ def _results_to_docs(docs_and_scores: Any) -> List[Document]:
"Please read the guidelines in the doc-string of this class " "Please read the guidelines in the doc-string of this class "
"to follow prior to migrating as there are some differences " "to follow prior to migrating as there are some differences "
"between the implementations. " "between the implementations. "
"See https://github.com/langchain-ai/langchain-postgres for details about" "See <https://github.com/langchain-ai/langchain-postgres> for details about"
"the new implementation." "the new implementation."
), ),
alternative="from langchain_postgres import PGVector;", alternative="from langchain_postgres import PGVector;",

View File

@ -12,7 +12,7 @@ from langchain_core._api.deprecation import deprecated
message=( message=(
"Using the hwchase17/langchain-hub " "Using the hwchase17/langchain-hub "
"repo for prompts is deprecated. Please use " "repo for prompts is deprecated. Please use "
"https://smith.langchain.com/hub instead." "<https://smith.langchain.com/hub> instead."
), ),
) )
def try_load_from_hub( def try_load_from_hub(

View File

@ -101,7 +101,7 @@ def create_importer(
f">> from {new_module} import {name}\n" f">> from {new_module} import {name}\n"
"You can use the langchain cli to **automatically** " "You can use the langchain cli to **automatically** "
"upgrade many imports. Please see documentation here " "upgrade many imports. Please see documentation here "
"https://python.langchain.com/v0.2/docs/versions/v0_2/ " "<https://python.langchain.com/v0.2/docs/versions/v0_2/>"
), ),
) )
return result return result
@ -133,7 +133,7 @@ def create_importer(
f">> from {fallback_module} import {name}\n" f">> from {fallback_module} import {name}\n"
"You can use the langchain cli to **automatically** " "You can use the langchain cli to **automatically** "
"upgrade many imports. Please see documentation here " "upgrade many imports. Please see documentation here "
"https://python.langchain.com/v0.2/docs/versions/v0_2/ " "<https://python.langchain.com/v0.2/docs/versions/v0_2/>"
), ),
) )
return result return result

View File

@ -50,13 +50,13 @@ Passage:
"LangChain has introduced a method called `with_structured_output` that" "LangChain has introduced a method called `with_structured_output` that"
"is available on ChatModels capable of tool calling." "is available on ChatModels capable of tool calling."
"You can read more about the method here: " "You can read more about the method here: "
"https://python.langchain.com/docs/modules/model_io/chat/structured_output/" "<https://python.langchain.com/docs/modules/model_io/chat/structured_output/>. "
"Please follow our extraction use case documentation for more guidelines" "Please follow our extraction use case documentation for more guidelines"
"on how to do information extraction with LLMs." "on how to do information extraction with LLMs."
"https://python.langchain.com/docs/use_cases/extraction/." "<https://python.langchain.com/docs/use_cases/extraction/>. "
"If you notice other issues, please provide " "If you notice other issues, please provide "
"feedback here:" "feedback here:"
"https://github.com/langchain-ai/langchain/discussions/18154" "<https://github.com/langchain-ai/langchain/discussions/18154>"
), ),
removal="0.3.0", removal="0.3.0",
alternative=( alternative=(
@ -120,13 +120,13 @@ def create_extraction_chain(
"LangChain has introduced a method called `with_structured_output` that" "LangChain has introduced a method called `with_structured_output` that"
"is available on ChatModels capable of tool calling." "is available on ChatModels capable of tool calling."
"You can read more about the method here: " "You can read more about the method here: "
"https://python.langchain.com/docs/modules/model_io/chat/structured_output/" "<https://python.langchain.com/docs/modules/model_io/chat/structured_output/>. "
"Please follow our extraction use case documentation for more guidelines" "Please follow our extraction use case documentation for more guidelines"
"on how to do information extraction with LLMs." "on how to do information extraction with LLMs."
"https://python.langchain.com/docs/use_cases/extraction/." "<https://python.langchain.com/docs/use_cases/extraction/>. "
"If you notice other issues, please provide " "If you notice other issues, please provide "
"feedback here:" "feedback here:"
"https://github.com/langchain-ai/langchain/discussions/18154" "<https://github.com/langchain-ai/langchain/discussions/18154>"
), ),
removal="0.3.0", removal="0.3.0",
alternative=( alternative=(

View File

@ -20,14 +20,14 @@ If a property is not present and is not required in the function parameters, do
"LangChain has introduced a method called `with_structured_output` that" "LangChain has introduced a method called `with_structured_output` that"
"is available on ChatModels capable of tool calling." "is available on ChatModels capable of tool calling."
"You can read more about the method here: " "You can read more about the method here: "
"https://python.langchain.com/docs/modules/model_io/chat/structured_output/" "<https://python.langchain.com/docs/modules/model_io/chat/structured_output/>. "
"Please follow our extraction use case documentation for more guidelines" "Please follow our extraction use case documentation for more guidelines"
"on how to do information extraction with LLMs." "on how to do information extraction with LLMs."
"https://python.langchain.com/docs/use_cases/extraction/." "<https://python.langchain.com/docs/use_cases/extraction/>. "
"with_structured_output does not currently support a list of pydantic schemas. " "with_structured_output does not currently support a list of pydantic schemas. "
"If this is a blocker or if you notice other issues, please provide " "If this is a blocker or if you notice other issues, please provide "
"feedback here:" "feedback here:"
"https://github.com/langchain-ai/langchain/discussions/18154" "<https://github.com/langchain-ai/langchain/discussions/18154>"
), ),
removal="0.3.0", removal="0.3.0",
alternative=( alternative=(

View File

@ -32,13 +32,13 @@ from langchain_core.utils.function_calling import (
"LangChain has introduced a method called `with_structured_output` that " "LangChain has introduced a method called `with_structured_output` that "
"is available on ChatModels capable of tool calling. " "is available on ChatModels capable of tool calling. "
"You can read more about the method here: " "You can read more about the method here: "
"https://python.langchain.com/docs/modules/model_io/chat/structured_output/ " "<https://python.langchain.com/docs/modules/model_io/chat/structured_output/>. "
"Please follow our extraction use case documentation for more guidelines " "Please follow our extraction use case documentation for more guidelines "
"on how to do information extraction with LLMs. " "on how to do information extraction with LLMs. "
"https://python.langchain.com/docs/use_cases/extraction/. " "<https://python.langchain.com/docs/use_cases/extraction/>. "
"If you notice other issues, please provide " "If you notice other issues, please provide "
"feedback here: " "feedback here: "
"https://github.com/langchain-ai/langchain/discussions/18154" "<https://github.com/langchain-ai/langchain/discussions/18154>"
), ),
removal="0.3.0", removal="0.3.0",
alternative=( alternative=(
@ -150,13 +150,13 @@ def create_openai_fn_runnable(
"LangChain has introduced a method called `with_structured_output` that " "LangChain has introduced a method called `with_structured_output` that "
"is available on ChatModels capable of tool calling. " "is available on ChatModels capable of tool calling. "
"You can read more about the method here: " "You can read more about the method here: "
"https://python.langchain.com/docs/modules/model_io/chat/structured_output/ " "<https://python.langchain.com/docs/modules/model_io/chat/structured_output/>."
"Please follow our extraction use case documentation for more guidelines " "Please follow our extraction use case documentation for more guidelines "
"on how to do information extraction with LLMs. " "on how to do information extraction with LLMs. "
"https://python.langchain.com/docs/use_cases/extraction/. " "<https://python.langchain.com/docs/use_cases/extraction/>. "
"If you notice other issues, please provide " "If you notice other issues, please provide "
"feedback here: " "feedback here: "
"https://github.com/langchain-ai/langchain/discussions/18154" "<https://github.com/langchain-ai/langchain/discussions/18154>"
), ),
removal="0.3.0", removal="0.3.0",
alternative=( alternative=(