Spaces:
Running
Running
Commit
·
55035d6
1
Parent(s):
5b17165
update set api keys
Browse files
app.py
CHANGED
|
@@ -1237,8 +1237,6 @@ def render_expense_report_summary():
|
|
| 1237 |
)
|
| 1238 |
st.plotly_chart(cost_pie_chart, use_container_width=True)
|
| 1239 |
|
| 1240 |
-
|
| 1241 |
-
|
| 1242 |
st.subheader('Proportion of Total Cost by API Version')
|
| 1243 |
cost_labels = []
|
| 1244 |
cost_proportions = []
|
|
@@ -1288,31 +1286,6 @@ def sidebar_content():
|
|
| 1288 |
except:
|
| 1289 |
st.header('Expense Report Summary')
|
| 1290 |
st.write('Available after first run...')
|
| 1291 |
-
|
| 1292 |
-
# # Check if the expense summary is available in the session state
|
| 1293 |
-
# if 'expense' not in st.session_state or st.session_state.expense is None:
|
| 1294 |
-
# st.sidebar.write('No expense report data available.')
|
| 1295 |
-
# return
|
| 1296 |
-
|
| 1297 |
-
# # Retrieve the expense report summary
|
| 1298 |
-
# expense_summary = st.session_state.expense
|
| 1299 |
-
|
| 1300 |
-
# # Display the expense report summary
|
| 1301 |
-
# st.sidebar.markdown('**Run Count**: ' + str(expense_summary['run_count']))
|
| 1302 |
-
|
| 1303 |
-
# # API version usage percentages
|
| 1304 |
-
# st.sidebar.markdown('**API Version Usage**:')
|
| 1305 |
-
# for version, percentage in expense_summary['api_version_percentages'].items():
|
| 1306 |
-
# st.sidebar.markdown(f'- {version}: {percentage:.2f}%')
|
| 1307 |
-
|
| 1308 |
-
# # Summary of costs and tokens
|
| 1309 |
-
# st.sidebar.markdown('**Total Cost**: $' + str(round(expense_summary['total_cost_sum'], 4)))
|
| 1310 |
-
# st.sidebar.markdown('**Tokens In**: ' + str(expense_summary['tokens_in_sum']))
|
| 1311 |
-
# st.sidebar.markdown('**Tokens Out**: ' + str(expense_summary['tokens_out_sum']))
|
| 1312 |
-
# # st.sidebar.markdown('**Rate In**: $' + str(round(expense_summary['rate_in_sum'], 2)) + ' per 1000 tokens')
|
| 1313 |
-
# # st.sidebar.markdown('**Rate Out**: $' + str(round(expense_summary['rate_out_sum'], 2)) + ' per 1000 tokens')
|
| 1314 |
-
# st.sidebar.markdown('**Cost In**: $' + str(round(expense_summary['cost_in_sum'], 4)))
|
| 1315 |
-
# st.sidebar.markdown('**Cost Out**: $' + str(round(expense_summary['cost_out_sum'], 4)))
|
| 1316 |
|
| 1317 |
def main():
|
| 1318 |
with st.sidebar:
|
|
@@ -1320,8 +1293,8 @@ def main():
|
|
| 1320 |
# Main App
|
| 1321 |
content_header()
|
| 1322 |
|
| 1323 |
-
|
| 1324 |
-
tab_settings, tab_prompt, tab_domain, tab_component, tab_processing, tab_delete = st.tabs(["Project Settings", "Prompt Builder", "Domain Knowledge","Component Detector", "Processing Options", "Space-Saver"])
|
| 1325 |
|
| 1326 |
with tab_settings:
|
| 1327 |
content_tab_settings()
|
|
@@ -1340,10 +1313,10 @@ def main():
|
|
| 1340 |
with tab_processing:
|
| 1341 |
content_tab_processing()
|
| 1342 |
|
| 1343 |
-
|
| 1344 |
-
|
| 1345 |
-
|
| 1346 |
-
|
| 1347 |
|
| 1348 |
with tab_delete:
|
| 1349 |
create_space_saver()
|
|
@@ -1381,7 +1354,7 @@ if 'zip_filepath' not in st.session_state:
|
|
| 1381 |
# create_private_file()
|
| 1382 |
if st.session_state.proceed_to_build_llm_prompt:
|
| 1383 |
build_LLM_prompt_config()
|
| 1384 |
-
|
| 1385 |
-
|
| 1386 |
elif st.session_state.proceed_to_main:
|
| 1387 |
main()
|
|
|
|
| 1237 |
)
|
| 1238 |
st.plotly_chart(cost_pie_chart, use_container_width=True)
|
| 1239 |
|
|
|
|
|
|
|
| 1240 |
st.subheader('Proportion of Total Cost by API Version')
|
| 1241 |
cost_labels = []
|
| 1242 |
cost_proportions = []
|
|
|
|
| 1286 |
except:
|
| 1287 |
st.header('Expense Report Summary')
|
| 1288 |
st.write('Available after first run...')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1289 |
|
| 1290 |
def main():
|
| 1291 |
with st.sidebar:
|
|
|
|
| 1293 |
# Main App
|
| 1294 |
content_header()
|
| 1295 |
|
| 1296 |
+
tab_settings, tab_prompt, tab_domain, tab_component, tab_processing, tab_private, tab_delete = st.tabs(["Project Settings", "Prompt Builder", "Domain Knowledge","Component Detector", "Processing Options", "API Keys", "Space-Saver"])
|
| 1297 |
+
# tab_settings, tab_prompt, tab_domain, tab_component, tab_processing, tab_delete = st.tabs(["Project Settings", "Prompt Builder", "Domain Knowledge","Component Detector", "Processing Options", "Space-Saver"])
|
| 1298 |
|
| 1299 |
with tab_settings:
|
| 1300 |
content_tab_settings()
|
|
|
|
| 1313 |
with tab_processing:
|
| 1314 |
content_tab_processing()
|
| 1315 |
|
| 1316 |
+
with tab_private:
|
| 1317 |
+
if st.button("Edit API Keys"):
|
| 1318 |
+
st.session_state.proceed_to_private = True
|
| 1319 |
+
st.rerun()
|
| 1320 |
|
| 1321 |
with tab_delete:
|
| 1322 |
create_space_saver()
|
|
|
|
| 1354 |
# create_private_file()
|
| 1355 |
if st.session_state.proceed_to_build_llm_prompt:
|
| 1356 |
build_LLM_prompt_config()
|
| 1357 |
+
elif st.session_state.proceed_to_private:
|
| 1358 |
+
create_private_file()
|
| 1359 |
elif st.session_state.proceed_to_main:
|
| 1360 |
main()
|