You can provide those to LangChain in two ways:Include in your environment these three variables: VECTARA_CUSTOMER_ID, VECTARA_CORPUS_ID and VECTARA_API_KEY.For example, you can set these variables using os.environ and getpass as follows:import osimport getpassos.environ["VECTARA_CUSTOMER_ID"] = getpass.getpass("Vectara Customer ID:")os.environ["VECTARA_CORPUS_ID"] = getpass.getpass("Vectara Corpus ID:")os.environ["VECTARA_API_KEY"] = getpass.getpass("Vectara API Key:")Provide them as arguments when creating the Vectara vectorstore object:vectorstore = Vectara(                vectara_customer_id=vectara_customer_id,                vectara_corpus_id=vectara_corpus_id,                vectara_api_key=vectara_api_key            )Connecting to Vectara from LangChain‚ÄãIn this example, we assume that you've created an account and a corpus, and added your VECTARA_CUSTOMER_ID, VECTARA_CORPUS_ID and VECTARA_API_KEY (created with permissions for both indexing and query) as environment variables.The corpus has 3 fields defined as metadata for filtering:url: a string field containing the source URL of the document (where relevant)speech: a string field containing the name of the speechauthor: the name of the authorLet's start by ingesting 3 documents into the corpus:The State of the Union speech from 2022, available in the LangChain repository as a text fileThe "I have a dream" speech by Dr. KindThe "We shall Fight on the Beaches" speech by Winston Churchilfrom langchain.embeddings import FakeEmbeddingsfrom langchain.text_splitter import CharacterTextSplitterfrom langchain.vectorstores import Vectarafrom langchain.document_loaders import TextLoaderfrom langchain.llms import OpenAIfrom langchain.chains import ConversationalRetrievalChainfrom langchain.retrievers.self_query.base import SelfQueryRetrieverfrom langchain.chains.query_constructor.base import AttributeInfoloader = TextLoader("../../modules/state_of_the_union.txt")documents = loader.load()text_splitter =
Vectara is a API platform for building GenAI applications. It provides an easy-to-use API for document indexing and querying that is managed by Vectara and is optimized for performance and accuracy.
Vectara is a API platform for building GenAI applications. It provides an easy-to-use API for document indexing and querying that is managed by Vectara and is optimized for performance and accuracy. ->: You can provide those to LangChain in two ways:Include in your environment these three variables: VECTARA_CUSTOMER_ID, VECTARA_CORPUS_ID and VECTARA_API_KEY.For example, you can set these variables using os.environ and getpass as follows:import osimport getpassos.environ["VECTARA_CUSTOMER_ID"] = getpass.getpass("Vectara Customer ID:")os.environ["VECTARA_CORPUS_ID"] = getpass.getpass("Vectara Corpus ID:")os.environ["VECTARA_API_KEY"] = getpass.getpass("Vectara API Key:")Provide them as arguments when creating the Vectara vectorstore object:vectorstore = Vectara(                vectara_customer_id=vectara_customer_id,                vectara_corpus_id=vectara_corpus_id,                vectara_api_key=vectara_api_key            )Connecting to Vectara from LangChain‚ÄãIn this example, we assume that you've created an account and a corpus, and added your VECTARA_CUSTOMER_ID, VECTARA_CORPUS_ID and VECTARA_API_KEY (created with permissions for both indexing and query) as environment variables.The corpus has 3 fields defined as metadata for filtering:url: a string field containing the source URL of the document (where relevant)speech: a string field containing the name of the speechauthor: the name of the authorLet's start by ingesting 3 documents into the corpus:The State of the Union speech from 2022, available in the LangChain repository as a text fileThe "I have a dream" speech by Dr. KindThe "We shall Fight on the Beaches" speech by Winston Churchilfrom langchain.embeddings import FakeEmbeddingsfrom langchain.text_splitter import CharacterTextSplitterfrom langchain.vectorstores import Vectarafrom langchain.document_loaders import TextLoaderfrom langchain.llms import OpenAIfrom langchain.chains import ConversationalRetrievalChainfrom langchain.retrievers.self_query.base import SelfQueryRetrieverfrom langchain.chains.query_constructor.base import AttributeInfoloader = TextLoader("../../modules/state_of_the_union.txt")documents = loader.load()text_splitter =