Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions openai_compatible_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def stream_and_update_state(task_id: str, request_base: dict, user_or_tool_messa
try:
# findall直接返回捕获组的内容
text = json.loads(f'"{match_group}"')
if text and not text.startswith("**"):
if text and (len(text.strip()) > 2 or not text.startswith("**")):
full_ai_response_text += text
yield format_openai_chunk(text, model, request_id)
except json.JSONDecodeError:
Expand Down Expand Up @@ -270,7 +270,7 @@ def generate_non_streaming_response(task_id: str, request_base: dict, user_or_to
try:
# findall直接返回捕获组的内容
text = json.loads(f'"{match_group}"')
if text and not text.startswith("**"):
if text and (len(text.strip()) > 2 or not text.startswith("**")):
full_ai_response_text += text
except json.JSONDecodeError:
continue
Expand Down