fix: LIMIT $ → direct interpolation to avoid MySQL variable error
This commit is contained in:
parent
ee8005644f
commit
0d0c8299e8
@ -171,8 +171,7 @@ async def _build_context(sor, iteration_id, task_id, max_msgs, system_prompt):
|
|||||||
params["iid"] = iteration_id
|
params["iid"] = iteration_id
|
||||||
|
|
||||||
if where:
|
if where:
|
||||||
sql = f"SELECT role, content FROM pipeline_conversations WHERE {' OR '.join(where)} ORDER BY created_at DESC LIMIT ${max_msgs}$"
|
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
|
|
||||||
history = await sor.sqlExe(sql, params)
|
history = await sor.sqlExe(sql, params)
|
||||||
# Reverse to chronological order
|
# Reverse to chronological order
|
||||||
for h in reversed(history):
|
for h in reversed(history):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user