id
stringlengths
14
17
text
stringlengths
42
2.11k
4e9727215e95-2000
/const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year the movie was released", type: "number", }, { name: "director", description: "The director of the movie", type: ...
4e9727215e95-2001
/ structuredQueryTranslator: new FunctionalTranslator(),});/** * Now we can query the vector store. * We can ask questions like "Which movies are less than 90 minutes?" or "Which movies are rated higher than 8.5?". * We can also ask questions like "Which movies are either comedy or drama and are less than 90 minutes?"...
4e9727215e95-2002
addition to the generated query:const selfQueryRetriever = await SelfQueryRetriever.fromLLM({ llm, vectorStore, documentContents, attributeInfo, /** * We need to use a translator that translates the queries into a * filter format that the vector store can understand. We provide a basic translator * translato...
4e9727215e95-2003
/const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Document({ pageContent: "Leo DiCaprio gets lost in a dream within a dream within a dream within a ...", meta...
4e9727215e95-2004
/const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year the movie was released", type: "number", }, { name: "director", description: "The director of the movie", type: ...
4e9727215e95-2005
/ structuredQueryTranslator: new FunctionalTranslator(),});/** * Now we can query the vector store. * We can ask questions like "Which movies are less than 90 minutes?" or "Which movies are rated higher than 8.5?". * We can also ask questions like "Which movies are either comedy or drama and are less than 90 minutes?"...
4e9727215e95-2006
addition to the generated query:const selfQueryRetriever = await SelfQueryRetriever.fromLLM({ llm, vectorStore, documentContents, attributeInfo, /** * We need to use a translator that translates the queries into a * filter format that the vector store can understand. We provide a basic translator * translato...
4e9727215e95-2007
/const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Document({ pageContent: "Leo DiCaprio gets lost in a dream within a dream within a dream within a ...", meta...
4e9727215e95-2008
/const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year the movie was released", type: "number", }, { name: "director", description: "The director of the movie", type: ...
4e9727215e95-2009
/ structuredQueryTranslator: new FunctionalTranslator(),});/** * Now we can query the vector store. * We can ask questions like "Which movies are less than 90 minutes?" or "Which movies are rated higher than 8.5?". * We can also ask questions like "Which movies are either comedy or drama and are less than 90 minutes?"...
4e9727215e95-2010
addition to the generated query:const selfQueryRetriever = await SelfQueryRetriever.fromLLM({ llm, vectorStore, documentContents, attributeInfo, /** * We need to use a translator that translates the queries into a * filter format that the vector store can understand. We provide a basic translator * translato...
4e9727215e95-2011
/const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Document({ pageContent: "Leo DiCaprio gets lost in a dream within a dream within a dream within a ...", meta...
4e9727215e95-2012
/const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year the movie was released", type: "number", }, { name: "director", description: "The director of the movie", type: ...
4e9727215e95-2013
/ structuredQueryTranslator: new FunctionalTranslator(),});/** * Now we can query the vector store. * We can ask questions like "Which movies are less than 90 minutes?" or "Which movies are rated higher than 8.5?". * We can also ask questions like "Which movies are either comedy or drama and are less than 90 minutes?"...
4e9727215e95-2014
addition to the generated query:const selfQueryRetriever = await SelfQueryRetriever.fromLLM({ llm, vectorStore, documentContents, attributeInfo, /** * We need to use a translator that translates the queries into a * filter format that the vector store can understand. We provide a basic translator * translato...
4e9727215e95-2015
Paragraphs: Skip to main content🦜️🔗 LangChainDocsUse casesAPILangSmithPython DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersText embedding modelsVector storesRetrieversHow-toContextual compressionParent Document RetrieverSelf-queryingChroma ...
4e9727215e95-2016
Each document has a pageContent and a metadata field. Make sure your metadata matches the AttributeInfo below. */const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Documen...
4e9727215e95-2017
We also provide a description of each attribute and the type of the attribute. * This is used to generate the query prompts. */const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year ...
4e9727215e95-2018
/if ( !process.env.PINECONE_API_KEY || !process.env.PINECONE_ENVIRONMENT || !process.env.PINECONE_INDEX) { throw new Error( "PINECONE_ENVIRONMENT and PINECONE_API_KEY and PINECONE_INDEX must be set" );}const client = new PineconeClient();await client.init({ apiKey: process.env.PINECONE_API_KEY, environment: p...
4e9727215e95-2019
The retriever will automatically convert these questions into queries that can be used to retrieve documents. */const query1 = await selfQueryRetriever.getRelevantDocuments( "Which movies are less than 90 minutes? ");const query2 = await selfQueryRetriever.getRelevantDocuments( "Which movies are rated higher than 8.5...
4e9727215e95-2020
addition to the generated query:const selfQueryRetriever = await SelfQueryRetriever.fromLLM({ llm, vectorStore, documentContents, attributeInfo, /** * We need to create a basic translator that translates the queries into a * filter format that the vector store can understand. We provide a basic translator * ...
4e9727215e95-2021
Get startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersText embedding modelsVector storesRetrieversHow-toContextual compressionParent Document RetrieverSelf-queryingChroma Self Query RetrieverHNSWLib Self Query RetrieverMemory Vector Store Self Query RetrieverP...
4e9727215e95-2022
Make sure your metadata matches the AttributeInfo below. */const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Document({ pageContent: "Leo DiCaprio gets lost in a ...
4e9727215e95-2023
This is used to generate the query prompts. */const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year the movie was released", type: "number", }, { name: "director", descri...
4e9727215e95-2024
/if ( !process.env.PINECONE_API_KEY || !process.env.PINECONE_ENVIRONMENT || !process.env.PINECONE_INDEX) { throw new Error( "PINECONE_ENVIRONMENT and PINECONE_API_KEY and PINECONE_INDEX must be set" );}const client = new PineconeClient();await client.init({ apiKey: process.env.PINECONE_API_KEY, environment: p...
4e9727215e95-2025
The retriever will automatically convert these questions into queries that can be used to retrieve documents. */const query1 = await selfQueryRetriever.getRelevantDocuments( "Which movies are less than 90 minutes? ");const query2 = await selfQueryRetriever.getRelevantDocuments( "Which movies are rated higher than 8.5...
4e9727215e95-2026
addition to the generated query:const selfQueryRetriever = await SelfQueryRetriever.fromLLM({ llm, vectorStore, documentContents, attributeInfo, /** * We need to create a basic translator that translates the queries into a * filter format that the vector store can understand. We provide a basic translator * ...
4e9727215e95-2027
ModulesData connectionRetrieversHow-toSelf-queryingPinecone Self Query RetrieverOn this pagePinecone Self Query RetrieverThis example shows how to use a self query retriever with a Pinecone vector store.Usage​import { PineconeClient } from "@pinecone-database/pinecone";import { AttributeInfo } from "langchain/schema/qu...
4e9727215e95-2028
/const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Document({ pageContent: "Leo DiCaprio gets lost in a dream within a dream within a dream within a ...", meta...
4e9727215e95-2029
/const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year the movie was released", type: "number", }, { name: "director", description: "The director of the movie", type: ...
4e9727215e95-2030
/if ( !process.env.PINECONE_API_KEY || !process.env.PINECONE_ENVIRONMENT || !process.env.PINECONE_INDEX) { throw new Error( "PINECONE_ENVIRONMENT and PINECONE_API_KEY and PINECONE_INDEX must be set" );}const client = new PineconeClient();await client.init({ apiKey: process.env.PINECONE_API_KEY, environment: p...
4e9727215e95-2031
The retriever will automatically convert these questions into queries that can be used to retrieve documents. */const query1 = await selfQueryRetriever.getRelevantDocuments( "Which movies are less than 90 minutes? ");const query2 = await selfQueryRetriever.getRelevantDocuments( "Which movies are rated higher than 8.5...
4e9727215e95-2032
addition to the generated query:const selfQueryRetriever = await SelfQueryRetriever.fromLLM({ llm, vectorStore, documentContents, attributeInfo, /** * We need to create a basic translator that translates the queries into a * filter format that the vector store can understand. We provide a basic translator * ...
4e9727215e95-2033
ModulesData connectionRetrieversHow-toSelf-queryingPinecone Self Query RetrieverOn this pagePinecone Self Query RetrieverThis example shows how to use a self query retriever with a Pinecone vector store.Usage​import { PineconeClient } from "@pinecone-database/pinecone";import { AttributeInfo } from "langchain/schema/qu...
4e9727215e95-2034
/const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Document({ pageContent: "Leo DiCaprio gets lost in a dream within a dream within a dream within a ...", meta...
4e9727215e95-2035
/const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year the movie was released", type: "number", }, { name: "director", description: "The director of the movie", type: ...
4e9727215e95-2036
/if ( !process.env.PINECONE_API_KEY || !process.env.PINECONE_ENVIRONMENT || !process.env.PINECONE_INDEX) { throw new Error( "PINECONE_ENVIRONMENT and PINECONE_API_KEY and PINECONE_INDEX must be set" );}const client = new PineconeClient();await client.init({ apiKey: process.env.PINECONE_API_KEY, environment: p...
4e9727215e95-2037
The retriever will automatically convert these questions into queries that can be used to retrieve documents. */const query1 = await selfQueryRetriever.getRelevantDocuments( "Which movies are less than 90 minutes? ");const query2 = await selfQueryRetriever.getRelevantDocuments( "Which movies are rated higher than 8.5...
4e9727215e95-2038
addition to the generated query:const selfQueryRetriever = await SelfQueryRetriever.fromLLM({ llm, vectorStore, documentContents, attributeInfo, /** * We need to create a basic translator that translates the queries into a * filter format that the vector store can understand. We provide a basic translator * ...
4e9727215e95-2039
/const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Document({ pageContent: "Leo DiCaprio gets lost in a dream within a dream within a dream within a ...", meta...
4e9727215e95-2040
/const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year the movie was released", type: "number", }, { name: "director", description: "The director of the movie", type: ...
4e9727215e95-2041
/if ( !process.env.PINECONE_API_KEY || !process.env.PINECONE_ENVIRONMENT || !process.env.PINECONE_INDEX) { throw new Error( "PINECONE_ENVIRONMENT and PINECONE_API_KEY and PINECONE_INDEX must be set" );}const client = new PineconeClient();await client.init({ apiKey: process.env.PINECONE_API_KEY, environment: p...
4e9727215e95-2042
The retriever will automatically convert these questions into queries that can be used to retrieve documents. */const query1 = await selfQueryRetriever.getRelevantDocuments( "Which movies are less than 90 minutes? ");const query2 = await selfQueryRetriever.getRelevantDocuments( "Which movies are rated higher than 8.5...
4e9727215e95-2043
addition to the generated query:const selfQueryRetriever = await SelfQueryRetriever.fromLLM({ llm, vectorStore, documentContents, attributeInfo, /** * We need to create a basic translator that translates the queries into a * filter format that the vector store can understand. We provide a basic translator * ...
4e9727215e95-2044
/const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Document({ pageContent: "Leo DiCaprio gets lost in a dream within a dream within a dream within a ...", meta...
4e9727215e95-2045
/const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year the movie was released", type: "number", }, { name: "director", description: "The director of the movie", type: ...
4e9727215e95-2046
/if ( !process.env.PINECONE_API_KEY || !process.env.PINECONE_ENVIRONMENT || !process.env.PINECONE_INDEX) { throw new Error( "PINECONE_ENVIRONMENT and PINECONE_API_KEY and PINECONE_INDEX must be set" );}const client = new PineconeClient();await client.init({ apiKey: process.env.PINECONE_API_KEY, environment: p...
4e9727215e95-2047
The retriever will automatically convert these questions into queries that can be used to retrieve documents. */const query1 = await selfQueryRetriever.getRelevantDocuments( "Which movies are less than 90 minutes? ");const query2 = await selfQueryRetriever.getRelevantDocuments( "Which movies are rated higher than 8.5...
4e9727215e95-2048
See the official docs for more on how to construct metadata filters. Supabase Self Query Retriever Page Title: Supabase Self Query Retriever | 🦜️🔗 Langchain Paragraphs: Skip to main content🦜️🔗 LangChainDocsUse casesAPILangSmithPython DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData co...
4e9727215e95-2049
RetrieverOn this pageSupabase Self Query RetrieverThis example shows how to use a self query retriever with a Supabase vector store.If you haven't already set up Supabase, please follow the instructions here.Usage​import { createClient } from "@supabase/supabase-js";import { AttributeInfo } from "langchain/schema/query...
4e9727215e95-2050
/const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Document({ pageContent: "Leo DiCaprio gets lost in a dream within a dream within a dream within a ...", meta...
4e9727215e95-2051
/const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year the movie was released", type: "number", }, { name: "director", description: "The director of the movie", type: ...
4e9727215e95-2052
We can ask questions like "Which movies are less than 90 minutes?" or "Which movies are rated higher than 8.5?". * We can also ask questions like "Which movies are either comedy or drama and are less than 90 minutes?". * The retriever will automatically convert these questions into queries that can be used to retrieve ...
4e9727215e95-2053
addition to the generated query:const selfQueryRetriever = await SelfQueryRetriever.fromLLM({ llm, vectorStore, documentContents, attributeInfo, /** * We need to create a basic translator that translates the queries into a * filter format that the vector store can understand. We provide a basic translator * ...
4e9727215e95-2054
Get startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersText embedding modelsVector storesRetrieversHow-toContextual compressionParent Document RetrieverSelf-queryingChroma Self Query RetrieverHNSWLib Self Query RetrieverMemory Vector Store Self Query RetrieverP...
4e9727215e95-2055
Each document has a pageContent and a metadata field. Make sure your metadata matches the AttributeInfo below. */const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Documen...
4e9727215e95-2056
We also provide a description of each attribute and the type of the attribute. * This is used to generate the query prompts. */const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year ...
4e9727215e95-2057
/ structuredQueryTranslator: new SupabaseTranslator(),});/** * Now we can query the vector store. * We can ask questions like "Which movies are less than 90 minutes?" or "Which movies are rated higher than 8.5?". * We can also ask questions like "Which movies are either comedy or drama and are less than 90 minutes?". ...
4e9727215e95-2058
addition to the generated query:const selfQueryRetriever = await SelfQueryRetriever.fromLLM({ llm, vectorStore, documentContents, attributeInfo, /** * We need to create a basic translator that translates the queries into a * filter format that the vector store can understand. We provide a basic translator * ...
4e9727215e95-2059
ModulesData connectionRetrieversHow-toSelf-queryingSupabase Self Query RetrieverOn this pageSupabase Self Query RetrieverThis example shows how to use a self query retriever with a Supabase vector store.If you haven't already set up Supabase, please follow the instructions here.Usage​import { createClient } from "@supa...
4e9727215e95-2060
/const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Document({ pageContent: "Leo DiCaprio gets lost in a dream within a dream within a dream within a ...", meta...
4e9727215e95-2061
/const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year the movie was released", type: "number", }, { name: "director", description: "The director of the movie", type: ...
4e9727215e95-2062
We can ask questions like "Which movies are less than 90 minutes?" or "Which movies are rated higher than 8.5?". * We can also ask questions like "Which movies are either comedy or drama and are less than 90 minutes?". * The retriever will automatically convert these questions into queries that can be used to retrieve ...
4e9727215e95-2063
addition to the generated query:const selfQueryRetriever = await SelfQueryRetriever.fromLLM({ llm, vectorStore, documentContents, attributeInfo, /** * We need to create a basic translator that translates the queries into a * filter format that the vector store can understand. We provide a basic translator * ...
4e9727215e95-2064
ModulesData connectionRetrieversHow-toSelf-queryingSupabase Self Query RetrieverOn this pageSupabase Self Query RetrieverThis example shows how to use a self query retriever with a Supabase vector store.If you haven't already set up Supabase, please follow the instructions here.Usage​import { createClient } from "@supa...
4e9727215e95-2065
/const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Document({ pageContent: "Leo DiCaprio gets lost in a dream within a dream within a dream within a ...", meta...
4e9727215e95-2066
/const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year the movie was released", type: "number", }, { name: "director", description: "The director of the movie", type: ...
4e9727215e95-2067
We can ask questions like "Which movies are less than 90 minutes?" or "Which movies are rated higher than 8.5?". * We can also ask questions like "Which movies are either comedy or drama and are less than 90 minutes?". * The retriever will automatically convert these questions into queries that can be used to retrieve ...
4e9727215e95-2068
addition to the generated query:const selfQueryRetriever = await SelfQueryRetriever.fromLLM({ llm, vectorStore, documentContents, attributeInfo, /** * We need to create a basic translator that translates the queries into a * filter format that the vector store can understand. We provide a basic translator * ...
4e9727215e95-2069
Supabase Self Query RetrieverThis example shows how to use a self query retriever with a Supabase vector store.If you haven't already set up Supabase, please follow the instructions here.Usage​import { createClient } from "@supabase/supabase-js";import { AttributeInfo } from "langchain/schema/query_constructor";import ...
4e9727215e95-2070
/const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Document({ pageContent: "Leo DiCaprio gets lost in a dream within a dream within a dream within a ...", meta...
4e9727215e95-2071
/const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year the movie was released", type: "number", }, { name: "director", description: "The director of the movie", type: ...
4e9727215e95-2072
We can ask questions like "Which movies are less than 90 minutes?" or "Which movies are rated higher than 8.5?". * We can also ask questions like "Which movies are either comedy or drama and are less than 90 minutes?". * The retriever will automatically convert these questions into queries that can be used to retrieve ...
4e9727215e95-2073
addition to the generated query:const selfQueryRetriever = await SelfQueryRetriever.fromLLM({ llm, vectorStore, documentContents, attributeInfo, /** * We need to create a basic translator that translates the queries into a * filter format that the vector store can understand. We provide a basic translator * ...
4e9727215e95-2074
/const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Document({ pageContent: "Leo DiCaprio gets lost in a dream within a dream within a dream within a ...", meta...
4e9727215e95-2075
/const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year the movie was released", type: "number", }, { name: "director", description: "The director of the movie", type: ...
4e9727215e95-2076
We can ask questions like "Which movies are less than 90 minutes?" or "Which movies are rated higher than 8.5?". * We can also ask questions like "Which movies are either comedy or drama and are less than 90 minutes?". * The retriever will automatically convert these questions into queries that can be used to retrieve ...
4e9727215e95-2077
const selfQueryRetriever = await SelfQueryRetriever.fromLLM({ llm, vectorStore, documentContents, attributeInfo, /** * We need to create a basic translator that translates the queries into a * filter format that the vector store can understand. We provide a basic translator * translator here, but you can cre...
4e9727215e95-2078
Self Query RetrieverThis example shows how to use a self query retriever with a Weaviate vector store.If you haven't already set up Weaviate, please follow the instructions here.Usage​This example shows how to intialize a SelfQueryRetriever with a vector store:import weaviate from "weaviate-ts-client";import { Attribut...
4e9727215e95-2079
/const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Document({ pageContent: "Leo DiCaprio gets lost in a dream within a dream within a dream within a ...", meta...
4e9727215e95-2080
/const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year the movie was released", type: "number", }, { name: "director", description: "The director of the movie", type: ...
4e9727215e95-2081
// eslint-disable-next-line @typescript-eslint/no-explicit-any new (weaviate as any).ApiKey(process.env.WEAVIATE_API_KEY) : undefined,});const vectorStore = await WeaviateStore.fromDocuments(docs, embeddings, { client, indexName: "Test", textKey: "text", metadataKeys: ["year", "director", "rating", "genre"]...
4e9727215e95-2082
");const query2 = await selfQueryRetriever.getRelevantDocuments( "Which movies are directed by Greta Gerwig? ");console.log(query1, query2);API Reference:AttributeInfo from langchain/schema/query_constructorDocument from langchain/documentOpenAIEmbeddings from langchain/embeddings/openaiSelfQueryRetriever from langcha...
4e9727215e95-2083
Get startedIntroductionInstallationQuickstartModulesModel I/​OData connectionDocument loadersDocument transformersText embedding modelsVector storesRetrieversHow-toContextual compressionParent Document RetrieverSelf-queryingChroma Self Query RetrieverHNSWLib Self Query RetrieverMemory Vector Store Self Query RetrieverP...
4e9727215e95-2084
You can load your own documents here instead. * Each document has a pageContent and a metadata field. Make sure your metadata matches the AttributeInfo below. */const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7....
4e9727215e95-2085
in this case, we want to be able to query on the genre, year, director, rating, and length of the movie. * We also provide a description of each attribute and the type of the attribute. * This is used to generate the query prompts. */const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The gen...
4e9727215e95-2086
// eslint-disable-next-line @typescript-eslint/no-explicit-any new (weaviate as any).ApiKey(process.env.WEAVIATE_API_KEY) : undefined,});const vectorStore = await WeaviateStore.fromDocuments(docs, embeddings, { client, indexName: "Test", textKey: "text", metadataKeys: ["year", "director", "rating", "genre"]...
4e9727215e95-2087
");const query2 = await selfQueryRetriever.getRelevantDocuments( "Which movies are directed by Greta Gerwig? ");console.log(query1, query2);API Reference:AttributeInfo from langchain/schema/query_constructorDocument from langchain/documentOpenAIEmbeddings from langchain/embeddings/openaiSelfQueryRetriever from langcha...
4e9727215e95-2088
ModulesData connectionRetrieversHow-toSelf-queryingWeaviate Self Query RetrieverOn this pageWeaviate Self Query RetrieverThis example shows how to use a self query retriever with a Weaviate vector store.If you haven't already set up Weaviate, please follow the instructions here.Usage​This example shows how to intialize...
4e9727215e95-2089
/const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Document({ pageContent: "Leo DiCaprio gets lost in a dream within a dream within a dream within a ...", meta...
4e9727215e95-2090
/const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year the movie was released", type: "number", }, { name: "director", description: "The director of the movie", type: ...
4e9727215e95-2091
// eslint-disable-next-line @typescript-eslint/no-explicit-any new (weaviate as any).ApiKey(process.env.WEAVIATE_API_KEY) : undefined,});const vectorStore = await WeaviateStore.fromDocuments(docs, embeddings, { client, indexName: "Test", textKey: "text", metadataKeys: ["year", "director", "rating", "genre"]...
4e9727215e95-2092
");const query2 = await selfQueryRetriever.getRelevantDocuments( "Which movies are directed by Greta Gerwig? ");console.log(query1, query2);API Reference:AttributeInfo from langchain/schema/query_constructorDocument from langchain/documentOpenAIEmbeddings from langchain/embeddings/openaiSelfQueryRetriever from langcha...
4e9727215e95-2093
ModulesData connectionRetrieversHow-toSelf-queryingWeaviate Self Query RetrieverOn this pageWeaviate Self Query RetrieverThis example shows how to use a self query retriever with a Weaviate vector store.If you haven't already set up Weaviate, please follow the instructions here.Usage​This example shows how to intialize...
4e9727215e95-2094
/const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Document({ pageContent: "Leo DiCaprio gets lost in a dream within a dream within a dream within a ...", meta...
4e9727215e95-2095
/const attributeInfo: AttributeInfo[] = [ { name: "genre", description: "The genre of the movie", type: "string or array of strings", }, { name: "year", description: "The year the movie was released", type: "number", }, { name: "director", description: "The director of the movie", type: ...
4e9727215e95-2096
// eslint-disable-next-line @typescript-eslint/no-explicit-any new (weaviate as any).ApiKey(process.env.WEAVIATE_API_KEY) : undefined,});const vectorStore = await WeaviateStore.fromDocuments(docs, embeddings, { client, indexName: "Test", textKey: "text", metadataKeys: ["year", "director", "rating", "genre"]...
4e9727215e95-2097
");const query2 = await selfQueryRetriever.getRelevantDocuments( "Which movies are directed by Greta Gerwig? ");console.log(query1, query2);API Reference:AttributeInfo from langchain/schema/query_constructorDocument from langchain/documentOpenAIEmbeddings from langchain/embeddings/openaiSelfQueryRetriever from langcha...
4e9727215e95-2098
Weaviate Self Query RetrieverThis example shows how to use a self query retriever with a Weaviate vector store.If you haven't already set up Weaviate, please follow the instructions here.Usage​This example shows how to intialize a SelfQueryRetriever with a vector store:import weaviate from "weaviate-ts-client";import {...
4e9727215e95-2099
/const docs = [ new Document({ pageContent: "A bunch of scientists bring back dinosaurs and mayhem breaks loose", metadata: { year: 1993, rating: 7.7, genre: "science fiction" }, }), new Document({ pageContent: "Leo DiCaprio gets lost in a dream within a dream within a dream within a ...", meta...