3D Workspace
Home
Assets
Affiliate Program
Creator Program
Sign up/Log in
?
Upgrade
DCC Bridge
Anonymous1781016096
06-09 14:44
Model Name
flowchart diagram 3d model
Tags
abstract / symbol
concept art
modern
Prompt
Use case: a fairly complex dialgue, with steps controled by python code. I want to capture streaming output from the chatbot, parse it on the fly, and stream a modified version of that output to a chatinterface instance for display. Something like import asyncio import nest_asyncio nest_asyncio.apply() async def stream_text(chat_interface): for i in range(10): # Simulate sending 10 messages message = {"text": f"Message {i+1}", "user": "bot", "avatar": "https://via.placeholder.com/24"} # Directly append the message dictionary to the chat_interface's value list # WHAT GOES HERE??? chat_interface.value.append(message) await asyncio.sleep(1) pn.chat.ChatInterface(height=400, width=400).servable() await stream_text(chat_interface) I.e., the user provices a prompt (pushed to chat_interface, and sent to chatbot) the streaming chatbot response is parsed, modified, and the modified stream is sent to the chat_interface. How can I achieve this? Any bet
Detailed Info
Related Models
Enter invite code
Enter invite code to get credits!