diff --git a/wwwroot/api/cockpit_chat.dspy b/wwwroot/api/cockpit_chat.dspy index e628ab4..c486339 100644 --- a/wwwroot/api/cockpit_chat.dspy +++ b/wwwroot/api/cockpit_chat.dspy @@ -171,8 +171,7 @@ async def _build_context(sor, iteration_id, task_id, max_msgs, system_prompt): params["iid"] = iteration_id if where: - sql = f"SELECT role, content FROM pipeline_conversations WHERE {' OR '.join(where)} ORDER BY created_at DESC LIMIT ${max_msgs}$" - params["max_msgs"] = max_msgs + sql = f"SELECT role, content FROM pipeline_conversations WHERE {' OR '.join(where)} ORDER BY created_at DESC LIMIT {max_msgs}" history = await sor.sqlExe(sql, params) # Reverse to chronological order for h in reversed(history):