# ui/diagnoser_tab.py
import gradio as gr
from app.ui.common import update_exercise_format, update_response_textboxes_amount
from config.llm_config import llms
def build_diagnoser_tab():
"""
Builds and returns the Diagnoser tab UI elements (and any references).
"""
with gr.TabItem("🩺 Diagnose Exercise"):
# Insert an HTML info icon with a tooltip at the top of the tab content.
gr.HTML(
"""
ℹ️ ←
"""
)
# Create a row for the control dropdowns: LLM selection, exercise format, sampling count etc.
with gr.Row():
model_choice_diagnose = gr.Dropdown(
choices=list(llms.keys()),
value="GPT-4o (low temp)",
label="Select LLM",
interactive=True,
)
exercise_format_diagnose = gr.Dropdown(
choices=["Markdown", "XML", "Plaintext", "Raw (input not reformatted)"],
value="Markdown",
label="Exercise Reformat",
interactive=True,
)
sampling_count_diagnose = gr.Dropdown(
choices=["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"],
value="1",
label="Response Count",
interactive=True,
)
# The user input
diagnoser_input = gr.Textbox(label="Enter exercise in any format",
placeholder="Exercise body: