mirror of
https://github.com/snailyp/gemini-balance.git
synced 2026-09-05 23:56:37 +08:00
fix: 改进图片显示和移除调试输出
优化图片链接格式,在图片前后添加空行以改善显示效果 注释掉OpenAI聊天服务中的调试打印语句
This commit is contained in:
@@ -209,7 +209,7 @@ def _extract_image_data(part: dict) -> str:
|
|||||||
bytes_data = base64.b64decode(base64_data)
|
bytes_data = base64.b64decode(base64_data)
|
||||||
upload_response = image_uploader.upload(bytes_data,filename)
|
upload_response = image_uploader.upload(bytes_data,filename)
|
||||||
if upload_response.success:
|
if upload_response.success:
|
||||||
text = f""
|
text = f"\n\n\n\n"
|
||||||
else:
|
else:
|
||||||
text = ""
|
text = ""
|
||||||
return text
|
return text
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ class OpenAIChatService:
|
|||||||
async for line in self.api_client.stream_generate_content(
|
async for line in self.api_client.stream_generate_content(
|
||||||
payload, model, api_key
|
payload, model, api_key
|
||||||
):
|
):
|
||||||
print(line)
|
# print(line)
|
||||||
if line.startswith("data:"):
|
if line.startswith("data:"):
|
||||||
chunk = json.loads(line[6:])
|
chunk = json.loads(line[6:])
|
||||||
openai_chunk = self.response_handler.handle_response(
|
openai_chunk = self.response_handler.handle_response(
|
||||||
|
|||||||
Reference in New Issue
Block a user