markytools commited on
Commit
95e937e
·
1 Parent(s): 2eda81a

updated pom file

Browse files
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -109,6 +109,19 @@ if st.button(chatWithPDFButton, disabled=not enableChatBox and not chatTextStr):
109
  st.write(pdf_answer)
110
 
111
  elif genre==radioButtonList[3]: # Google Alphabet URL Earnings Report
112
- pass
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  elif genre==radioButtonList[4]: # Custom URL
114
  pass
 
109
  st.write(pdf_answer)
110
 
111
  elif genre==radioButtonList[3]: # Google Alphabet URL Earnings Report
112
+
113
+ urls = ['https://www.sec.gov/Archives/edgar/data/1652044/000165204422000071/goog-20220630.htm',]
114
+ loader = [UnstructuredURLLoader(urls=urls)]
115
+ index = VectorstoreIndexCreator(
116
+ embedding=GooglePalmEmbeddings(),
117
+ text_splitter=CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)).from_loaders(loader)
118
+
119
+ chain = RetrievalQA.from_chain_type(llm=llm,
120
+ chain_type="stuff",
121
+ retriever=index.vectorstore.as_retriever(),
122
+ input_key="question")
123
+ answer = chain.run(chatTextStr)
124
+ st.write(answer)
125
+
126
  elif genre==radioButtonList[4]: # Custom URL
127
  pass