Skip to content

Commit

Permalink
fix: fix llm strategy value store format.
Browse files Browse the repository at this point in the history
store llm strategy value in json format
  • Loading branch information
xuyuan23 committed Feb 20, 2024
1 parent 63ab612 commit 4313398
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions dbgpt/serve/agent/db/gpts_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ def from_dict(cls, d: Dict[str, Any]):
resources=AgentResource.from_josn_list_str(d.get("resources", None)),
prompt_template=d.get("prompt_template", None),
llm_strategy=d.get("llm_strategy", None),
llm_strategy_value=d.get("llm_strategy_value", None),
llm_strategy_value=",".join(json.loads(d.get("llm_strategy_value")))
if d.get("llm_strategy_value")
else None,
created_at=d.get("created_at", None),
updated_at=d.get("updated_at", None),
)
Expand Down Expand Up @@ -483,7 +485,9 @@ def create(self, gpts_app: GptsApp):
resources=json.dumps(resource_dicts, ensure_ascii=False),
prompt_template=item.prompt_template,
llm_strategy=item.llm_strategy,
llm_strategy_value=item.llm_strategy_value,
llm_strategy_value=json.dumps(
tuple(item.llm_strategy_value.split(","))
),
created_at=item.created_at,
updated_at=item.updated_at,
)
Expand Down Expand Up @@ -525,7 +529,9 @@ def edit(self, gpts_app: GptsApp):
resources=json.dumps(resource_dicts, ensure_ascii=False),
prompt_template=item.prompt_template,
llm_strategy=item.llm_strategy,
llm_strategy_value=item.llm_strategy_value,
llm_strategy_value=json.dumps(
tuple(item.llm_strategy_value.split(","))
),
created_at=item.created_at,
updated_at=item.updated_at,
)
Expand Down

0 comments on commit 4313398

Please sign in to comment.