Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
},
{
"cell_type": "markdown",
"id": "6fa3d916",
"id": "36b283af",
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
Expand Down Expand Up @@ -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",
Expand All @@ -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."
]
},
{
Expand Down Expand Up @@ -390,7 +390,7 @@
},
{
"cell_type": "markdown",
"id": "b83dfedb",
"id": "aa8f3d24",
"metadata": {},
"source": [
"You can of course use this retriever within a QA pipeline"
Expand Down Expand Up @@ -457,7 +457,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.9.6"
}
},
"nbformat": 4,
Expand Down
3 changes: 1 addition & 2 deletions docs/docs/integrations/providers/voyageai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/integrations/text_embedding/voyageai.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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`)"
]
},
{
Expand Down Expand Up @@ -219,7 +219,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.9.6"
},
"vscode": {
"interpreter": {
Expand Down