fix: handle prompt at top level from bricks AgentIO request body
This commit is contained in:
parent
426998b6c6
commit
255f41c780
@ -189,9 +189,13 @@ async def _exec_tool(sor, tool, params, ctx, uid, org_id):
|
|||||||
if action == 'send_message':
|
if action == 'send_message':
|
||||||
# AgentIO sends JSON: {"params":{"prompt":"...","model_id":"..."},...}
|
# AgentIO sends JSON: {"params":{"prompt":"...","model_id":"..."},...}
|
||||||
# FormData sends: action=send_message&message_text=...&model_id=...
|
# FormData sends: action=send_message&message_text=...&model_id=...
|
||||||
|
# bricks sends prompt/model_id at top level
|
||||||
p = params_kw or {}
|
p = params_kw or {}
|
||||||
message_text = (p.get('message_text') or '').strip()
|
message_text = (p.get('message_text') or '').strip()
|
||||||
user_model_id = p.get('model_id', '')
|
user_model_id = p.get('model_id', '')
|
||||||
|
# Try prompt at top level (bricks AgentIO)
|
||||||
|
if not message_text:
|
||||||
|
message_text = (p.get('prompt') or '').strip()
|
||||||
# Try JSON body from AgentIO
|
# Try JSON body from AgentIO
|
||||||
if not message_text:
|
if not message_text:
|
||||||
inner = p.get('params', {})
|
inner = p.get('params', {})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user