Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -114,7 +114,7 @@ def verify_team(team_name: str):
|
|
| 114 |
)
|
| 115 |
|
| 116 |
|
| 117 |
-
def answer_prompt(prompt: str):
|
| 118 |
prompt = prompt.strip()
|
| 119 |
|
| 120 |
if not prompt:
|
|
@@ -127,6 +127,10 @@ def answer_prompt(prompt: str):
|
|
| 127 |
|
| 128 |
reply = generate_response(prompt)
|
| 129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
result = supabase.table("submissions").insert({
|
| 131 |
"team_id": TEAM["id"],
|
| 132 |
"prompt": prompt,
|
|
@@ -212,7 +216,7 @@ def main():
|
|
| 212 |
|
| 213 |
submit_button.click(
|
| 214 |
answer_prompt,
|
| 215 |
-
inputs=[prompt_box],
|
| 216 |
outputs=[
|
| 217 |
response_box,
|
| 218 |
submit_button,
|
|
|
|
| 114 |
)
|
| 115 |
|
| 116 |
|
| 117 |
+
def answer_prompt(prompt: str, team_name: str):
|
| 118 |
prompt = prompt.strip()
|
| 119 |
|
| 120 |
if not prompt:
|
|
|
|
| 127 |
|
| 128 |
reply = generate_response(prompt)
|
| 129 |
|
| 130 |
+
teams = load_registered_teams()
|
| 131 |
+
TEAM = teams.get(team_name.strip().casefold())
|
| 132 |
+
print(TEAM)
|
| 133 |
+
|
| 134 |
result = supabase.table("submissions").insert({
|
| 135 |
"team_id": TEAM["id"],
|
| 136 |
"prompt": prompt,
|
|
|
|
| 216 |
|
| 217 |
submit_button.click(
|
| 218 |
answer_prompt,
|
| 219 |
+
inputs=[prompt_box, team_name],
|
| 220 |
outputs=[
|
| 221 |
response_box,
|
| 222 |
submit_button,
|