From afdd636999838e6f92045607146484238fc27cfc Mon Sep 17 00:00:00 2001 From: Erick Friis Date: Fri, 2 Feb 2024 15:12:21 -0800 Subject: [PATCH] docs: partner packages (#16960) --- docs/.local_build.sh | 3 +- docs/docs/integrations/chat/mistralai.ipynb | 14 +++- docs/docs/integrations/platforms/index.mdx | 22 ++++++ .../integrations/providers/exa_search.ipynb | 77 ++++++++++++++++++ .../integrations/providers/mistralai.ipynb | 78 +++++++++++++++++++ docs/docs/integrations/providers/nomic.ipynb | 16 ++++ .../integrations/providers/together.ipynb | 78 +++++++++++++++++++ docs/docs/integrations/tools/exa_search.ipynb | 2 +- docs/sidebars.js | 6 +- .../integration_template/docs/provider.ipynb | 6 +- 10 files changed, 293 insertions(+), 9 deletions(-) create mode 100644 docs/docs/integrations/platforms/index.mdx create mode 100644 docs/docs/integrations/providers/exa_search.ipynb create mode 100644 docs/docs/integrations/providers/mistralai.ipynb create mode 100644 docs/docs/integrations/providers/together.ipynb diff --git a/docs/.local_build.sh b/docs/.local_build.sh index 72e15dec90a..a1f181198fd 100755 --- a/docs/.local_build.sh +++ b/docs/.local_build.sh @@ -16,7 +16,8 @@ cp ../cookbook/README.md src/pages/cookbook.mdx mkdir -p docs/templates cp ../templates/docs/INDEX.md docs/templates/index.md poetry run python scripts/copy_templates.py -wget https://raw.githubusercontent.com/langchain-ai/langserve/main/README.md -O docs/langserve.md +wget -q https://raw.githubusercontent.com/langchain-ai/langserve/main/README.md -O docs/langserve.md +wget -q https://raw.githubusercontent.com/langchain-ai/langgraph/main/README.md -O docs/langgraph.md yarn diff --git a/docs/docs/integrations/chat/mistralai.ipynb b/docs/docs/integrations/chat/mistralai.ipynb index 17302ca0e12..5b4977e8792 100644 --- a/docs/docs/integrations/chat/mistralai.ipynb +++ b/docs/docs/integrations/chat/mistralai.ipynb @@ -19,7 +19,19 @@ "\n", "This notebook covers how to get started with MistralAI chat models, via their [API](https://docs.mistral.ai/api/).\n", "\n", - "A valid [API key](https://console.mistral.ai/users/api-keys/) is needed to communicate with the API." + "A valid [API key](https://console.mistral.ai/users/api-keys/) is needed to communicate with the API.\n", + "\n", + "You will need the `langchain-mistralai` package to use the API. You can install it via pip:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "eb978a7e", + "metadata": {}, + "outputs": [], + "source": [ + "%pip install -qU langchain-core langchain-mistralai" ] }, { diff --git a/docs/docs/integrations/platforms/index.mdx b/docs/docs/integrations/platforms/index.mdx new file mode 100644 index 00000000000..9a5fcdf57c9 --- /dev/null +++ b/docs/docs/integrations/platforms/index.mdx @@ -0,0 +1,22 @@ +# Providers + +LangChain integrates with many providers + +## Partner Packages + +- [OpenAI](/docs/integrations/platforms/openai) +- [Anthropic](/docs/integrations/platforms/anthropic) +- [Google](/docs/integrations/platforms/google) +- [MistralAI](/docs/integrations/providers/mistralai) +- [NVIDIA AI](/docs/integrations/providers/nvidia) +- [Together AI](/docs/integrations/providers/together) +- [Robocorp](/docs/integrations/providers/robocorp) +- [Exa Search](/docs/integrations/providers/exa_search) +- [Nomic](/docs/integrations/providers/nomic) + + +## Featured Community Providers + +- [AWS](/docs/integrations/platforms/aws) +- [Hugging Face](/docs/integrations/platforms/huggingface) +- [Microsoft](/docs/integrations/platforms/microsoft) diff --git a/docs/docs/integrations/providers/exa_search.ipynb b/docs/docs/integrations/providers/exa_search.ipynb new file mode 100644 index 00000000000..c72dbd1c4a9 --- /dev/null +++ b/docs/docs/integrations/providers/exa_search.ipynb @@ -0,0 +1,77 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Exa Search\n", + "\n", + "Exa's search integration exists in its own [partner package](https://pypi.org/project/langchain-exa/). You can install it with:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%pip install -qU langchain-exa" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In order to use the package, you will also need to set the `EXA_API_KEY` environment variable to your Exa API key.\n", + "\n", + "## Retriever\n", + "\n", + "You can use the [`ExaSearchRetriever`](/docs/integrations/tools/exa_search#using-exasearchretriever) in a standard retrieval pipeline. You can import it as follows" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "id": "y8ku6X96sebl" + }, + "outputs": [], + "source": [ + "from langchain_exa import ExaSearchRetriever" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Tools\n", + "\n", + "You can use Exa as an agent tool as described in the [Exa tool calling docs](/docs/integrations/tools/exa_search#using-the-exa-sdk-as-langchain-agent-tools).\n" + ] + } + ], + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.11" + } + }, + "nbformat": 4, + "nbformat_minor": 1 +} diff --git a/docs/docs/integrations/providers/mistralai.ipynb b/docs/docs/integrations/providers/mistralai.ipynb new file mode 100644 index 00000000000..561751f20c5 --- /dev/null +++ b/docs/docs/integrations/providers/mistralai.ipynb @@ -0,0 +1,78 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# MistralAI\n", + "\n", + "Mistral AI is a platform that offers hosting for their powerful open source models.\n", + "\n", + "You can access them via their [API](https://docs.mistral.ai/api/).\n", + "\n", + "A valid [API key](https://console.mistral.ai/users/api-keys/) is needed to communicate with the API.\n", + "\n", + "You will also need the `langchain-mistralai` package:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%pip install -qU langchain-core langchain-mistralai" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "id": "y8ku6X96sebl" + }, + "outputs": [], + "source": [ + "from langchain_mistralai import ChatMistralAI, MistralAIEmbeddings" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "See the docs for their\n", + "\n", + "- [Chat Model](/docs/integrations/chat/mistralai)\n", + "- [Embeddings Model](/docs/integrations/text_embedding/mistralai)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] + } + ], + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.11" + } + }, + "nbformat": 4, + "nbformat_minor": 1 +} diff --git a/docs/docs/integrations/providers/nomic.ipynb b/docs/docs/integrations/providers/nomic.ipynb index a7475ef36ea..b1f4861612a 100644 --- a/docs/docs/integrations/providers/nomic.ipynb +++ b/docs/docs/integrations/providers/nomic.ipynb @@ -11,6 +11,22 @@ "- Atlas: their Visual Data Engine\n", "- GPT4All: their Open Source Edge Language Model Ecosystem\n", "\n", + "The Nomic integration exists in its own [partner package](https://pypi.org/project/langchain-nomic/). You can install it with:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%pip install -qU langchain-nomic" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ "Currently, you can import their hosted [embedding model](/docs/integrations/text_embedding/nomic) as follows:" ] }, diff --git a/docs/docs/integrations/providers/together.ipynb b/docs/docs/integrations/providers/together.ipynb new file mode 100644 index 00000000000..feeb4a02295 --- /dev/null +++ b/docs/docs/integrations/providers/together.ipynb @@ -0,0 +1,78 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Together AI\n", + "\n", + "> The Together API makes it easy to fine-tune or run leading open-source models with a couple lines of code. We have integrated the world’s leading open-source models, including Llama-2, RedPajama, Falcon, Alpaca, Stable Diffusion XL, and more. Read more: https://together.ai\n", + "\n", + "To use, you'll need an API key which you can find here:\n", + "https://api.together.xyz/settings/api-keys. This can be passed in as init param\n", + "``together_api_key`` or set as environment variable ``TOGETHER_API_KEY``.\n", + "\n", + "Together API reference: https://docs.together.ai/reference/inference\n", + "\n", + "You will also need to install the `langchain-together` integration package:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%pip install --upgrade --quiet langchain-together" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "id": "y8ku6X96sebl" + }, + "outputs": [], + "source": [ + "from __module_name__ import (\n", + " Together, # LLM\n", + " TogetherEmbeddings,\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "See the docs for their\n", + "\n", + "- [LLM](/docs/integrations/llms/together)\n", + "- [Embeddings Model](/docs/integrations/text_embedding/together)" + ] + } + ], + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.11" + } + }, + "nbformat": 4, + "nbformat_minor": 1 +} diff --git a/docs/docs/integrations/tools/exa_search.ipynb b/docs/docs/integrations/tools/exa_search.ipynb index dc2da3a1d9d..d38087279d5 100644 --- a/docs/docs/integrations/tools/exa_search.ipynb +++ b/docs/docs/integrations/tools/exa_search.ipynb @@ -60,7 +60,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Using ExaSearchRetriever\n", + "## Using ExaSearchRetriever\n", "\n", "ExaSearchRetriever is a retriever that uses Exa Search to retrieve relevant documents." ] diff --git a/docs/sidebars.js b/docs/sidebars.js index 46e50354212..ba924e5a38a 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -87,11 +87,11 @@ module.exports = { collapsible: false, items: [ { type: "autogenerated", dirName: "integrations/platforms" }, - { type: "category", label: "More", collapsed: true, items: [{type:"autogenerated", dirName: "integrations/providers" }]}, + { type: "category", label: "More", collapsed: true, items: [{type:"autogenerated", dirName: "integrations/providers" }], link: { type: 'generated-index', slug: "integrations/providers", }}, ], link: { - type: 'generated-index', - slug: "integrations/providers", + type: 'doc', + id: 'integrations/platforms/index' }, }, { diff --git a/libs/cli/langchain_cli/integration_template/docs/provider.ipynb b/libs/cli/langchain_cli/integration_template/docs/provider.ipynb index 11f770a42b9..a00e11eb2e1 100644 --- a/libs/cli/langchain_cli/integration_template/docs/provider.ipynb +++ b/libs/cli/langchain_cli/integration_template/docs/provider.ipynb @@ -17,9 +17,9 @@ }, "outputs": [], "source": [ - "from __module_name__.chat_models import __ModuleName__Chat\n", - "from __module_name__.llms import __ModuleName__LLM\n", - "from __module_name__.vectorstores import __ModuleName__VectorStore" + "from __module_name__ import Chat__ModuleName__\n", + "from __module_name__ import __ModuleName__LLM\n", + "from __module_name__ import __ModuleName__VectorStore" ] } ],