-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
VECTARA_CUSTOMER_ID = 2764105130 | ||
VECTARA_CORPUS_ID = 2 | ||
VECTARA_API_KEY = zwt_pMDlqgvsbKUz6D3Sql7sFRc_AqLWw_eoBNiC0g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import os | ||
from dotenv import load_dotenv | ||
from langchain_openai import ChatOpenAI | ||
from langchain_community.vectorstores import Vectara | ||
from langchain_community.document_loaders import S3DirectoryLoader | ||
from langchain.chains import ConversationalRetrievalChain | ||
from langchain.memory import ConversationBufferMemory | ||
load_dotenv() | ||
llm=ChatOpenAI(model="gpt-4-turbo-preview",temperature=0.0) | ||
memory=ConversationBufferMemory(memory_key="chat_history",return_messages=True) | ||
|
||
vs=Vectara(vectara_customer_id=os.getenv("VECTARA_CUSTOMER_ID"), | ||
vectara_corpus_id=os.getenv("VECTARA_CORPUS_ID"), | ||
vectara_api_key=os.getenv("VECTARA_API_KEY") | ||
) | ||
loader=S3DirectoryLoader("llm-test-2024") | ||
doc=loader.load() | ||
|
||
vectara=Vectara.from_documents(doc,embedding=None) | ||
retriever=vectara.as_retriever() | ||
bot=ConversationalRetrievalChain.from_llm(llm,retriever,memory=memory,verbose=False) | ||
result=bot.invoke({"What early civilizations in Greece were influential in shaping Western culture?"}) | ||
print(result["answer"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
### Questions on the History of Greece: | ||
|
||
1. What early civilizations in Greece were influential in shaping Western culture? | ||
2. Who were some of the prominent figures during the Classical period in Greece? | ||
3. Which monumental architectural achievement is associated with the Classical period in Greece? | ||
4. Describe the sequence of dominations Greece went through after the Classical era. | ||
5. How and when did the modern nation of Greece emerge? | ||
|
||
### Questions on the History of India: | ||
|
||
1. Which civilization is considered one of the world's earliest urban cultures in India? | ||
2. What was the significance of the Vedic period in India? | ||
3. Which empires are considered the golden ages of ancient India? | ||
4. What major changes occurred during Medieval India? | ||
5. How did India achieve independence from British rule? |
Binary file not shown.