diff --git a/pilot/model/proxy/proxy_llms/bard.py b/pilot/model/proxy/proxy_llms/bard.py index 770a1ec6a..badb0e912 100644 --- a/pilot/model/proxy/proxy_llms/bard.py +++ b/pilot/model/proxy/proxy_llms/bard.py @@ -31,7 +31,11 @@ def bard_generate_stream(model, tokenizer, params, device, context_len=2048): history.remove(last_user_input) history.append(last_user_input) - response = bardapi.core.Bard(token).get_answer(last_user_input["content"]) + msgs = [] + for msg in history: + if msg.get("content"): + msgs.append(msg["content"]) + response = bardapi.core.Bard(token).get_answer("\n".join(msgs)) if response is not None and response.get("content") is not None: yield str(response["content"]) else: diff --git a/pilot/scene/chat_dashboard/chat.py b/pilot/scene/chat_dashboard/chat.py index 468381ba2..40189683e 100644 --- a/pilot/scene/chat_dashboard/chat.py +++ b/pilot/scene/chat_dashboard/chat.py @@ -38,7 +38,7 @@ class ChatDashboard(BaseChat): current_user_input=user_input, ) if not db_name: - raise ValueError(f"{ChatScene.ChatDashboard.value} mode should chose db!") + raise ValueError(f"{ChatScene.ChatDashboard.value} mode should choose db!") self.db_name = db_name self.report_name = report_name self.database = CFG.local_db