diff --git a/docs/core_docs/docs/tutorials/agents.mdx b/docs/core_docs/docs/tutorials/agents.mdx index 73849c2aeb6c..3dad19ed2029 100644 --- a/docs/core_docs/docs/tutorials/agents.mdx +++ b/docs/core_docs/docs/tutorials/agents.mdx @@ -83,9 +83,7 @@ const vectorstore = await MemoryVectorStore.fromDocuments( ); const retriever = vectorstore.asRetriever(); -const retrieverResult = await retriever.invoke( - "how to upload a dataset" -); +const retrieverResult = await retriever.invoke("how to upload a dataset"); console.log(retrieverResult[0]); /* diff --git a/examples/src/retrievers/parent_document_retriever_rerank.ts b/examples/src/retrievers/parent_document_retriever_rerank.ts index ff5ce56cd7f5..f0918b602a67 100644 --- a/examples/src/retrievers/parent_document_retriever_rerank.ts +++ b/examples/src/retrievers/parent_document_retriever_rerank.ts @@ -69,9 +69,7 @@ await retriever.addDocuments(docs); // This will search for documents in vector store and return for LLM already reranked and sorted document // with appropriate minimum relevance score -const retrievedDocs = await retriever.invoke( - "What is Pam's favorite color?" -); +const retrievedDocs = await retriever.invoke("What is Pam's favorite color?"); // Pam's favorite color is returned first! console.log(JSON.stringify(retrievedDocs, null, 2)); diff --git a/langchain/src/experimental/chains/violation_of_expectations/violation_of_expectations_chain.ts b/langchain/src/experimental/chains/violation_of_expectations/violation_of_expectations_chain.ts index 31d74b285011..10091ee3b613 100644 --- a/langchain/src/experimental/chains/violation_of_expectations/violation_of_expectations_chain.ts +++ b/langchain/src/experimental/chains/violation_of_expectations/violation_of_expectations_chain.ts @@ -294,9 +294,7 @@ export class ViolationOfExpectationsChain // Only extract the first relevant doc from the retriever. We don't need more than one. const relevantInsightsDocuments = await Promise.all( insights.map(async (insight) => { - const relevantInsight = await this.retriever.invoke( - insight - ); + const relevantInsight = await this.retriever.invoke(insight); return relevantInsight[0]; }) ); diff --git a/langchain/src/retrievers/multi_query.ts b/langchain/src/retrievers/multi_query.ts index 574277760fa2..410075f53ab0 100644 --- a/langchain/src/retrievers/multi_query.ts +++ b/langchain/src/retrievers/multi_query.ts @@ -159,10 +159,7 @@ export class MultiQueryRetriever extends BaseRetriever { const documents: Document[] = []; await Promise.all( queries.map(async (query) => { - const docs = await this.retriever.invoke( - query, - runManager?.getChild() - ); + const docs = await this.retriever.invoke(query, runManager?.getChild()); documents.push(...docs); }) ); diff --git a/langchain/src/retrievers/tests/hyde.int.test.ts b/langchain/src/retrievers/tests/hyde.int.test.ts index f3fb99868f2b..8cbff5c84525 100644 --- a/langchain/src/retrievers/tests/hyde.int.test.ts +++ b/langchain/src/retrievers/tests/hyde.int.test.ts @@ -23,9 +23,7 @@ test("Hyde retriever", async () => { ].map((pageContent) => new Document({ pageContent })) ); - const results = await retriever.invoke( - "What is my favourite food?" - ); + const results = await retriever.invoke("What is my favourite food?"); expect(results.length).toBe(1); console.log(results); @@ -51,9 +49,7 @@ test("Hyde retriever with default prompt template", async () => { ].map((pageContent) => new Document({ pageContent })) ); - const results = await retriever.invoke( - "What is my favourite food?" - ); + const results = await retriever.invoke("What is my favourite food?"); expect(results.length).toBe(1); console.log(results); diff --git a/libs/langchain-community/src/vectorstores/tests/azure_aisearch.int.test.ts b/libs/langchain-community/src/vectorstores/tests/azure_aisearch.int.test.ts index 9f8487975cc9..4945e9b7b024 100644 --- a/libs/langchain-community/src/vectorstores/tests/azure_aisearch.int.test.ts +++ b/libs/langchain-community/src/vectorstores/tests/azure_aisearch.int.test.ts @@ -183,8 +183,7 @@ describe.skip("AzureAISearchVectorStore e2e integration tests", () => { const standardRetriever = await vectorStore.asRetriever(); - const standardRetrieverOutput = - await standardRetriever.invoke("foo"); + const standardRetrieverOutput = await standardRetriever.invoke("foo"); expect(output).toHaveLength(texts.length); const standardRetrieverActual = standardRetrieverOutput.map( diff --git a/libs/langchain-community/src/vectorstores/tests/azure_cosmosdb.int.test.ts b/libs/langchain-community/src/vectorstores/tests/azure_cosmosdb.int.test.ts index 7529e3d915e1..75c78048eaa4 100644 --- a/libs/langchain-community/src/vectorstores/tests/azure_cosmosdb.int.test.ts +++ b/libs/langchain-community/src/vectorstores/tests/azure_cosmosdb.int.test.ts @@ -135,8 +135,7 @@ describe.skip("AzureCosmosDBVectorStore", () => { const standardRetriever = await vectorStore.asRetriever(); - const standardRetrieverOutput = - await standardRetriever.invoke("foo"); + const standardRetrieverOutput = await standardRetriever.invoke("foo"); expect(output).toHaveLength(texts.length); const standardRetrieverActual = standardRetrieverOutput.map( diff --git a/libs/langchain-community/src/vectorstores/tests/hanavector.int.test.ts b/libs/langchain-community/src/vectorstores/tests/hanavector.int.test.ts index 5e47d12f8b3d..330a027ecc4d 100644 --- a/libs/langchain-community/src/vectorstores/tests/hanavector.int.test.ts +++ b/libs/langchain-community/src/vectorstores/tests/hanavector.int.test.ts @@ -327,8 +327,7 @@ describe("add documents and similarity search tests", () => { const standardRetriever = vectorStore.asRetriever(); - const standardRetrieverOutput = - await standardRetriever.invoke("foo"); + const standardRetrieverOutput = await standardRetriever.invoke("foo"); expect(output).toHaveLength(texts.length); const standardRetrieverActual = standardRetrieverOutput.map( diff --git a/libs/langchain-mongodb/src/tests/vectorstores.int.test.ts b/libs/langchain-mongodb/src/tests/vectorstores.int.test.ts index 719a52910efa..a8930bff6089 100644 --- a/libs/langchain-mongodb/src/tests/vectorstores.int.test.ts +++ b/libs/langchain-mongodb/src/tests/vectorstores.int.test.ts @@ -141,8 +141,7 @@ test("MongoDBAtlasVectorSearch with Maximal Marginal Relevance", async () => { const standardRetriever = await vectorStore.asRetriever(); - const standardRetrieverOutput = - await standardRetriever.invoke("foo"); + const standardRetrieverOutput = await standardRetriever.invoke("foo"); expect(output).toHaveLength(texts.length); const standardRetrieverActual = standardRetrieverOutput.map(