Spaces:
Runtime error
Runtime error
File size: 526 Bytes
3a63794 4d5b0bf 3a63794 4d5b0bf 3a63794 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import gradio as gr
from controllers.chat import chat_controller
from services.state import get_state
from utilities.constants import FW_DEFAULT_OPTION, CHAT_EXAMPLES
def chats_yielding(prompt: str, histories: list[list]):
for msg in chat_controller(prompt, histories, get_state('fw_option', FW_DEFAULT_OPTION)):
yield msg
def chat_interface():
return gr.ChatInterface(
title="Chat AI",
fn=chats_yielding,
examples=CHAT_EXAMPLES,
retry_btn=None,
undo_btn=None
)
|