Skip to content

Commit 8d4a3d4

Browse files
committed
update
Signed-off-by: eric-epsilla <eric@epsilla.com>
1 parent e937ad9 commit 8d4a3d4

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

examples/Question_Answering_Pipeline_with_LangChain_and_EpsillaCloud.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# Step2. Configure the OpenAI API Key
1818
import os
1919

20-
os.environ["OPENAI_API_KEY"] = "Your-OpenAI-API-Key"
20+
# os.environ["OPENAI_API_KEY"] = "Your-OpenAI-API-Key"
2121
epsilla_api_key = os.getenv("EPSILLA_API_KEY", "Your-Epsilla-API-Key")
2222
project_id = os.getenv("EPSILLA_PROJECT_ID", "Your-Project-ID")
2323
db_id = os.getenv("EPSILLA_DB_ID", "Your-DB-ID")
@@ -29,9 +29,13 @@
2929
from langchain.text_splitter import CharacterTextSplitter
3030
from langchain_openai import OpenAIEmbeddings
3131

32-
loader = WebBaseLoader("https://raw.githubusercontent.com/hwchase17/chat-your-data/master/state_of_the_union.txt")
32+
loader = WebBaseLoader(
33+
"https://raw.githubusercontent.com/hwchase17/chat-your-data/master/state_of_the_union.txt"
34+
)
3335
documents = loader.load()
34-
documents = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0).split_documents(documents)
36+
documents = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0).split_documents(
37+
documents
38+
)
3539
embeddings = OpenAIEmbeddings()
3640

3741

@@ -61,6 +65,12 @@
6165
collection_name=table_name,
6266
)
6367

68+
# query = "What did the president say about Ketanji Brown Jackson"
69+
# docs = vector_store.similarity_search(query)
70+
# print(docs[0].page_content)
71+
72+
73+
6474
# Step4. Create the QA for Retrieval
6575
from langchain.chains import RetrievalQA
6676
from langchain_openai import OpenAI

0 commit comments

Comments
 (0)