Skip to content

Commit dfc581f

Browse files
DoiiarX666ghj
authored andcommitted
修复流式传输重试问题
1 parent 58b819d commit dfc581f

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

InsightEngine/llms/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def invoke(self, system_prompt: str, user_prompt: str, **kwargs) -> str:
8383
return self.validate_response(response.choices[0].message.content)
8484
return ""
8585

86-
@with_retry(LLM_RETRY_CONFIG)
8786
def stream_invoke(self, system_prompt: str, user_prompt: str, **kwargs) -> Generator[str, None, None]:
8887
"""
8988
流式调用LLM,逐步返回响应内容
@@ -131,6 +130,7 @@ def stream_invoke(self, system_prompt: str, user_prompt: str, **kwargs) -> Gener
131130
logger.error(f"流式请求失败: {str(e)}")
132131
raise e
133132

133+
@with_retry(LLM_RETRY_CONFIG)
134134
def stream_invoke_to_string(self, system_prompt: str, user_prompt: str, **kwargs) -> str:
135135
"""
136136
流式调用LLM并安全地拼接为完整字符串(避免UTF-8多字节字符截断)

MediaEngine/llms/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ def invoke(self, system_prompt: str, user_prompt: str, **kwargs) -> str:
8686
return self.validate_response(response.choices[0].message.content)
8787
return ""
8888

89-
@with_retry(LLM_RETRY_CONFIG)
9089
def stream_invoke(self, system_prompt: str, user_prompt: str, **kwargs) -> Generator[str, None, None]:
9190
"""
9291
流式调用LLM,逐步返回响应内容
@@ -134,6 +133,7 @@ def stream_invoke(self, system_prompt: str, user_prompt: str, **kwargs) -> Gener
134133
logger.error(f"流式请求失败: {str(e)}")
135134
raise e
136135

136+
@with_retry(LLM_RETRY_CONFIG)
137137
def stream_invoke_to_string(self, system_prompt: str, user_prompt: str, **kwargs) -> str:
138138
"""
139139
流式调用LLM并安全地拼接为完整字符串(避免UTF-8多字节字符截断)

QueryEngine/llms/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def invoke(self, system_prompt: str, user_prompt: str, **kwargs) -> str:
8383
return self.validate_response(response.choices[0].message.content)
8484
return ""
8585

86-
@with_retry(LLM_RETRY_CONFIG)
8786
def stream_invoke(self, system_prompt: str, user_prompt: str, **kwargs) -> Generator[str, None, None]:
8887
"""
8988
流式调用LLM,逐步返回响应内容
@@ -131,6 +130,7 @@ def stream_invoke(self, system_prompt: str, user_prompt: str, **kwargs) -> Gener
131130
logger.error(f"流式请求失败: {str(e)}")
132131
raise e
133132

133+
@with_retry(LLM_RETRY_CONFIG)
134134
def stream_invoke_to_string(self, system_prompt: str, user_prompt: str, **kwargs) -> str:
135135
"""
136136
流式调用LLM并安全地拼接为完整字符串(避免UTF-8多字节字符截断)

ReportEngine/llms/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ def invoke(self, system_prompt: str, user_prompt: str, **kwargs) -> str:
7676
return self.validate_response(response.choices[0].message.content)
7777
return ""
7878

79-
@with_retry(LLM_RETRY_CONFIG)
8079
def stream_invoke(self, system_prompt: str, user_prompt: str, **kwargs) -> Generator[str, None, None]:
8180
"""
8281
流式调用LLM,逐步返回响应内容
@@ -118,6 +117,7 @@ def stream_invoke(self, system_prompt: str, user_prompt: str, **kwargs) -> Gener
118117
logger.error(f"流式请求失败: {str(e)}")
119118
raise e
120119

120+
@with_retry(LLM_RETRY_CONFIG)
121121
def stream_invoke_to_string(self, system_prompt: str, user_prompt: str, **kwargs) -> str:
122122
"""
123123
流式调用LLM并安全地拼接为完整字符串(避免UTF-8多字节字符截断)

0 commit comments

Comments
 (0)