diff --git a/harnessed_reasoning/__pycache__/core.cpython-311.pyc b/harnessed_reasoning/__pycache__/core.cpython-311.pyc index bfeb034..fac4359 100644 Binary files a/harnessed_reasoning/__pycache__/core.cpython-311.pyc and b/harnessed_reasoning/__pycache__/core.cpython-311.pyc differ diff --git a/harnessed_reasoning/core.py b/harnessed_reasoning/core.py index e518c44..5f7df9a 100644 --- a/harnessed_reasoning/core.py +++ b/harnessed_reasoning/core.py @@ -127,8 +127,8 @@ class HermesReasoningEngine: try: async with self.db.sqlorContext(dbname) as sor: - rows = await sor.R('harnessed_reasoning_config', {}, - orderby='updated_at DESC', limit=1) + sql = "SELECT * FROM harnessed_reasoning_config ORDER BY updated_at DESC LIMIT 1" + rows = await sor.sqlExe(sql, {}) if rows: return rows[0] except Exception as e: @@ -196,13 +196,15 @@ class HermesReasoningEngine: try: async with self.db.sqlorContext('default') as sor: for kw in list(keywords)[:3]: - rows = await sor.R('hermes_skills', { - 'user_id': user_id, - '$or': [ - {'name': {'$like': f'%{kw}%'}}, - {'description': {'$like': f'%{kw}%'}}, - ] - }, limit=2) + sql = """SELECT * FROM hermes_skills + WHERE user_id = :user_id + AND (name LIKE :kw1 OR description LIKE :kw2) + LIMIT 2""" + rows = await sor.sqlExe(sql, { + 'user_id': user_id, + 'kw1': f'%{kw}%', + 'kw2': f'%{kw}%' + }) skills.extend(rows) # Deduplicate @@ -687,9 +689,8 @@ class HermesReasoningEngine: try: async with self.db.sqlorContext('default') as sor: - rows = await sor.R('harnessed_reasoning_sessions', - {'user_id': user_id}, - orderby='created_at DESC', limit=limit, offset=offset) + sql = f"SELECT * FROM harnessed_reasoning_sessions WHERE user_id = :user_id ORDER BY created_at DESC LIMIT {limit} OFFSET {offset}" + rows = await sor.sqlExe(sql, {'user_id': user_id}) sessions = [] for s in rows: