| import gradio as gr | |
| import openai | |
| from osbot_utils.utils.Dev import pprint | |
| from osbot_utils.utils.Misc import list_set | |
| from test_bot.api.Chat_Predict import Chat_Predict | |
| from test_bot.api.Open_API import Open_API | |
| Open_API().setup() | |
| TITLE = "# Meet Bobby Tables (head of Application Security). v0.2.0" | |
| class Gradio_Test: | |
| def __init__(self): | |
| #self.demo = None | |
| pass | |
| def title(self): | |
| return TITLE | |
| def create_demo(self): | |
| #return gr.ChatInterface(self.predict).queue() | |
| default_text = "Hi, good morning" | |
| chat_predict = Chat_Predict() | |
| with gr.Blocks() as demo: | |
| gr.Markdown(self.title()) | |
| textbox_input = gr.Textbox(value=default_text , render=False) | |
| gr.ChatInterface(chat_predict.predict, textbox=textbox_input) | |
| demo.queue() | |
| #self.demo = demo | |
| return demo | |
| # def launch(self): | |
| # self.demo.queue() | |
| # #self.demo.launch() |