Skip to content

Commit

Permalink
Fold Accordions (#73)
Browse files Browse the repository at this point in the history
* changed tab order

* folded accordion except essential info
  • Loading branch information
Jasonqi146 authored May 1, 2024
1 parent 7df27b3 commit e140a93
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions sotopia_space/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def create_bot_goal(environment_dropdown):
def sotopia_info_accordion(accordion_visible=True):
environments, _, _, _ = get_sotopia_profiles()

with gr.Accordion("Create your sotopia space!", open=accordion_visible):
with gr.Accordion("Create your sotopia space!", open=False, visible=accordion_visible):
with gr.Row():
environment_dropdown = gr.Dropdown(
choices=environments,
Expand All @@ -183,6 +183,10 @@ def sotopia_info_accordion(accordion_visible=True):
with gr.Row():
user_agent_dropdown = create_user_agent_dropdown(environment_dropdown.value)
bot_agent_dropdown = create_bot_agent_dropdown(environment_dropdown.value, user_agent_dropdown.value)

with gr.Row():
user_agent_info_display = create_user_info(user_agent_dropdown.value)
bot_agent_info_display = create_bot_info(bot_agent_dropdown.value)

with gr.Accordion("Check your social task!", open=accordion_visible):

Expand All @@ -193,11 +197,6 @@ def sotopia_info_accordion(accordion_visible=True):
user_goal_display = create_user_goal(environment_dropdown.value)



with gr.Row():
bot_agent_info_display = create_bot_info(bot_agent_dropdown.value)
user_agent_info_display = create_user_info(user_agent_dropdown.value)

# Update user dropdown when scenario changes
environment_dropdown.change(fn=create_user_agent_dropdown, inputs=[environment_dropdown], outputs=[user_agent_dropdown])
# Update bot dropdown when user or scenario changes
Expand Down

0 comments on commit e140a93

Please sign in to comment.