From 000e3470330ff60b59f656685945aa1432e4444a Mon Sep 17 00:00:00 2001 From: Erick Friis Date: Wed, 6 Mar 2024 13:37:42 -0800 Subject: [PATCH] disclaimer --- README.md | 2 + libs/aws/docs/chat.ipynb | 97 --------------------- libs/aws/docs/llms.ipynb | 102 ---------------------- libs/aws/docs/provider.ipynb | 50 ----------- libs/aws/docs/text_embedding.ipynb | 132 ----------------------------- libs/aws/docs/vectorstores.ipynb | 87 ------------------- 6 files changed, 2 insertions(+), 468 deletions(-) delete mode 100644 libs/aws/docs/chat.ipynb delete mode 100644 libs/aws/docs/llms.ipynb delete mode 100644 libs/aws/docs/provider.ipynb delete mode 100644 libs/aws/docs/text_embedding.ipynb delete mode 100644 libs/aws/docs/vectorstores.ipynb diff --git a/README.md b/README.md index bece46bd..0faccf6c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # 🦜️🔗 LangChain 🤝 Amazon Web Services (AWS) +NOTE: This repository is a work-in-progress. Currently, the AWS integrations are in `langchain-community`. + This repository contains 1 package with AWS integrations with LangChain: - [langchain-aws](https://pypi.org/project/langchain-aws/) integrates [AWS](https://aws.amazon.com). diff --git a/libs/aws/docs/chat.ipynb b/libs/aws/docs/chat.ipynb deleted file mode 100644 index a4356a62..00000000 --- a/libs/aws/docs/chat.ipynb +++ /dev/null @@ -1,97 +0,0 @@ -{ - "cells": [ - { - "cell_type": "raw", - "id": "afaf8039", - "metadata": {}, - "source": [ - "---\n", - "sidebar_label: Bedrock\n", - "---" - ] - }, - { - "cell_type": "markdown", - "id": "e49f1e0d", - "metadata": {}, - "source": [ - "# ChatBedrock\n", - "\n", - "This notebook covers how to get started with Bedrock chat models.\n", - "\n", - "## Installation" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4c3bef91", - "metadata": {}, - "outputs": [], - "source": [ - "# install package\n", - "!pip install -U langchain-aws" - ] - }, - { - "cell_type": "markdown", - "id": "2b4f3e15", - "metadata": {}, - "source": [ - "## Environment Setup\n", - "\n", - "Make sure to set the following environment variables:\n", - "\n", - "- TODO: fill out relevant environment variables or secrets\n", - "\n", - "## Usage" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "62e0dbc3", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "from langchain_aws.chat_models import ChatBedrock\n", - "from langchain_core.prompts import ChatPromptTemplate\n", - "\n", - "chat = ChatBedrock()\n", - "\n", - "prompt = ChatPromptTemplate.from_messages(\n", - " [\n", - " (\"system\", \"You are a helpful assistant that translates English to French.\"),\n", - " (\"human\", \"Translate this sentence from English to French. {english_text}.\"),\n", - " ]\n", - ")\n", - "\n", - "chain = prompt | chat\n", - "chain.invoke({\"english_text\": \"Hello, how are you?\"})" - ] - } - ], - "metadata": { - "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.5" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/libs/aws/docs/llms.ipynb b/libs/aws/docs/llms.ipynb deleted file mode 100644 index e05751fc..00000000 --- a/libs/aws/docs/llms.ipynb +++ /dev/null @@ -1,102 +0,0 @@ -{ - "cells": [ - { - "cell_type": "raw", - "id": "67db2992", - "metadata": {}, - "source": [ - "---\n", - "sidebar_label: Bedrock\n", - "---" - ] - }, - { - "cell_type": "markdown", - "id": "9597802c", - "metadata": {}, - "source": [ - "# BedrockLLM\n", - "\n", - "This example goes over how to use LangChain to interact with `Bedrock` models.\n", - "\n", - "## Installation" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "59c710c4", - "metadata": {}, - "outputs": [], - "source": [ - "# install package\n", - "!pip install -U langchain-aws" - ] - }, - { - "cell_type": "markdown", - "id": "0ee90032", - "metadata": {}, - "source": [ - "## Environment Setup\n", - "\n", - "Make sure to set the following environment variables:\n", - "\n", - "- TODO: fill out relevant environment variables or secrets\n", - "\n", - "## Usage" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "035dea0f", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "from langchain_core.prompts import PromptTemplate\n", - "from langchain_aws.llms import BedrockLLM\n", - "\n", - "template = \"\"\"Question: {question}\n", - "\n", - "Answer: Let's think step by step.\"\"\"\n", - "\n", - "prompt = PromptTemplate.from_string(template)\n", - "\n", - "model = BedrockLLM()\n", - "\n", - "chain = prompt | model\n", - "\n", - "chain.invoke({\"question\": \"What is LangChain?\"})" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3.11.1 64-bit", - "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.9.7" - }, - "vscode": { - "interpreter": { - "hash": "e971737741ff4ec9aff7dc6155a1060a59a8a6d52c757dbbe66bf8ee389494b1" - } - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/libs/aws/docs/provider.ipynb b/libs/aws/docs/provider.ipynb deleted file mode 100644 index 953002fb..00000000 --- a/libs/aws/docs/provider.ipynb +++ /dev/null @@ -1,50 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Bedrock\n", - "\n", - "Bedrock is a platform that offers..." - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "id": "y8ku6X96sebl" - }, - "outputs": [], - "source": [ - "from langchain_aws import ChatBedrock\n", - "from langchain_aws import BedrockLLM\n", - "from langchain_aws import BedrockVectorStore" - ] - } - ], - "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/libs/aws/docs/text_embedding.ipynb b/libs/aws/docs/text_embedding.ipynb deleted file mode 100644 index e2ca7bdd..00000000 --- a/libs/aws/docs/text_embedding.ipynb +++ /dev/null @@ -1,132 +0,0 @@ -{ - "cells": [ - { - "cell_type": "raw", - "id": "afaf8039", - "metadata": {}, - "source": [ - "---\n", - "sidebar_label: Bedrock\n", - "---" - ] - }, - { - "cell_type": "markdown", - "id": "e49f1e0d", - "metadata": {}, - "source": [ - "# BedrockEmbeddings\n", - "\n", - "This notebook covers how to get started with Bedrock embedding models.\n", - "\n", - "## Installation" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4c3bef91", - "metadata": {}, - "outputs": [], - "source": [ - "# install package\n", - "!pip install -U langchain-aws" - ] - }, - { - "cell_type": "markdown", - "id": "2b4f3e15", - "metadata": {}, - "source": [ - "## Environment Setup\n", - "\n", - "Make sure to set the following environment variables:\n", - "\n", - "- TODO: fill out relevant environment variables or secrets\n", - "\n", - "## Usage" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "62e0dbc3", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "from langchain_aws.embeddings import BedrockEmbeddings\n", - "\n", - "embeddings = BedrockEmbeddings()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "12fcfb4b", - "metadata": {}, - "outputs": [], - "source": [ - "embeddings.embed_query(\"My query to look up\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "1f2e6104", - "metadata": {}, - "outputs": [], - "source": [ - "embeddings.embed_documents(\n", - " [\"This is a content of the document\", \"This is another document\"]\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "46739f68", - "metadata": {}, - "outputs": [], - "source": [ - "# async embed query\n", - "await embeddings.aembed_query(\"My query to look up\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "e48632ea", - "metadata": {}, - "outputs": [], - "source": [ - "# async embed documents\n", - "await embeddings.aembed_documents(\n", - " [\"This is a content of the document\", \"This is another document\"]\n", - ")" - ] - } - ], - "metadata": { - "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.5" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/libs/aws/docs/vectorstores.ipynb b/libs/aws/docs/vectorstores.ipynb deleted file mode 100644 index 20cafe2a..00000000 --- a/libs/aws/docs/vectorstores.ipynb +++ /dev/null @@ -1,87 +0,0 @@ -{ - "cells": [ - { - "cell_type": "raw", - "id": "1957f5cb", - "metadata": {}, - "source": [ - "---\n", - "sidebar_label: Bedrock\n", - "---" - ] - }, - { - "cell_type": "markdown", - "id": "ef1f0986", - "metadata": {}, - "source": [ - "# BedrockVectorStore\n", - "\n", - "This notebook covers how to get started with the Bedrock vector store.\n", - "\n", - "## Installation" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "d97b55c2", - "metadata": {}, - "outputs": [], - "source": [ - "# install package\n", - "!pip install -U langchain-aws" - ] - }, - { - "cell_type": "markdown", - "id": "36fdc060", - "metadata": {}, - "source": [ - "## Environment Setup\n", - "\n", - "Make sure to set the following environment variables:\n", - "\n", - "- TODO: fill out relevant environment variables or secrets\n", - "- Op\n", - "\n", - "## Usage" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "dc37144c-208d-4ab3-9f3a-0407a69fe052", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "from langchain_aws.vectorstores import BedrockVectorStore\n", - "\n", - "# TODO: switch for preferred way to init and use your vector store\n" - ] - } - ], - "metadata": { - "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.12" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -}