mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-06 19:04:24 +00:00
feat(agent): Add count field and support non-ASCII characters in chart action output (#2807)
This commit is contained in:
parent
d27fdb7928
commit
477804769c
@ -87,9 +87,17 @@ class ChartAction(Action[SqlInput]):
|
|||||||
|
|
||||||
param_dict = model_to_dict(param)
|
param_dict = model_to_dict(param)
|
||||||
if not data_df.empty:
|
if not data_df.empty:
|
||||||
|
param_dict["count"] = len(data_df)
|
||||||
|
|
||||||
param_dict["data"] = json.loads(
|
param_dict["data"] = json.loads(
|
||||||
data_df.to_json(orient="records", date_format="iso", date_unit="s")
|
data_df.to_json(
|
||||||
|
orient="records",
|
||||||
|
force_ascii=False,
|
||||||
|
date_format="iso",
|
||||||
|
date_unit="s",
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
content = json.dumps(param_dict)
|
content = json.dumps(param_dict)
|
||||||
|
|
||||||
return ActionOutput(
|
return ActionOutput(
|
||||||
|
Loading…
Reference in New Issue
Block a user