Skip to content

Commit c91be42

Browse files
committed
add Question_Answering_Pipeline_with_LangChain_and_Epsilla
Signed-off-by: eric-epsilla <eric@epsilla.com>
1 parent b446892 commit c91be42

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

examples/Question_Answering_Pipeline_with_LangChain_and_Epsilla.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,32 @@
3535
embeddings = OpenAIEmbeddings()
3636

3737

38+
39+
3840
# Step4. Load the vector store
3941
from langchain.vectorstores import Epsilla
4042
from pyepsilla import vectordb
4143

42-
client = vectordb.Client(protocol="https", host="demo.epsilla.com", port="443")
44+
db_client = vectordb.Client(protocol="https", host="demo.epsilla.com", port="443")
4345

44-
status_code, response = client.load_db("MyDB", "/data/MyDB")
46+
status_code, response = db_client.load_db("MyDB", "/data/MyDB")
4547
print(status_code, response)
4648

4749
vector_store = Epsilla.from_documents(
4850
documents,
4951
embeddings,
50-
client,
52+
db_client,
5153
db_path="/data/MyDB",
5254
db_name="MyDB",
5355
collection_name="MyCollection",
5456
)
5557

58+
5659
# Step4. Create the QA for Retrieval
5760
from langchain.chains import RetrievalQA
5861
from langchain_openai import OpenAI
5962

63+
6064
qa = RetrievalQA.from_chain_type(
6165
llm=OpenAI(), chain_type="stuff", retriever=vector_store.as_retriever()
6266
)

0 commit comments

Comments
 (0)