feat: test_pricing_program结果每条记录单独显示

- dspy: 每条结果json.dumps(r, ensure_ascii=False)后以\n\n分隔
- ui: 结果区改为VScrollPanel,支持长结果滚动
This commit is contained in:
Hermes Agent 2026-06-18 16:03:43 +08:00
parent 759cd14a56
commit 972400e382
2 changed files with 10 additions and 3 deletions

View File

@ -4,12 +4,19 @@ try:
if isinstance(data, str): if isinstance(data, str):
data = json.loads(data) data = json.loads(data)
x = await buffered_charging(ppid, data) x = await buffered_charging(ppid, data)
items = []
if isinstance(x, list):
for r in x:
items.append(json.dumps(r, ensure_ascii=False))
else:
items.append(json.dumps(x, ensure_ascii=False))
result_text = '\n\n'.join(items)
return { return {
"status": "ok", "status": "ok",
"data": { "data": {
"ppid": ppid, "ppid": ppid,
"data": data, "data": data,
"result": x "items": result_text
} }
} }
except Exception as e: except Exception as e:

View File

@ -29,7 +29,7 @@
} }
}, },
{ {
"widgettype": "VBox", "widgettype": "VScrollPanel",
"id": "result", "id": "result",
"options": { "options": {
"height": "50%", "height": "50%",
@ -52,7 +52,7 @@
"widgettype": "Text", "widgettype": "Text",
"options":{ "options":{
"width": "100%", "width": "100%",
"text": "${result}" "text": "${items}"
} }
}, },
"error": { "error": {