File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed
Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -840,13 +840,21 @@ client = WorkflowClient(
840840app_info = client.get_app_info()
841841print (f " 应用名称: { app_info[' name' ]} " )
842842
843- # 阻塞模式执行工作流
843+ # 准备输入参数
844+ inputs = {
845+ " input" : " 请写一首关于人工智能的诗" ,
846+ }
847+
848+ # 执行工作流(阻塞模式)
844849result = client.run(
845- inputs = {" prompt" : " 请给我讲一个关于AI的故事" },
846- user = " user_123" , # 用户唯一标识
847- response_mode = " blocking" # 阻塞模式,等待工作流执行完成
850+ inputs = inputs,
851+ user = " user_123" , # 用户标识
852+ response_mode = " blocking" ,
853+ timeout = 30 , # 超时时间(秒)
848854)
849- print (f " 工作流结果: { result} " )
855+
856+ print (" 工作流执行结果:" )
857+ print (result)
850858```
851859
852860#### 流式响应处理
@@ -916,12 +924,6 @@ for log in logs["data"]:
916924
917925更多示例请参阅 [ examples/workflow_example.py] ( examples/workflow_example.py ) 。
918926
919- ## 开发中功能
920-
921- - Agent 对话型应用客户端
922- - Text Generation 文本生成应用客户端
923- - Chatflow 工作流编排对话型应用客户端
924-
925927## 贡献
926928
927929欢迎贡献代码、报告问题或提出建议!请查看 [ CONTRIBUTING.md] ( CONTRIBUTING.md ) 了解更多详情。
Original file line number Diff line number Diff line change @@ -522,6 +522,8 @@ def get_parameters(self) -> Dict[str, Any]:
522522 Returns:
523523 Dict[str, Any]: 应用参数配置
524524
525+
526+
525527 Raises:
526528 DifyAPIError: 当API请求失败时
527529 """
You can’t perform that action at this time.
0 commit comments