feat: Enhance prompt execution for workflows and analysis offers
- Added support for handling aggregated results in workflow prompts, allowing for various data formats (string, object). - Introduced a utility function to filter active prompts for both pipeline and workflow types in the analysis page. - Updated content handling in the analysis component to accommodate new workflow data structures. This improves the flexibility and usability of the prompt execution process in both backend and frontend components.
This commit is contained in:
1 parent
28b6fb28d5
commit
300d96a9d8
2 files changed
+32
-5
No files matched your search
@@ -1253,6 +1253,18 @@ async def execute_unified_prompt(
|
||||
content = list(final_output.values())[0]
|
||||
else:
|
||||
content = json.dumps(final_output, ensure_ascii=False)
|
||||
elif result['type'] == 'workflow':
|
||||
# Graph-Workflows: kein "output", sondern aggregated_result
|
||||
agg = result.get('aggregated_result')
|
||||
if isinstance(agg, dict) and len(agg) == 1:
|
||||
v = list(agg.values())[0]
|
||||
content = v if isinstance(v, str) else json.dumps(v, ensure_ascii=False)
|
||||
elif agg is None:
|
||||
content = ''
|
||||
elif isinstance(agg, str):
|
||||
content = agg
|
||||
else:
|
||||
content = json.dumps(agg, ensure_ascii=False)
|
||||
else:
|
||||
# For base prompts, use output directly
|
||||
content = result.get('output', '')
|
||||
|
||||
Reference in new issue
Block a user