chansung's picture
Update app/ui.py
57158d4 verified
raw
history blame
326 Bytes
from gen.openllm import (
gen_chat,
translate_messages,
)
async def chat(message, history):
messages = translate_messages(history)
messages.append({"role":"user", "content":message})
full_resp = ""
async for resp in gen_chat(messages):
full_resp = full_resp + resp
yield full_resp