| import gradio as gr | |
| theme = gr.themes.Soft( | |
| primary_hue="zinc", | |
| secondary_hue="green", | |
| neutral_hue="blue", | |
| text_size=gr.themes.sizes.text_sm, | |
| ) | |
| with gr.Blocks(theme=theme) as demo: | |
| with gr.Column(): | |
| with gr.Accordion("Sistem Mesajları", open=False): | |
| system_msg = gr.Textbox(value="Sistemden mesajlar burada görüntülenecek.") | |
| new_msg = gr.Textbox(value="Yeni mesajınızı buraya yazın.") | |
| chatbot = gr.Chatbot(label='Trek Asistanı', elem_id="chatbot") | |
| inputs = gr.Textbox(placeholder="Mesajınızı buraya yazın...", show_label=False) | |
| state = gr.State([]) | |
| inputs.submit(predict, [system_msg, inputs, chatbot, state], [chatbot, state]) | |
| demo.launch() | |