-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchat_ui.py
31 lines (24 loc) · 832 Bytes
/
chat_ui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from anthropic import Anthropic
import dotenv
import os
import gradio as gr
import ai_assistant as ai
dotenv.load_dotenv()
def greet(name: str) -> str:
return f"Hello {name}!"
gr.themes.Soft()
user_input = gr.Textbox(label="Your Input:", placeholder="Enter your question here")
system_output = gr.Textbox(label="System Output:")
desc = gr.Markdown("### Welcome to My Chatbot (using Claude-3 Opus)")
chatbot_ui = gr.Interface(
fn=ai.chat_with_assistant,
inputs=[user_input],
outputs=[system_output],
title="Experiment with Anthrop\c Models",
description=desc.value,
theme=gr.themes.Soft()
)
#demo = gr.Interface(fn=greet, inputs="text", outputs="text")
# demo.launch(share=True) # Share your demo with just 1 extra parameter 🚀
# 👉 https://a23dsf231adb.gradio.live
chatbot_ui.launch()