fix: miss content field & function
This commit is contained in:
1 parent
1588c14987
commit
3f3e26401e
3 files changed
+8
-2
No files matched your search
@@ -1,2 +1,3 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
@@ -29,11 +29,11 @@ async def get_image(img_path: str):
|
||||
|
||||
if is_video:
|
||||
# 检查视频缓存
|
||||
cache_path = video_cache_service.get_cached_video(original_path)
|
||||
cache_path = video_cache_service.get_cached(original_path)
|
||||
media_type = "video/mp4"
|
||||
else:
|
||||
# 检查图片缓存
|
||||
cache_path = image_cache_service.get_cached_image(original_path)
|
||||
cache_path = image_cache_service.get_cached(original_path)
|
||||
media_type = "image/jpeg"
|
||||
|
||||
if cache_path and cache_path.exists():
|
||||
|
||||
@@ -348,6 +348,9 @@ class GrokResponseProcessor:
|
||||
# 获取图片返回模式
|
||||
image_mode = setting.global_config.get("image_mode", "url")
|
||||
|
||||
# 初始化内容变量
|
||||
content = ""
|
||||
|
||||
# 生成图片链接并缓存
|
||||
for img in model_resp.get("generatedImageUrls", []):
|
||||
try:
|
||||
@@ -406,6 +409,8 @@ class GrokResponseProcessor:
|
||||
except Exception as e:
|
||||
logger.warning(f"[Processor] 处理图片失败: {e}")
|
||||
content += f"\n"
|
||||
|
||||
# 发送内容
|
||||
yield make_chunk(content.strip(), "stop")
|
||||
timeout_manager.mark_chunk_received()
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user