From 91dec55e6390e8307f70396a1500072b5872836c Mon Sep 17 00:00:00 2001 From: haixuantao Date: Sun, 10 Aug 2025 21:14:06 +0800 Subject: [PATCH] Add history to the conversation --- node-hub/dora-qwen/dora_qwen/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/node-hub/dora-qwen/dora_qwen/main.py b/node-hub/dora-qwen/dora_qwen/main.py index c956105d..3d961821 100644 --- a/node-hub/dora-qwen/dora_qwen/main.py +++ b/node-hub/dora-qwen/dora_qwen/main.py @@ -93,12 +93,15 @@ def main(): if len(ACTIVATION_WORDS) == 0 or any( word in ACTIVATION_WORDS for word in words ): - # On linux, Windows + history += [{"role": "user", "content": text}] + response = model.create_chat_completion( - messages=[{"role": "user", "content": text}], # Prompt + messages=history, # Prompt max_tokens=24, )["choices"][0]["message"]["content"] + history += [{"role": "assistant", "content": response}] + node.send_output( output_id="text", data=pa.array([response]),