From 1fd00a9d782d49f5ec5d4441a7ed984ea804e33d Mon Sep 17 00:00:00 2001 From: Dustin Date: Wed, 14 Aug 2024 19:44:20 -0400 Subject: [PATCH] finally added markdown rendering --- ollamarama.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ollamarama.py b/ollamarama.py index d8e1c65..60a9cc2 100644 --- a/ollamarama.py +++ b/ollamarama.py @@ -10,7 +10,7 @@ import json import datetime import asyncio import requests - +import markdown class ollamarama: def __init__(self): #load config file @@ -67,7 +67,10 @@ class ollamarama: await self.client.room_send( room_id=channel, message_type="m.room.message", - content={"msgtype": "m.text", "body": message}, + content={"msgtype": "m.text", + "body": message, + "format": "org.matrix.custom.html", + "formatted_body": markdown.markdown(message, extensions=['fenced_code', 'nl2br'])}, ) # add messages to the history dictionary