diff --git a/server/inference.py b/server/inference.py index 76792fe..08e775b 100644 --- a/server/inference.py +++ b/server/inference.py @@ -59,11 +59,12 @@ async def connect_to_conversation(ws: WebSocket): if conversation_id == "new": await ws.send_text(json({"i": conversation.id})) + first = True async for message in ws.iter_text(): - if system_prompt: + if first: await ws.send_text(json({"sys": system_prompt})) response = conversation.prompt(message, system=system_prompt, stream=True) - system_prompt = None + first = False response_tid = tid_now() await ws.send_text(json({"u": message}))