fix: auto continue small bug (#598)

This commit is contained in:
Xu Yang
2025-02-14 17:03:57 +08:00
committed by GitHub
parent 6367bf1833
commit 0a09fd02d3
+2 -2
View File
@@ -560,7 +560,7 @@ class DeprecBackend(APIBackend):
all_response = ""
new_messages = deepcopy(messages)
for _ in range(10):
for _ in range(3):
if "json_mode" in kwargs:
del kwargs["json_mode"]
response, finish_reason = self._create_chat_completion_inner_function(
@@ -586,7 +586,7 @@ class DeprecBackend(APIBackend):
self.cache.chat_set(input_content_json, all_response)
return all_response
new_messages.append({"role": "assistant", "content": response})
return all_response
raise RuntimeError("Failed to continue the conversation after 3 retries.")
def _try_create_chat_completion_or_embedding( # type: ignore[no-untyped-def]
self,