Fix chat defaults #46

Merged
Berack96 merged 5 commits from fix-chat-default-model into main 2025-10-27 12:41:50 +01:00
Showing only changes of commit 225de09ec3 - Show all commits

View File

@@ -83,13 +83,15 @@ class ChatManager:
label="Modello da usare"
copilot-pull-request-reviewer[bot] commented 2025-10-24 18:38:23 +02:00 (Migrated from github.com)
Review

Setting value directly on a Gradio component after creation may not update the displayed default. Consider using the value parameter in the gr.Dropdown() constructor instead: value=self.inputs.team_leader_model.label.

Setting `value` directly on a Gradio component after creation may not update the displayed default. Consider using the `value` parameter in the `gr.Dropdown()` constructor instead: `value=self.inputs.team_leader_model.label`.
copilot-pull-request-reviewer[bot] commented 2025-10-24 18:38:23 +02:00 (Migrated from github.com)
Review

Setting value directly on a Gradio component after creation may not update the displayed default. Consider using the value parameter in the gr.Dropdown() constructor instead: value=self.inputs.strategy.label.

Setting `value` directly on a Gradio component after creation may not update the displayed default. Consider using the `value` parameter in the `gr.Dropdown()` constructor instead: `value=self.inputs.strategy.label`.
)
provider.change(fn=self.inputs.choose_team_leader, inputs=provider, outputs=None)
provider.value = self.inputs.team_leader_model.label
style = gr.Dropdown(
strategy = gr.Dropdown(
choices=self.inputs.list_strategies_names(),
type="index",
label="Stile di investimento"
)
style.change(fn=self.inputs.choose_strategy, inputs=style, outputs=None)
strategy.change(fn=self.inputs.choose_strategy, inputs=strategy, outputs=None)
strategy.value = self.inputs.strategy.label
chat = gr.ChatInterface(
fn=self.gradio_respond