Commit 157ae8c

benny-dou <60535774+benny-dou@users.noreply.github.com>
2025-06-20 17:47:50
fix(gpt): add `web_page` to supported message types
1 parent d5b62f6
Changed files (1)
src
src/llm/contexts.py
@@ -70,7 +70,7 @@ async def single_gpt_context(client: Client, message: Message) -> dict:
     info = parse_msg(message, silent=True, use_cache=False)
     role = "assistant" if BOT_TIPS in info["text"] else "user"
 
-    if info["mtype"] not in ["text", "photo", "audio", "voice", "video", "document"]:
+    if info["mtype"] not in ["text", "photo", "audio", "voice", "video", "document", "web_page"]:
         return {}
 
     extra_txt_extensions = [".sh", ".json", ".xml"]  # treat these as txt file
@@ -130,7 +130,7 @@ async def single_gemini_context(client: Client, message: Message, app: genai.Cli
     """
     info = parse_msg(message, silent=True, use_cache=False)
     role = "model" if BOT_TIPS in info["text"] else "user"
-    if info["mtype"] not in ["text", "photo", "audio", "voice", "video", "document"]:
+    if info["mtype"] not in ["text", "photo", "audio", "voice", "video", "document", "web_page"]:
         return {}
     # gemini has built-in support for these extensions
     gemini_extensions = [".pdf", ".html", ".css", ".csv", ".xml", ".rtf", ".mp3", ".wav", ".ogg", ".aac", ".flac", ".jpg", ".jpeg", ".webp", ".png", ".heic", ".heif"]