Leiyan525 commited on
Commit
c64eb1f
·
1 Parent(s): 1003f8b

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import openai
2
+ from llama_index import SimpleDirectoryReader, VectorStoreIndex
3
+
4
+ openai.api_key = openai_apikey
5
+
6
+
7
+ def up_file(files):
8
+ Doc_text_list = []
9
+ for file in emunerate(files):
10
+ print(file.name)
11
+ receipts_index = VectorStoreIndex.from_documents(file)
12
+ query_engine = receipts_index.as_query_engine()
13
+ receipts_response = query_engine.query(message)
14
+ return receipts_response