Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ token = 4096
|
|
8 |
st.set_page_config(page_title="Daily Reminder", page_icon=":bar_chart:")
|
9 |
|
10 |
openai.api_key = st.secrets['OPENAI_API_KEY']
|
11 |
-
|
12 |
|
13 |
st.title('Daily Reminder')
|
14 |
|
@@ -41,12 +41,11 @@ if st.session_state['usage_count'] < max_uses:
|
|
41 |
if st.button("Generate a daily reminder", key="en_generate_quote"):
|
42 |
# Create a prompt based on the user input
|
43 |
en_prompt = f"""
|
44 |
-
- Task:
|
45 |
-
|
46 |
- Feeling: {en_input_topic}.
|
47 |
- Reason for the feeling: {en_input_reason}.
|
48 |
- Plan for the day: {en_input_plan}.
|
49 |
-
- Guidelines: Aim for quotes that are less commonly cited or consider a variety of cultural or historical sources to enhance diversity in selections.
|
50 |
"""
|
51 |
# Make a request to the API to generate text
|
52 |
en_response = openai.ChatCompletion.create(
|
@@ -81,11 +80,11 @@ if st.session_state['usage_count'] < max_uses:
|
|
81 |
if st.button("ไปๆฅใฎๅ่จใ็ๆใใ", key="ja_generate_quote"):
|
82 |
# Create a prompt based on the user input
|
83 |
ja_prompt = f"""
|
84 |
-
- Task: {
|
|
|
85 |
- Feeling: {ja_input_topic}.
|
86 |
- Reason for the feeling: {ja_input_reason}.
|
87 |
- Plan for the day: {ja_input_plan}.
|
88 |
-
- Guidelines: Aim for quotes that are less commonly cited or consider a variety of cultural or historical sources to enhance diversity in selections.
|
89 |
"""
|
90 |
# Make a request to the API to generate text
|
91 |
ja_response = openai.ChatCompletion.create(
|
@@ -107,4 +106,4 @@ st.markdown(
|
|
107 |
</style>
|
108 |
""",
|
109 |
unsafe_allow_html=True,
|
110 |
-
)
|
|
|
8 |
st.set_page_config(page_title="Daily Reminder", page_icon=":bar_chart:")
|
9 |
|
10 |
openai.api_key = st.secrets['OPENAI_API_KEY']
|
11 |
+
prompt = st.secrets['PROMPT_DAILY_REMINDER']
|
12 |
|
13 |
st.title('Daily Reminder')
|
14 |
|
|
|
41 |
if st.button("Generate a daily reminder", key="en_generate_quote"):
|
42 |
# Create a prompt based on the user input
|
43 |
en_prompt = f"""
|
44 |
+
- Task: {prompt}.
|
45 |
+
- Output language: Japanese.
|
46 |
- Feeling: {en_input_topic}.
|
47 |
- Reason for the feeling: {en_input_reason}.
|
48 |
- Plan for the day: {en_input_plan}.
|
|
|
49 |
"""
|
50 |
# Make a request to the API to generate text
|
51 |
en_response = openai.ChatCompletion.create(
|
|
|
80 |
if st.button("ไปๆฅใฎๅ่จใ็ๆใใ", key="ja_generate_quote"):
|
81 |
# Create a prompt based on the user input
|
82 |
ja_prompt = f"""
|
83 |
+
- Task: {prompt}
|
84 |
+
- Output language: Japanese.
|
85 |
- Feeling: {ja_input_topic}.
|
86 |
- Reason for the feeling: {ja_input_reason}.
|
87 |
- Plan for the day: {ja_input_plan}.
|
|
|
88 |
"""
|
89 |
# Make a request to the API to generate text
|
90 |
ja_response = openai.ChatCompletion.create(
|
|
|
106 |
</style>
|
107 |
""",
|
108 |
unsafe_allow_html=True,
|
109 |
+
)
|