重构ai_content_generation.py
This commit is contained in:
parent
bfc3883c5c
commit
f5068b3859
@ -1,7 +1,7 @@
|
||||
import json
|
||||
from typing import Dict, Any, Optional
|
||||
|
||||
from jingrow.utils.jingrow_api import get_record
|
||||
import jingrow
|
||||
from jingrow.utils.jingrow_cloud import call_ai_model
|
||||
from jingrow.utils.jinja import render_template
|
||||
|
||||
@ -79,11 +79,9 @@ def execute(context=None, inputs=None, config=None):
|
||||
}
|
||||
agent_data = {}
|
||||
flow_id = context["flow_id"]
|
||||
api_res = get_record("Local Ai Agent", str(flow_id))
|
||||
if api_res and api_res.get("success"):
|
||||
data = api_res.get("data") or {}
|
||||
if isinstance(data, dict):
|
||||
agent_data = data
|
||||
agent_data = jingrow.get_pg("Local Ai Agent", str(flow_id))
|
||||
if not agent_data:
|
||||
agent_data = {}
|
||||
|
||||
# 将agent的所有字段直接平铺到模板上下文(不做兜底)
|
||||
for key, value in agent_data.items():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user