File size: 1,113 Bytes
c71031c
2ad8594
 
f6d0a93
2ad8594
 
 
f6d0a93
 
 
 
 
 
2ad8594
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import gradio as gr

with gr.Blocks(theme='sudeepshouche/minimalist',css="#chatbot{height:300px} .overflow-y-auto{height:500px}") as demo:
    gr.Markdown("<h1>Giurimatrix chatbot ti dà il benvenuto.</h1>\n<p>Sono ancora in fase di apprendimento e alcune delle mie risposte possono non essere completamente giuste.\nSe non ti piace la mia risposta, puoi scrivere <code>/feedback</code> aggiungendo la riposta che consideri corretta. Grazie a questo feedback, migliorerò le mie risposte.\n</p><p>Se hai bisogno di una aiuto scrivi <code>/help</code>. Se vuoi sapere come processo i dati, scrivi <code>/privacy</code>. Buon lavoro!</p>")
    chatbot = gr.Chatbot()
    message = gr.Textbox()
    clear = gr.Button("Cancella cronologia")
    demo.load(respond, [message, chatbot], [message, chatbot],name = "giurimatrix/chatbot", api_key="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")

    
    #message.submit(respond, [message, chatbot], [message, chatbot])
    #msg.submit(respond, [msg, chatbot], [msg, chatbot])
    clear.click(lambda: None, None, chatbot, queue=False)

if __name__ == "__main__":
    demo.launch()