Spaces:
Runtime error
Runtime error
small fix
Browse files- pag/monitor.py +13 -0
- utils.py +1 -1
pag/monitor.py
CHANGED
|
@@ -496,11 +496,24 @@ def monitor_fields():
|
|
| 496 |
presence_penalty=0
|
| 497 |
)
|
| 498 |
st.markdown(response.choices[0].message.content)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 499 |
except Exception as e:
|
| 500 |
st.code("Server Error: Could't generate recommendation!")
|
| 501 |
st.error(e)
|
| 502 |
|
| 503 |
|
|
|
|
| 504 |
|
| 505 |
|
| 506 |
|
|
|
|
| 496 |
presence_penalty=0
|
| 497 |
)
|
| 498 |
st.markdown(response.choices[0].message.content)
|
| 499 |
+
|
| 500 |
+
# save the recommendation
|
| 501 |
+
recommendation = response.choices[0].message.content
|
| 502 |
+
recommendation_filename = f'{current_user}_recommendations.md'
|
| 503 |
+
with open(recommendation_filename, 'a') as f:
|
| 504 |
+
f.write(f'\n\n## {field_name} - {datetime.now().strftime("%Y-%m-%d %H:%M:%S")}\n\n')
|
| 505 |
+
f.write(recommendation)
|
| 506 |
+
f.write('\n\n')
|
| 507 |
+
# Dwonload button for the recommendation
|
| 508 |
+
with open(recommendation_filename, 'rb') as f:
|
| 509 |
+
st.download_button('Download Recommendation', f,file_name=recommendation_filename)
|
| 510 |
+
|
| 511 |
except Exception as e:
|
| 512 |
st.code("Server Error: Could't generate recommendation!")
|
| 513 |
st.error(e)
|
| 514 |
|
| 515 |
|
| 516 |
+
|
| 517 |
|
| 518 |
|
| 519 |
|
utils.py
CHANGED
|
@@ -25,7 +25,7 @@ NEW_TOKEN_INSTRUCTIONS="""<div style="background-color: #e6f2ff; padding: 20px;
|
|
| 25 |
To get an API token for the SNET platform:
|
| 26 |
<ol>
|
| 27 |
<li>Purchase tokens on the SNET platform using AGIX</li>
|
| 28 |
-
<li> <del> Input the email address you used to sign up for the dashboard </del>. Any
|
| 29 |
<li>An API token will be generated for you</li>
|
| 30 |
</ol>
|
| 31 |
|
|
|
|
| 25 |
To get an API token for the SNET platform:
|
| 26 |
<ol>
|
| 27 |
<li>Purchase tokens on the SNET platform using AGIX</li>
|
| 28 |
+
<li> <del> Input the email address you used to sign up for the dashboard </del>. Any email will work for testing purposes</li>
|
| 29 |
<li>An API token will be generated for you</li>
|
| 30 |
</ol>
|
| 31 |
|