Update app.py
Browse files
app.py
CHANGED
@@ -50,15 +50,15 @@ import PyPDF2 ## read the local_KB PDF file.
|
|
50 |
import save_database_info
|
51 |
from datetime import datetime
|
52 |
|
53 |
-
os.environ["OPENAI_API_KEY"] =
|
54 |
-
openai.api_key =
|
55 |
# os.environ["VERBOSE"] = "True" # 可以看到具体的错误?
|
56 |
|
57 |
#* 如果碰到接口问题,可以启用如下设置。
|
58 |
-
openai.proxy = {
|
59 |
-
|
60 |
-
|
61 |
-
}
|
62 |
|
63 |
|
64 |
# layout settings.
|
@@ -146,7 +146,7 @@ def clear_all():
|
|
146 |
|
147 |
# return None
|
148 |
|
149 |
-
bing_search_api_key = '
|
150 |
bing_search_endpoint = 'https://api.bing.microsoft.com/v7.0/search'
|
151 |
|
152 |
def search(query):
|
@@ -403,8 +403,8 @@ async def data_mode():
|
|
403 |
print('user_request: \n', user_request)
|
404 |
|
405 |
# 加载上传的文件,主要路径在上面代码中。
|
406 |
-
|
407 |
-
files = [File.from_path("/Users/yunshi/Downloads/360Data/Data Center/Working-On Task/演讲与培训/2023ChatGPT/Coding/code_interpreter/rawdata/short_csv.csv")]
|
408 |
st.write(pd.DataFrame(files))
|
409 |
# print('session.__init__', session.__init__)
|
410 |
# print('session', session.__init__)
|
|
|
50 |
import save_database_info
|
51 |
from datetime import datetime
|
52 |
|
53 |
+
os.environ["OPENAI_API_KEY"] = os.environ['user_token']
|
54 |
+
openai.api_key = os.environ['user_token']
|
55 |
# os.environ["VERBOSE"] = "True" # 可以看到具体的错误?
|
56 |
|
57 |
#* 如果碰到接口问题,可以启用如下设置。
|
58 |
+
# openai.proxy = {
|
59 |
+
# "http": "http://127.0.0.1:7890",
|
60 |
+
# "https": "http://127.0.0.1:7890"
|
61 |
+
# }
|
62 |
|
63 |
|
64 |
# layout settings.
|
|
|
146 |
|
147 |
# return None
|
148 |
|
149 |
+
bing_search_api_key = os.environ['bing_api_key']
|
150 |
bing_search_endpoint = 'https://api.bing.microsoft.com/v7.0/search'
|
151 |
|
152 |
def search(query):
|
|
|
403 |
print('user_request: \n', user_request)
|
404 |
|
405 |
# 加载上传的文件,主要路径在上面代码中。
|
406 |
+
files = [File.from_path(str(uploaded_file_path))]
|
407 |
+
# files = [File.from_path("/Users/yunshi/Downloads/360Data/Data Center/Working-On Task/演讲与培训/2023ChatGPT/Coding/code_interpreter/rawdata/short_csv.csv")]
|
408 |
st.write(pd.DataFrame(files))
|
409 |
# print('session.__init__', session.__init__)
|
410 |
# print('session', session.__init__)
|