diff --git a/docs/modules/document_loaders/examples/epub.ipynb b/docs/modules/indexes/document_loaders/examples/epub.ipynb similarity index 100% rename from docs/modules/document_loaders/examples/epub.ipynb rename to docs/modules/indexes/document_loaders/examples/epub.ipynb diff --git a/docs/modules/indexes/vectorstores/examples/chroma.ipynb b/docs/modules/indexes/vectorstores/examples/chroma.ipynb index 13738c16..6474c99a 100644 --- a/docs/modules/indexes/vectorstores/examples/chroma.ipynb +++ b/docs/modules/indexes/vectorstores/examples/chroma.ipynb @@ -46,11 +46,10 @@ "metadata": {}, "outputs": [ { - "name": "stdout", + "name": "stderr", "output_type": "stream", "text": [ - "Running Chroma using direct local API.\n", - "Using DuckDB in-memory for database. Data will be transient.\n" + "Using embedded DuckDB without persistence: data will be transient\n" ] } ], @@ -71,10 +70,6 @@ "name": "stdout", "output_type": "stream", "text": [ - "In state after state, new laws have been passed, not only to suppress the vote, but to subvert entire elections. \n", - "\n", - "We cannot let this happen. \n", - "\n", "Tonight. I call on the Senate to: Pass the Freedom to Vote Act. Pass the John Lewis Voting Rights Act. And while you’re at it, pass the Disclose Act so Americans can know who is funding our elections. \n", "\n", "Tonight, I’d like to honor someone who has dedicated his life to serve this country: Justice Stephen Breyer—an Army veteran, Constitutional scholar, and retiring Justice of the United States Supreme Court. Justice Breyer, thank you for your service. \n", @@ -234,10 +229,55 @@ "vectordb = Chroma(persist_directory=persist_directory, embedding_function=embedding)\n" ] }, + { + "cell_type": "markdown", + "id": "794a7552", + "metadata": {}, + "source": [ + "## Retriever options\n", + "\n", + "This section goes over different options for how to use Chroma as a retriever.\n", + "\n", + "### MMR\n", + "\n", + "In addition to using similarity search in the retriever object, you can also use `mmr`." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "96ff911a", + "metadata": {}, + "outputs": [], + "source": [ + "retriever = db.as_retriever(search_type=\"mmr\")" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "f00be6d0", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Document(page_content='Tonight. I call on the Senate to: Pass the Freedom to Vote Act. Pass the John Lewis Voting Rights Act. And while you’re at it, pass the Disclose Act so Americans can know who is funding our elections. \\n\\nTonight, I’d like to honor someone who has dedicated his life to serve this country: Justice Stephen Breyer—an Army veteran, Constitutional scholar, and retiring Justice of the United States Supreme Court. Justice Breyer, thank you for your service. \\n\\nOne of the most serious constitutional responsibilities a President has is nominating someone to serve on the United States Supreme Court. \\n\\nAnd I did that 4 days ago, when I nominated Circuit Court of Appeals Judge Ketanji Brown Jackson. One of our nation’s top legal minds, who will continue Justice Breyer’s legacy of excellence.', metadata={'source': '../../../state_of_the_union.txt'})" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "retriever.get_relevant_documents(query)[0]" + ] + }, { "cell_type": "code", "execution_count": null, - "id": "4dde7a0d", + "id": "a559c3f1", "metadata": {}, "outputs": [], "source": [] diff --git a/pyproject.toml b/pyproject.toml index ba9893df..2e81307d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langchain" -version = "0.0.127" +version = "0.0.128" description = "Building applications with LLMs through composability" authors = [] license = "MIT"