Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -69,19 +69,17 @@ def app():
|
|
| 69 |
|
| 70 |
if st.button('Submit'):
|
| 71 |
sections_string = "\n".join(st.session_state['data'].apply(lambda row: f"{row['Section']},{row['Phone Number']},{row['Email']}", axis=1))
|
| 72 |
-
messages = [
|
| 73 |
-
|
| 74 |
-
if organization_name:
|
| 75 |
-
messages.append({'role': 'system', 'content': f"Welcome to {organization_name} Front Desk!"})
|
| 76 |
-
|
| 77 |
-
messages = messages.extend([
|
| 78 |
{'role': 'system', 'content': f"""you are a psychology advisor that works for an NGO called {organization_name}.
|
| 79 |
your job is to redirect people to relevant sections in the organization after you analyze their psychological status
|
| 80 |
through a short friendly conversation. Below are the sections inside the organization you will redirect them according to the severity of their case or depending on the need\n\n
|
| 81 |
{sections_string}
|
| 82 |
"""},
|
| 83 |
{"role": "user", "content": user_input}
|
| 84 |
-
]
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
completion = openai.Completion.create(
|
| 87 |
model='gpt-4',
|
|
|
|
| 69 |
|
| 70 |
if st.button('Submit'):
|
| 71 |
sections_string = "\n".join(st.session_state['data'].apply(lambda row: f"{row['Section']},{row['Phone Number']},{row['Email']}", axis=1))
|
| 72 |
+
messages = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
{'role': 'system', 'content': f"""you are a psychology advisor that works for an NGO called {organization_name}.
|
| 74 |
your job is to redirect people to relevant sections in the organization after you analyze their psychological status
|
| 75 |
through a short friendly conversation. Below are the sections inside the organization you will redirect them according to the severity of their case or depending on the need\n\n
|
| 76 |
{sections_string}
|
| 77 |
"""},
|
| 78 |
{"role": "user", "content": user_input}
|
| 79 |
+
]
|
| 80 |
+
|
| 81 |
+
if organization_name:
|
| 82 |
+
messages.append({'role': 'system', 'content': f"Welcome to {organization_name} Front Desk!"})
|
| 83 |
|
| 84 |
completion = openai.Completion.create(
|
| 85 |
model='gpt-4',
|