langchain.llms import OpenAIimport osimport getpassos.environ["OPENAI_API_KEY"] = getpass.getpass("OpenAI API Key:")    OpenAI API Key:¬∑¬∑¬∑¬∑¬∑¬∑¬∑¬∑with open("../../modules/state_of_the_union.txt") as f:    state_of_the_union = f.read()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)texts = text_splitter.split_text(state_of_the_union)index_name = "langchain-qa-with-retrieval"docsearch = Marqo.from_documents(docs, index_name=index_name)    Index langchain-qa-with-retrieval exists.chain = RetrievalQAWithSourcesChain.from_chain_type(    OpenAI(temperature=0), chain_type="stuff", retriever=docsearch.as_retriever())chain(    {"question": "What did the president say about Justice Breyer"},    return_only_outputs=True,)    {'answer': ' The president honored Justice Breyer, thanking him for his service and noting that he is a retiring Justice of the United States Supreme Court.\n',     'sources': '../../../state_of_the_union.txt'}PreviousLLMRailsNextGoogle Vertex AI MatchingEngineAdditional featuresWeighted QueriesCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
This notebook shows how to use functionality related to the Marqo vectorstore.
This notebook shows how to use functionality related to the Marqo vectorstore. ->: langchain.llms import OpenAIimport osimport getpassos.environ["OPENAI_API_KEY"] = getpass.getpass("OpenAI API Key:")    OpenAI API Key:¬∑¬∑¬∑¬∑¬∑¬∑¬∑¬∑with open("../../modules/state_of_the_union.txt") as f:    state_of_the_union = f.read()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)texts = text_splitter.split_text(state_of_the_union)index_name = "langchain-qa-with-retrieval"docsearch = Marqo.from_documents(docs, index_name=index_name)    Index langchain-qa-with-retrieval exists.chain = RetrievalQAWithSourcesChain.from_chain_type(    OpenAI(temperature=0), chain_type="stuff", retriever=docsearch.as_retriever())chain(    {"question": "What did the president say about Justice Breyer"},    return_only_outputs=True,)    {'answer': ' The president honored Justice Breyer, thanking him for his service and noting that he is a retiring Justice of the United States Supreme Court.\n',     'sources': '../../../state_of_the_union.txt'}PreviousLLMRailsNextGoogle Vertex AI MatchingEngineAdditional featuresWeighted QueriesCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.