Commit df7977c
Changed files (1)
src
llm
src/llm/contexts.py
@@ -94,7 +94,7 @@ async def single_context(client: Client, message: Message) -> dict:
contexts.append({"type": "image_url", "image_url": {"url": f"data:image/{res['ext']};base64,{res['base64']}"}})
# elif info["mtype"] == "video":
# media.append({"type": "video_url", "video_url": {"url": b64}})
- elif info["mtype"] == "document" and info["mime_type"] == "text/plain":
+ elif info["mtype"] == "document" and info["mime_type"] in ["text/plain", "text/markdown"]:
res = await base64_media(client, msg)
contexts.append(
{
@@ -109,7 +109,7 @@ async def single_context(client: Client, message: Message) -> dict:
contexts.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"] == "document" and info["mime_type"] == "text/plain":
+ elif info["mtype"] == "document" and info["mime_type"] in ["text/plain", "text/markdown"]:
contexts.append(
{
"type": "text",