Commit 67acb8a
Changed files (3)
src
src/llm/contexts.py
@@ -94,26 +94,24 @@ async def single_context(client: Client, message: Message) -> dict:
b64 = base64.b64encode(res.getvalue()).decode("utf-8")
if info["mtype"] == "photo":
media.append({"type": "image_url", "image_url": {"url": f"data:image/{ext};base64,{b64}"}})
- elif info["mtype"] == "video":
- media.append({"type": "video_url", "video_url": {"url": b64}})
+ # elif info["mtype"] == "video":
+ # media.append({"type": "video_url", "video_url": {"url": b64}})
elif info["mtype"] == "document" and info["mime_type"] == "text/plain":
media.append({"type": "text", "text": res.getvalue().decode("utf-8")})
else:
logger.warning(f"Unsupported message type: {info['mtype']}")
- continue
else:
path: str = await client.download_media(msg) # type: ignore
logger.debug(f"Downloaded GPT media: {path}")
if info["mtype"] == "photo":
media.append({"type": "image_url", "image_url": {"url": f"{GPT.MEDIA_SERVER}/{Path(path).name}"}})
- elif info["mtype"] == "video":
- media.append({"type": "video_url", "video_url": {"url": f"{GPT.MEDIA_SERVER}/{Path(path).name}"}})
+ # elif info["mtype"] == "video":
+ # media.append({"type": "video_url", "video_url": {"url": f"{GPT.MEDIA_SERVER}/{Path(path).name}"}})
elif info["mtype"] == "document" and info["mime_type"] == "text/plain":
media.append({"type": "text", "text": Path(path).read_text()})
Path(path).unlink(missing_ok=True)
else:
logger.warning(f"Unsupported message type: {info['mtype']}")
- continue
if caption := info["text"]:
media.append({"type": "text", "text": caption})
except Exception as e:
src/llm/gpt.py
@@ -18,7 +18,7 @@ HELP = f"""🤖**GPT对话**
当前模型:
- 文本模型: **{GPT.TEXT_MODEL_NAME}**
- 图片模型: **{GPT.IMAGE_MODEL_NAME}**
-- 视频模型: **{GPT.VIDEO_MODEL_NAME}**
+- 视频模型(暂时禁用): **{GPT.VIDEO_MODEL_NAME}**
使用说明:
1. 在 `{PREFIX.GPT}` 后接提示词即可与GPT对话
src/llm/models.py
@@ -20,9 +20,9 @@ def get_model_type(conversations: list[Message]) -> str:
if info["mtype"] == "photo":
model_type = "image"
has_image = True
- if info["mtype"] == "video":
- model_type = "video"
- has_video = True
+ # if info["mtype"] == "video": # disable video
+ # model_type = "video"
+ # has_video = True
if has_image and has_video:
model_type = "ERROR: this conversation have both image and video."
return model_type