Commit 157ae8c
Changed files (1)
src
llm
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"]