You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pinecone.init(
api_key=PINECONE_API_KEY, # find at app.pinecone.io
environment=PINECONE_API_ENV # next to api key in console
)
index_name = "langchaindemo" # put in the name of your pinecone index here
Storing documents and embeddings in a vectorstore
# !pip install tiktoken
docsearch = Pinecone.from_texts([t.page_content for t in texts], embeddings, index_name=index_name)
Do a search on Pinecone
query = "what is included in my health benefit"
docs = docsearch.similarity_search(query, include_metadata=True)
# Here's an example of the first document that was returned
docs[0].page_content[:250]
Use Azure OpenAI
from langchain.llms import AzureOpenAI
# from langchain.llms import OpenAI
from langchain.chains.question_answering import load_qa_chain