Spaces:
Sleeping
Sleeping
Clicking Create research prompt switches to the Chat tab.
Browse files- ui/intake/panel.py +34 -3
- ui/workspace.py +3 -3
ui/intake/panel.py
CHANGED
|
@@ -33,7 +33,38 @@ def _searchable_dropdown(
|
|
| 33 |
)
|
| 34 |
|
| 35 |
|
| 36 |
-
def
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
countries = country_choices()
|
| 38 |
|
| 39 |
with gr.Column(elem_classes=["borderless-form-panel"]):
|
|
@@ -93,7 +124,7 @@ def render_intake_panel(chat_input: gr.MultimodalTextbox) -> None:
|
|
| 93 |
),
|
| 94 |
)
|
| 95 |
gr.Button("Create research prompt", variant="primary").click(
|
| 96 |
-
fn=
|
| 97 |
inputs=[
|
| 98 |
citizenship,
|
| 99 |
current_country,
|
|
@@ -107,6 +138,6 @@ def render_intake_panel(chat_input: gr.MultimodalTextbox) -> None:
|
|
| 107 |
timeline,
|
| 108 |
goals,
|
| 109 |
],
|
| 110 |
-
outputs=chat_input,
|
| 111 |
queue=False,
|
| 112 |
)
|
|
|
|
| 33 |
)
|
| 34 |
|
| 35 |
|
| 36 |
+
def _create_research_prompt_and_open_chat(
|
| 37 |
+
citizenship,
|
| 38 |
+
current_country,
|
| 39 |
+
residence_status,
|
| 40 |
+
education,
|
| 41 |
+
occupation,
|
| 42 |
+
experience,
|
| 43 |
+
languages,
|
| 44 |
+
budget,
|
| 45 |
+
family,
|
| 46 |
+
timeline,
|
| 47 |
+
goals,
|
| 48 |
+
):
|
| 49 |
+
return build_profile_prompt(
|
| 50 |
+
citizenship,
|
| 51 |
+
current_country,
|
| 52 |
+
residence_status,
|
| 53 |
+
education,
|
| 54 |
+
occupation,
|
| 55 |
+
experience,
|
| 56 |
+
languages,
|
| 57 |
+
budget,
|
| 58 |
+
family,
|
| 59 |
+
timeline,
|
| 60 |
+
goals,
|
| 61 |
+
), gr.update(selected="chat")
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
def render_intake_panel(
|
| 65 |
+
chat_input: gr.MultimodalTextbox,
|
| 66 |
+
workspace_tabs: gr.Tabs,
|
| 67 |
+
) -> None:
|
| 68 |
countries = country_choices()
|
| 69 |
|
| 70 |
with gr.Column(elem_classes=["borderless-form-panel"]):
|
|
|
|
| 124 |
),
|
| 125 |
)
|
| 126 |
gr.Button("Create research prompt", variant="primary").click(
|
| 127 |
+
fn=_create_research_prompt_and_open_chat,
|
| 128 |
inputs=[
|
| 129 |
citizenship,
|
| 130 |
current_country,
|
|
|
|
| 138 |
timeline,
|
| 139 |
goals,
|
| 140 |
],
|
| 141 |
+
outputs=[chat_input, workspace_tabs],
|
| 142 |
queue=False,
|
| 143 |
)
|
ui/workspace.py
CHANGED
|
@@ -45,10 +45,10 @@ def create_main_workspace(
|
|
| 45 |
min_width=360,
|
| 46 |
elem_classes=["borderless-chat-panel"],
|
| 47 |
):
|
| 48 |
-
with gr.Tabs(elem_classes=["borderless-tabs"]):
|
| 49 |
with gr.Tab("Form"):
|
| 50 |
-
render_intake_panel(chat_input)
|
| 51 |
-
with gr.Tab("Chat"):
|
| 52 |
chat = SidebarChatInterface(
|
| 53 |
respond,
|
| 54 |
multimodal=True,
|
|
|
|
| 45 |
min_width=360,
|
| 46 |
elem_classes=["borderless-chat-panel"],
|
| 47 |
):
|
| 48 |
+
with gr.Tabs(elem_classes=["borderless-tabs"]) as workspace_tabs:
|
| 49 |
with gr.Tab("Form"):
|
| 50 |
+
render_intake_panel(chat_input, workspace_tabs)
|
| 51 |
+
with gr.Tab("Chat", id="chat"):
|
| 52 |
chat = SidebarChatInterface(
|
| 53 |
respond,
|
| 54 |
multimodal=True,
|