From 7eb376d5fca8494be99f0e9234632ba14f1e28d7 Mon Sep 17 00:00:00 2001 From: Erick Friis Date: Tue, 19 Mar 2024 10:11:15 -0700 Subject: [PATCH] docs: integration deprecation docs (#19283) --- docs/docs/contributing/integrations.mdx | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/docs/docs/contributing/integrations.mdx b/docs/docs/contributing/integrations.mdx index f2820cf7f3..af10cfc7a4 100644 --- a/docs/docs/contributing/integrations.mdx +++ b/docs/docs/contributing/integrations.mdx @@ -131,6 +131,41 @@ For information on running and implementing tests, see the [Testing guide](./tes Documentation is generated from Jupyter notebooks in the `docs/` directory. You should move the generated notebooks to the relevant `docs/docs/integrations` directory in the monorepo root. +### (If Necessary) Deprecate community integration + +Note: this is only necessary if you're migrating an existing community integration into +a partner package. If the component you're integrating is net-new to LangChain (i.e. +not already in the community package), you can skip this step. + +Let's pretend we migrated our `ChatParrotLink` chat model from the community package to +the partner package. We would need to deprecate the old model in the community package. + +We would do that by adding a `@deprecated` decorator to the old model as follows, in +`libs/community/langchain_community/chat_models/parrot_link.py`. + +Before our change, our chat model might look like this: + +```python +class ParrotLink(BaseChatModel): + ... +``` + +After our change, it would look like this: + +```python +from langchain_core._api.deprecation import deprecated + +@deprecated( + since="0.0.", + removal="0.2.0", + alternative_import="langchain_parrot_link.ChatParrotLink" +) +class ParrotLink(BaseChatModel): + ... +``` + +You should do this for *each* component that you're migrating to the partner package. + ### Additional steps Contributor steps: