File size: 326 Bytes
d8ae88a
57158d4
f9aa63c
 
 
 
 
 
 
 
57158d4
f9aa63c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
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