docs: (minor) updates to voyage ai documentation (#19819)

**Description:** Updates to Voyage AI documentation
**Issue:** Not Applicable
**Dependencies:** None
pull/19822/head^2
aditya thomas 6 months ago committed by GitHub
parent ed49cca191
commit b8271bbc4a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -77,7 +77,7 @@
},
{
"cell_type": "markdown",
"id": "6fa3d916",
"id": "36b283af",
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
@ -310,13 +310,13 @@
"from langchain_community.document_loaders import TextLoader\n",
"from langchain_community.vectorstores import FAISS\n",
"from langchain_text_splitters import RecursiveCharacterTextSplitter\n",
"from langchain_voyageai import VoyageEmbeddings\n",
"from langchain_voyageai import VoyageAIEmbeddings\n",
"\n",
"documents = TextLoader(\"../../modules/state_of_the_union.txt\").load()\n",
"text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=100)\n",
"texts = text_splitter.split_documents(documents)\n",
"retriever = FAISS.from_documents(\n",
" texts, VoyageEmbeddings(model=\"voyage-2\")\n",
" texts, VoyageAIEmbeddings(model=\"voyage-2\")\n",
").as_retriever(search_kwargs={\"k\": 20})\n",
"\n",
"query = \"What did the president say about Ketanji Brown Jackson\"\n",
@ -326,11 +326,11 @@
},
{
"cell_type": "markdown",
"id": "b7648612",
"id": "28f5da35",
"metadata": {},
"source": [
"## Doing reranking with VoyageAIRerank\n",
"Now let's wrap our base retriever with a `ContextualCompressionRetriever`. We'll add an `VoyageAIRerank`, uses the Voyage AI rerank endpoint to rerank the returned results."
"Now let's wrap our base retriever with a `ContextualCompressionRetriever`. We'll use the Voyage AI reranker to rerank the returned results."
]
},
{
@ -390,7 +390,7 @@
},
{
"cell_type": "markdown",
"id": "b83dfedb",
"id": "aa8f3d24",
"metadata": {},
"source": [
"You can of course use this retriever within a QA pipeline"
@ -457,7 +457,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.9.6"
}
},
"nbformat": 4,

@ -3,7 +3,6 @@
All functionality related to VoyageAI
>[VoyageAI](https://www.voyageai.com/) Voyage AI builds embedding models, customized for your domain and company, for better retrieval quality.
> customized for your domain and company, for better retrieval quality.
## Installation and Setup
@ -12,7 +11,7 @@ Install the integration package with
pip install langchain-voyageai
```
Get an VoyageAI api key and set it as an environment variable (`VOYAGE_API_KEY`)
Get a VoyageAI API key and set it as an environment variable (`VOYAGE_API_KEY`)
## Text Embedding Model

@ -9,7 +9,7 @@
"\n",
">[Voyage AI](https://www.voyageai.com/) provides cutting-edge embedding/vectorizations models.\n",
"\n",
"Let's load the Voyage Embedding class. (Install the LangChain partner package with `pip install langchain-voyageai`)"
"Let's load the Voyage AI Embedding class. (Install the LangChain partner package with `pip install langchain-voyageai`)"
]
},
{
@ -219,7 +219,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.9.6"
},
"vscode": {
"interpreter": {

Loading…
Cancel
Save