在影刀里怎么获取dify的接口返回的某个字段的内容?
回答
收藏

在影刀里怎么获取dify的接口返回的某个字段的内容?
20

星
星一2025
2025-11-14 17:20·浏览量:487
星
星一2025
发布于 2025-11-14 17:20487浏览

data: {"event": "workflow_started", "workflow_run_id": "559d349d-4b93-4b21-821d-f99e3e4ad2b4", "task_id": "6e66effd-476f-4676-80b6-793a49033703", "data": {"id": "559d349d-4b93-4b21-821d-f99e3e4ad2b4", "workflow_id": "6cdd6555-34d3-43ca-b834-090c409b0589", "sequence_number": 30, "inputs": {"text": "\u597d\u7684", "sys.files": [], "sys.user_id": "abc-123", "sys.app_id": "7b7e661a-bb11-4d39-b37e-d1571a5c60bb", "sys.workflow_id": "6cdd6555-34d3-43ca-b834-090c409b0589", "sys.workflow_run_id": "559d349d-4b93-4b21-821d-f99e3e4ad2b4"}, "created_at": 1763111710}}


data: {"event": "node_started", "workflow_run_id": "559d349d-4b93-4b21-821d-f99e3e4ad2b4", "task_id": "6e66effd-476f-4676-80b6-793a49033703", "data": {"id": "c1ae5931-8ed4-47a8-a34e-cc5feaf53b2f", "node_id": "1762949261183", "node_type": "start", "title": "\u5f00\u59cb", "index": 1, "predecessor_node_id": null, "inputs": null, "created_at": 1763111710, "extras": {}, "parallel_id": null, "parallel_start_node_id": null, "parent_parallel_id": null, "parent_parallel_start_node_id": null, "iteration_id": null, "parallel_run_id": null}}


data: {"event": "node_finished", "workflow_run_id": "559d349d-4b93-4b21-821d-f99e3e4ad2b4", "task_id": "6e66effd-476f-4676-80b6-793a49033703", "data": {"id": "c1ae5931-8ed4-47a8-a34e-cc5feaf53b2f", "node_id": "1762949261183", "node_type": "start", "title": "\u5f00\u59cb", "index": 1, "predecessor_node_id": null, "inputs": {"text": "\u597d\u7684", "sys.files": [], "sys.user_id": "abc-123", "sys.app_id": "7b7e661a-bb11-4d39-b37e-d1571a5c60bb", "sys.workflow_id": "6cdd6555-34d3-43ca-b834-090c409b0589", "sys.workflow_run_id": "559d349d-4b93-4b21-821d-f99e3e4ad2b4"}, "process_data": null, "outputs": {"text": "\u597d\u7684", "sys.files": [], "sys.user_id": "abc-123", "sys.app_id": "7b7e661a-bb11-4d39-b37e-d1571a5c60bb", "sys.workflow_id": "6cdd6555-34d3-43ca-b834-090c409b0589", "sys.workflow_run_id": "559d349d-4b93-4b21-821d-f99e3e4ad2b4"}, "status": "succeeded", "error": null, "elapsed_time": 0.020952, "execution_metadata": null, "created_at": 1763111710, "finished_at": 1763111710, "files": [], "parallel_id": null, "parallel_start_node_id": null, "parent_parallel_id": null, "parent_parallel_start_node_id": null, "iteration_id": null}}


data: {"event": "node_started", "workflow_run_id": "559d349d-4b93-4b21-821d-f99e3e4ad2b4", "task_id": "6e66effd-476f-4676-80b6-793a49033703", "data": {"id": "46b726c0-6892-4b39-8a39-b5876c4e7537", "node_id": "1763014632965", "node_type": "llm", "title": "LLM 2", "index": 2, "predecessor_node_id": "1762949261183", "inputs": null, "created_at": 1763111710, "extras": {}, "parallel_id": null, "parallel_start_node_id": null, "parent_parallel_id": null, "parent_parallel_start_node_id": null, "iteration_id": null, "parallel_run_id": null}}


data: {"event": "node_finished", "workflow_run_id": "559d349d-4b93-4b21-821d-f99e3e4ad2b4", "task_id": "6e66effd-476f-4676-80b6-793a49033703", "data": {"id": "46b726c0-6892-4b39-8a39-b5876c4e7537", "node_id": "1763014632965", "node_type": "llm", "title": "LLM 2", "index": 2, "predecessor_node_id": "1762949261183", "inputs": {"#context#": "\u597d\u7684"}, "process_data": {"model_mode": "chat", "prompts": [{"role": "system", "text": "```xml\n<instructions>\n  \u4f5c\u4e3a\u76f4\u64ad\u5e73\u53f0\u7684\u5ba2\u670d\uff0c\u4f60\u9700\u8981\u5206\u6790\u7528\u6237\u7684\u610f\u56fe\u3002\u8bf7\u6839\u636e\u7528\u6237\u7684\u95ee\u9898\u6216\u9700\u6c42\uff0c\u5224\u65ad\u4ed6\u4eec\u7684\u4e3b\u8981\u610f\u56fe\uff0c\u5e76\u7ed9\u51fa\u76f8\u5e94\u7684\u5efa\u8bae\u6216\u89e3\u51b3\u65b9\u6848\u3002\n</instructions>\n\n<example>\n  <input>\u53ef\u4ee5\u6539\u540d\u5b57\u4e3a\u5b9d\u5b9d\u4e48</input>\n  <output>\u60a8\u7684\u4e3b\u8981\u610f\u56fe\u662f\u4e86\u89e3\u5982\u4f55\u5728\u5e94\u7528\u5185\u4fee\u6539\u6635\u79f0\uff0c\u5c5e\u4e8e\u4ea7\u54c1\u95ee\u9898</output>\n</example>\n\n<example>\n  <input>\u6211\u5728\u89c2\u770b\u76f4\u64ad\u65f6\u9047\u5230\u4e86\u5361\u987f\u95ee\u9898\uff0c\u8be5\u600e\u4e48\u529e\uff1f</input>\n  <output>\u60a8\u7684\u4e3b\u8981\u610f\u56fe\u662f\u89e3\u51b3\u89c2\u770b\u76f4\u64ad\u65f6\u9047\u5230\u7684\u5361\u987f\u95ee\u9898\u3002\u60a8\u53ef\u4ee5\u5c1d\u8bd5\u6e05\u7406\u6d4f\u89c8\u5668\u7f13\u5b58\u3001\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5\u901f\u5ea6\u6216\u8005\u5207\u6362\u5230\u5176\u4ed6\u64ad\u653e\u7ebf\u8def\u6765\u89e3\u51b3\u95ee\u9898\u3002</output>\n</example>\n\n<example>\n  <input>\u6211\u5fd8\u8bb0\u4e86\u6211\u7684\u8d26\u53f7\u5bc6\u7801\uff0c\u600e\u4e48\u627e\u56de\uff1f</input>\n  <output>\u60a8\u7684\u4e3b\u8981\u610f\u56fe\u662f\u627e\u56de\u5fd8\u8bb0\u7684\u8d26\u53f7\u5bc6\u7801\u3002\u60a8\u53ef\u4ee5\u70b9\u51fb\u767b\u5f55\u9875\u9762\u4e0a\u7684\u201c\u5fd8\u8bb0\u5bc6\u7801\u201d\u94fe\u63a5\uff0c\u6309\u7167\u63d0\u793a\u8f93\u5165\u60a8\u7684\u6ce8\u518c\u90ae\u7bb1\u6216\u624b\u673a\u53f7\u7801\uff0c\u7cfb\u7edf\u4f1a\u53d1\u9001\u4e00\u5c01\u5305\u542b\u91cd\u7f6e\u5bc6\u7801\u94fe\u63a5\u7684\u90ae\u4ef6\u7ed9\u60a8\uff0c\u8bf7\u67e5\u6536\u5e76\u6309\u7167\u90ae\u4ef6\u4e2d\u7684\u6307\u793a\u64cd\u4f5c\u3002</output>\n</example>\n```", "files": []}], "model_provider": "tongyi", "model_name": "qwen-max-latest"}, "outputs": {"text": "\u60a8\u7684\u95ee\u9898\u4f3c\u4e4e\u4e0d\u5b8c\u6574\uff0c\u8bf7\u63d0\u4f9b\u66f4\u8be6\u7ec6\u7684\u4fe1\u606f\u6216\u5177\u4f53\u95ee\u9898\uff0c\u4ee5\u4fbf\u6211\u4eec\u66f4\u597d\u5730\u4e3a\u60a8\u63d0\u4f9b\u5e2e\u52a9\u3002", "usage": {"prompt_tokens": 241, "prompt_unit_price": "0.02", "prompt_price_unit": "0.001", "prompt_price": "0.0048200", "completion_tokens": 20, "completion_unit_price": "0.06", "completion_price_unit": "0.001", "completion_price": "0.0012000", "total_tokens": 261, "total_price": "0.0060200", "currency": "RMB", "latency": 1.4903647638857365}, "finish_reason": "stop"}, "status": "succeeded", "error": null, "elapsed_time": 1.512604, "execution_metadata": {"total_tokens": 261, "total_price": "0.0060200", "currency": "RMB"}, "created_at": 1763111710, "finished_at": 1763111711, "files": [], "parallel_id": null, "parallel_start_node_id": null, "parent_parallel_id": null, "parent_parallel_start_node_id": null, "iteration_id": null}}


data: {"event": "node_started", "workflow_run_id": "559d349d-4b93-4b21-821d-f99e3e4ad2b4", "task_id": "6e66effd-476f-4676-80b6-793a49033703", "data": {"id": "4f60319f-3a3b-40fe-975a-12e2470907a3", "node_id": "1763089783855", "node_type": "question-classifier", "title": "\u95ee\u9898\u5206\u7c7b\u5668", "index": 3, "predecessor_node_id": "1763014632965", "inputs": null, "created_at": 1763111711, "extras": {}, "parallel_id": null, "parallel_start_node_id": null, "parent_parallel_id": null, "parent_parallel_start_node_id": null, "iteration_id": null, "parallel_run_id": null}}


data: {"event": "node_finished", "workflow_run_id": "559d349d-4b93-4b21-821d-f99e3e4ad2b4", "task_id": "6e66effd-476f-4676-80b6-793a49033703", "data": {"id": "4f60319f-3a3b-40fe-975a-12e2470907a3", "node_id": "1763089783855", "node_type": "question-classifier", "title": "\u95ee\u9898\u5206\u7c7b\u5668", "index": 3, "predecessor_node_id": "1763014632965", "inputs": {"query": "\u597d\u7684"}, "process_data": {"model_mode": "chat", "prompts": [{"role": "system", "text": "\n    ### Job Description',\n    You are a text classification engine that analyzes text data and assigns categories based on user input or automatically determined categories.\n    ### Task\n    Your task is to assign one categories ONLY to the input text and only one category may be assigned returned in the output. Additionally, you need to extract the key words from the text that are related to the classification.\n    ### Format\n    The input text is in the variable input_text. Categories are specified as a category list with two filed category_id and category_name in the variable categories. Classification instructions may be included to improve the classification accuracy.\n    ### Constraint\n    DO NOT include anything other than the JSON array in your response.\n    ### Memory\n    Here are the chat histories between human and assistant, inside <histories></histories> XML tags.\n    <histories>\n    \n    </histories>\n", "files": []}, {"role": "user", "text": "\n    { \"input_text\": [\"I recently had a great experience with your company. The service was prompt and the staff was very friendly.\"],\n    \"categories\": [{\"category_id\":\"f5660049-284f-41a7-b301-fd24176a711c\",\"category_name\":\"Customer Service\"},{\"category_id\":\"8d007d06-f2c9-4be5-8ff6-cd4381c13c60\",\"category_name\":\"Satisfaction\"},{\"category_id\":\"5fbbbb18-9843-466d-9b8e-b9bfbb9482c8\",\"category_name\":\"Sales\"},{\"category_id\":\"23623c75-7184-4a2e-8226-466c2e4631e4\",\"category_name\":\"Product\"}],\n    \"classification_instructions\": [\"classify the text based on the feedback provided by customer\"]}\n", "files": []}, {"role": "assistant", "text": "\n```json\n    {\"keywords\": [\"recently\", \"great experience\", \"company\", \"service\", \"prompt\", \"staff\", \"friendly\"],\n    \"category_id\": \"f5660049-284f-41a7-b301-fd24176a711c\",\n    \"category_name\": \"Customer Service\"}\n```\n", "files": []}, {"role": "user", "text": "\n    {\"input_text\": [\"bad service, slow to bring the food\"],\n    \"categories\": [{\"category_id\":\"80fb86a0-4454-4bf5-924c-f253fdd83c02\",\"category_name\":\"Food Quality\"},{\"category_id\":\"f6ff5bc3-aca0-4e4a-8627-e760d0aca78f\",\"category_name\":\"Experience\"},{\"category_id\":\"cc771f63-74e7-4c61-882e-3eda9d8ba5d7\",\"category_name\":\"Price\"}],\n    \"classification_instructions\": []}\n", "files": []}, {"role": "assistant", "text": "\n```json\n    {\"keywords\": [\"bad service\", \"slow\", \"food\", \"tip\", \"terrible\", \"waitresses\"],\n    \"category_id\": \"f6ff5bc3-aca0-4e4a-8627-e760d0aca78f\",\n    \"category_name\": \"Experience\"}\n```\n", "files": []}, {"role": "user", "text": "\n    '{\"input_text\": [\"\u597d\u7684\"],',\n    '\"categories\": [{\"category_id\": \"1\", \"category_name\": \"\u54a8\u8be2\u4ea7\u54c1\u95ee\u9898-\u8d26\u53f7\u4fe1\u606f\u7ba1\u7406\"}, {\"category_id\": \"2\", \"category_name\": \"\u54a8\u8be2\u4ea7\u54c1\u95ee\u9898-\u89c2\u770b\u4f53\u9a8c\u8bbe\u7f6e\"}, {\"category_id\": \"1763089887353\", \"category_name\": \"\u54a8\u8be2\u4ea7\u54c1\u95ee\u9898-\u4e92\u52a8\u529f\u80fd\u4f7f\u7528\"}, {\"category_id\": \"1763089906355\", \"category_name\": \"\u54a8\u8be2\u4ea7\u54c1\u95ee\u9898-\u5185\u5bb9\u67e5\u627e\u4e0e\u5173\u6ce8\"}, {\"category_id\": \"1763090005887\", \"category_name\": \"\u54a8\u8be2\u4ea7\u54c1\u95ee\u9898-\u5176\u4ed6\u529f\u80fd\u54a8\u8be2\"}], ',\n    '\"classification_instructions\": [\"\u4f60\u662f\u4e00\u4e2a\u7528\u4e8e\u201c\u54a8\u8be2\u4ea7\u54c1\u95ee\u9898\u201d\u5206\u7c7b\u7684\u610f\u56fe\u8bc6\u522b\u6a21\u578b\uff0c\u8bf7\u4e25\u683c\u6309\u7167\u4ee5\u4e0b\u89c4\u5219\u5224\u65ad\u7528\u6237\u7684\u95ee\u9898\u662f\u5426\u5c5e\u4e8e\u8be5\u5206\u7c7b\u3002\n\n\u5f53\u7528\u6237\u7684\u95ee\u9898\u6d89\u53ca\u4ee5\u4e0b\u4efb\u610f\u5185\u5bb9\u65f6\uff0c\u90fd\u5e94\u5f52\u7c7b\u4e3a\u201c\u54a8\u8be2\u4ea7\u54c1\u95ee\u9898\u201d\uff1a\n\n1. \u4e2a\u4eba\u8d44\u6599\u4e0e\u8d26\u53f7\u8bbe\u7f6e\u76f8\u5173\uff1a\n   - \u4fee\u6539\u6635\u79f0\u3001\u4fee\u6539\u5934\u50cf\n   - \u7ed1\u5b9a\u6216\u89e3\u7ed1\u7b2c\u4e09\u65b9\u8d26\u53f7\uff08\u5982\u5fae\u4fe1\u3001QQ\u3001\u6296\u97f3\uff09\n\n2. \u76f4\u64ad\u95f4\u5c55\u793a\u4e0e\u89c2\u770b\u4f53\u9a8c\u76f8\u5173\uff1a\n   - \u5173\u95ed\u793c\u7269\u7279\u6548\u3001\u5173\u95ed\u8fdb\u573a\u7279\u6548\n   - \u76f4\u64ad\u753b\u8d28\u5207\u6362\u3001\u6e05\u6670\u5ea6\u8c03\u6574\n\n3. \u76f4\u64ad\u4e92\u52a8\u529f\u80fd\u76f8\u5173\uff1a\n   - \u8fde\u9ea6\u7533\u8bf7\u3001\u8fde\u9ea6\u6b65\u9aa4\n   - \u7ea2\u5305\u53c2\u4e0e\u65b9\u5f0f\u3001\u5982\u4f55\u62a2\u7ea2\u5305\n\n4. \u76f4\u64ad\u5185\u5bb9\u7ba1\u7406\u4e0e\u63d0\u9192\u529f\u80fd\u76f8\u5173\uff1a\n   - \u4e3b\u64ad\u641c\u7d22\u65b9\u6cd5\n   - \u5f00\u64ad\u63d0\u9192\u8bbe\u7f6e\n   - \u76f4\u64ad\u95f4\u6536\u85cf\u65b9\u6cd5\n\n5. \u529f\u80fd\u4f7f\u7528\u4e0e\u6a21\u5f0f\u5207\u6362\u76f8\u5173\uff1a\n   - \u5982\u4f55\u5206\u4eab\u76f4\u64ad\n   - \u9752\u5c11\u5e74\u6a21\u5f0f\u7684\u5f00\u542f\u4e0e\u5173\u95ed\n\n\u3010\u7279\u522b\u6307\u4ee4\u3011\n- \u82e5\u7528\u6237\u7684\u95ee\u9898\u4e0e\u4e0a\u8ff0\u6761\u76ee\u9ad8\u5ea6\u76f8\u5173\u6216\u8bed\u4e49\u76f8\u8fd1\uff0c\u4e5f\u5e94\u5f52\u4e3a\u201c\u54a8\u8be2\u4ea7\u54c1\u95ee\u9898\u201d\u3002\n- \u82e5\u65e0\u6cd5\u786e\u5b9a\u662f\u5426\u5c5e\u4e8e\u8fd9\u4e2a\u5206\u7c7b\uff0c\u4f18\u5148\u5224\u5b9a\u4e3a\u201c\u54a8\u8be2\u4ea7\u54c1\u95ee\u9898\u201d\uff0c\u4ee5\u907f\u514d\u6f0f\u5224\u3002\n- \u975e\u529f\u80fd\u6027\u3001\u975e\u4ea7\u54c1\u8bbe\u7f6e\u7c7b\u95ee\u9898\uff08\u5982\u4e3b\u64ad\u5de5\u8d44\u3001\u6295\u8bc9\u3001\u5c01\u7981\u3001\u6d3b\u52a8\u89c4\u5219\u7b49\uff09\u4e0d\u5f52\u7c7b\u4e3a\u54a8\u8be2\u4ea7\u54c1\u95ee\u9898\u3002\n\n\u8bf7\u53ea\u6839\u636e\u5185\u5bb9\u8bed\u4e49\u8fdb\u884c\u5224\u65ad\uff0c\u4e0d\u8981\u53d1\u6325\u60f3\u8c61\u8865\u5145\u4e0d\u5b58\u5728\u7684\u610f\u601d\u3002\n\"]}'\n", "files": []}, {"role": "user", "text": "\u597d\u7684", "files": []}], "usage": {"prompt_tokens": 1216, "prompt_unit_price": "0.02", "prompt_price_unit": "0.001", "prompt_price": "0.0243200", "completion_tokens": 42, "completion_unit_price": "0.06", "completion_price_unit": "0.001", "completion_price": "0.0025200", "total_tokens": 1258, "total_price": "0.0268400", "currency": "RMB", "latency": 2.697766289114952}, "finish_reason": "stop"}, "outputs": {"class_name": "\u54a8\u8be2\u4ea7\u54c1\u95ee\u9898-\u5176\u4ed6\u529f\u80fd\u54a8\u8be2", "class_id": "1763090005887"}, "status": "succeeded", "error": null, "elapsed_time": 2.720436, "execution_metadata": {"total_tokens": 1258, "total_price": "0.0268400", "currency": "RMB"}, "created_at": 1763111711, "finished_at": 1763111714, "files": [], "parallel_id": null, "parallel_start_node_id": null, "parent_parallel_id": null, "parent_parallel_start_node_id": null, "iteration_id": null}}


data: {"event": "node_started", "workflow_run_id": "559d349d-4b93-4b21-821d-f99e3e4ad2b4", "task_id": "6e66effd-476f-4676-80b6-793a49033703", "data": {"id": "cdb9a1ef-def4-404c-9f06-3abc8f390867", "node_id": "1763005762035", "node_type": "end", "title": "\u7ed3\u675f 2", "index": 4, "predecessor_node_id": "1763089783855", "inputs": null, "created_at": 1763111714, "extras": {}, "parallel_id": null, "parallel_start_node_id": null, "parent_parallel_id": null, "parent_parallel_start_node_id": null, "iteration_id": null, "parallel_run_id": null}}


data: {"event": "node_finished", "workflow_run_id": "559d349d-4b93-4b21-821d-f99e3e4ad2b4", "task_id": "6e66effd-476f-4676-80b6-793a49033703", "data": {"id": "cdb9a1ef-def4-404c-9f06-3abc8f390867", "node_id": "1763005762035", "node_type": "end", "title": "\u7ed3\u675f 2", "index": 4, "predecessor_node_id": "1763089783855", "inputs": {"respond": "\u597d\u7684", "type": "\u54a8\u8be2\u4ea7\u54c1\u95ee\u9898-\u5176\u4ed6\u529f\u80fd\u54a8\u8be2"}, "process_data": null, "outputs": {"respond": "\u597d\u7684", "type": "\u54a8\u8be2\u4ea7\u54c1\u95ee\u9898-\u5176\u4ed6\u529f\u80fd\u54a8\u8be2"}, "status": "succeeded", "error": null, "elapsed_time": 0.010096, "execution_metadata": null, "created_at": 1763111714, "finished_at": 1763111714, "files": [], "parallel_id": null, "parallel_start_node_id": null, "parent_parallel_id": null, "parent_parallel_start_node_id": null, "iteration_id": null}}


data: {"event": "workflow_finished", "workflow_run_id": "559d349d-4b93-4b21-821d-f99e3e4ad2b4", "task_id": "6e66effd-476f-4676-80b6-793a49033703", "data": {"id": "559d349d-4b93-4b21-821d-f99e3e4ad2b4", "workflow_id": "6cdd6555-34d3-43ca-b834-090c409b0589", "sequence_number": 30, "status": "succeeded", "outputs": {"respond": "\u597d\u7684", "type": "\u54a8\u8be2\u4ea7\u54c1\u95ee\u9898-\u5176\u4ed6\u529f\u80fd\u54a8\u8be2"}, "error": null, "elapsed_time": 4.252628937363625, "total_tokens": 1519, "total_steps": 4, "created_by": {"id": "e84e7b2e-cd6f-4145-8982-8fe8fbabdb61", "user": "abc-123"}, "created_at": 1763111710, "finished_at": 1763111714, "exceptions_count": 0, "files": []}}


比如我想获取"respond"和“type”对应的内容

收藏
全部回答(1)
最新
发布回答
回答