From 81df0aa210bf015839ac1b79f7d89fe5b3a4073e Mon Sep 17 00:00:00 2001 From: WFS <67593947+ycwfs@users.noreply.github.com> Date: Thu, 25 Apr 2024 22:26:32 +0800 Subject: [PATCH] =?UTF-8?q?fix=20the=20issue=20of=20when=20using=20google?= =?UTF-8?q?=20Gemini=20pro,=20don't=20have=20chat=20histor=E2=80=A6=20(#17?= =?UTF-8?q?43)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix the issue of when using google Gemini pro, don't have chat history record just add chat_log in bridge_google_gmini.py * Update bridge_google_gemini.py --------- Co-authored-by: binary-husky <96192199+binary-husky@users.noreply.github.com> --- request_llms/bridge_google_gemini.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/request_llms/bridge_google_gemini.py b/request_llms/bridge_google_gemini.py index 129f0683d..9bf4e23a6 100644 --- a/request_llms/bridge_google_gemini.py +++ b/request_llms/bridge_google_gemini.py @@ -8,7 +8,7 @@ import time from request_llms.com_google import GoogleChatInit from toolbox import ChatBotWithCookies -from toolbox import get_conf, update_ui, update_ui_lastest_msg, have_any_recent_upload_image_files, trimmed_format_exc +from toolbox import get_conf, update_ui, update_ui_lastest_msg, have_any_recent_upload_image_files, trimmed_format_exc, log_chat proxies, TIMEOUT_SECONDS, MAX_RETRY = get_conf('proxies', 'TIMEOUT_SECONDS', 'MAX_RETRY') timeout_bot_msg = '[Local Message] Request timeout. Network error. Please check proxy settings in config.py.' + \ @@ -99,6 +99,7 @@ def make_media_input(inputs, image_paths): gpt_replying_buffer += paraphrase['text'] # 使用 json 解析库进行处理 chatbot[-1] = (inputs, gpt_replying_buffer) history[-1] = gpt_replying_buffer + log_chat(llm_model=llm_kwargs["llm_model"], input_str=inputs, output_str=gpt_replying_buffer) yield from update_ui(chatbot=chatbot, history=history) if error_match: history = history[-2] # 错误的不纳入对话