Spaces:
Sleeping
Sleeping
Update app.py
Browse files76 unmodified lines777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711876 unmodified lineswith gr.Blocks(title="ESP Brain") as demo:gr.Markdown("## ESP Brain - Настраиваемый ассистент")# Поле для ввода системного промтаsystem_prompt_input = gr.Textbox(label="Системный промт",value=""" """,lines=5,max_lines=10,placeholder="Введите системный промт для настройки поведения ассистента...")chatbot = gr.Chatbot(height=600)with gr.Row():txt = gr.Textbox(placeholder="Напиши сообщение...",show_label=False,scale=6)img = gr.Image(type="pil",label="Изображение (опционально)",show_label=False,scale=2)submit_btn = gr.Button("Отправить", scale=2)with gr.Row():retry_btn = gr.Button("🔄 Повторить")undo_btn = gr.Button("↩️ Отменить")clear_btn = gr.Button("🗑️ Очистить")# Логикаdef submit_message(message, history, system_prompt, image):return respond(message, history, system_prompt, image)txt.submit(fn=submit_message, inputs=[txt, chatbot, system_prompt_input, img], outputs=chatbot)submit_btn.click(fn=submit_message, inputs=[txt, chatbot, system_prompt_input, img], outputs=chatbot)def retry_last(history, system_prompt):if history:76 unmodified lines777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411576 unmodified lineswith gr.Blocks(title="ESP Brain") as demo:gr.Markdown("## ESP Brain - Настраиваемый ассистент")# Поле для ввода системного промтаsystem_prompt_input = gr.Textbox(label="Системный промт",value=""" """,lines=5,max_lines=10,placeholder="Введите системный промт для настройки поведения ассистента...")chatbot = gr.Chatbot(height=600,)with gr.Row():txt = gr.Textbox(placeholder="Напиши сообщение...",show_label=False,scale=8)submit_btn = gr.Button("Отправить", scale=2)with gr.Row():retry_btn = gr.Button("🔄 Повторить")undo_btn = gr.Button("↩️ Отменить")clear_btn = gr.Button("🗑️ Очистить")# Логикаdef submit_message(message, history, system_prompt):return respond(message, history, system_prompt)txt.submit(fn=submit_message, inputs=[txt, chatbot, system_prompt_input], outputs=chatbot)submit_btn.click(fn=submit_message, inputs=[txt, chatbot, system_prompt_input], outputs=chatbot)def retry_last(history, system_prompt):if history:
app.py+23-26