打造本地化模型工作流-AI助手全面升级
data: {"event": "workflow_started", "workflow_run_id": "fdb58da5-87d5-4a65-8c82-214539f573a2", "task_id": "6dc14f97-cc31-404f-911b-42d4967c8e23", "data": {"id": "fdb58da5-87d5-4a65-8c82-214539f573a2", "workflow_id": "df3ab5a5-e15e-4c10-aa34-f4730dc85853", "sequence_number": 14, "inputs": {"chat": "\u4f18\u60e0\u5238", "": [], "sys.user_id": "abc-123"}, "created_at": 1720061525}}`` ``data: {"event": "node_started", "workflow_run_id": "fdb58da5-87d5-4a65-8c82-214539f573a2", "task_id": "6dc14f97-cc31-404f-911b-42d4967c8e23", "data": {"id": "59f4329b-9879-4a66-b428-9e90cc939139", "node_id": "1720001015245", "node_type": "start", "title": "\u5f00\u59cb", "index": 1, "predecessor_node_id": null, "inputs": null, "created_at": 1720061525, "extras": {}}}`` ``data: {"event": "node_finished", "workflow_run_id": "fdb58da5-87d5-4a65-8c82-214539f573a2", "task_id": "6dc14f97-cc31-404f-911b-42d4967c8e23", "data": {"id": "59f4329b-9879-4a66-b428-9e90cc939139", "node_id": "1720001015245", "node_type": "start", "title": "\u5f00\u59cb", "index": 1, "predecessor_node_id": null, "inputs": {"chat": "\u4f18\u60e0\u5238", "": [], "sys.user_id": "abc-123"}, "process_data": null, "outputs": {"chat": "\u4f18\u60e0\u5238", "": [], "sys.user_id": "abc-123"}, "status": "succeeded", "error": null, "elapsed_time": 0.0009632089931983501, "execution_metadata": null, "created_at": 1720061525, "finished_at": 1720061524, "files": []}}`` ``data: {"event": "node_started", "workflow_run_id": "fdb58da5-87d5-4a65-8c82-214539f573a2", "task_id": "6dc14f97-cc31-404f-911b-42d4967c8e23", "data": {"id": "45588b3f-7011-400e-ac88-2d22b8d12d76", "node_id": "1720058356548", "node_type": "question-classifier", "title": "\u95ee\u9898\u5206\u7c7b\u5668", "index": 2, "predecessor_node_id": "1720001015245", "inputs": null, "created_at": 1720061525, "extras": {}}}`` ``data: {"event": "node_finished", "workflow_run_id": "fdb58da5-87d5-4a65-8c82-214539f573a2", "task_id": "6dc14f97-cc31-404f-911b-42d4967c8e23", "data": {"id": "45588b3f-7011-400e-ac88-2d22b8d12d76", "node_id": "1720058356548", "node_type": "question-classifier", "title": "\u95ee\u9898\u5206\u7c7b\u5668", "index": 2, "predecessor_node_id": "1720001015245", "inputs": {"query": "\u4f18\u60e0\u5238"}, "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 , 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 text_field.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 is 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\": [\"\u4f18\u60e0\u5238\"],',\n '\"categories\": [{\"category_id\": \"1\", \"category_name\": \"\u4f18\u60e0\u5238\u95ee\u7b54\"}, {\"category_id\": \"2\", \"category_name\": \"\u666e\u901a\u95ee\u7b54\"}], ',\n '\"classification_instructions\": [\"\"]}'\n", "files": []}], "usage": {"prompt_tokens": 887, "prompt_unit_price": "0", "prompt_price_unit": "0", "prompt_price": "0.0000000", "completion_tokens": 138, "completion_unit_price": "0", "completion_price_unit": "0", "completion_price": "0.0000000", "total_tokens": 1025, "total_price": "0.0000000", "currency": "USD", "latency": 7.283583379001357}}, "outputs": {"class_name": "\u4f18\u60e0\u5238\u95ee\u7b54"}, "status": "succeeded", "error": null, "elapsed_time": 7.29491296201013, "execution_metadata": {"total_tokens": 1025, "total_price": "0.0000000", "currency": "USD"}, "created_at": 1720061525, "finished_at": 1720061531, "files": []}}`` ``data: {"event": "node_started", "workflow_run_id": "fdb58da5-87d5-4a65-8c82-214539f573a2", "task_id": "6dc14f97-cc31-404f-911b-42d4967c8e23", "data": {"id": "2e05dc89-a9e5-4461-a226-80368e1ba1b3", "node_id": "1720058784300", "node_type": "http-request", "title": "HTTP \u8bf7\u6c42 2", "index": 3, "predecessor_node_id": "1720058356548", "inputs": null, "created_at": 1720061532, "extras": {}}}`` ``data: {"event": "node_finished", "workflow_run_id": "fdb58da5-87d5-4a65-8c82-214539f573a2", "task_id": "6dc14f97-cc31-404f-911b-42d4967c8e23", "data": {"id": "2e05dc89-a9e5-4461-a226-80368e1ba1b3", "node_id": "1720058784300", "node_type": "http-request", "title": "HTTP \u8bf7\u6c42 2", "index": 3, "predecessor_node_id": "1720058356548", "inputs": null, "process_data": {"request": "GET :8080/coupon HTTP/1.1\n\n"}, "outputs": {"status_code": 200, "body": "[{\"valid_start_time\":\"2018-06-18 10:53:22\",\"name\":\"\u65b0\u4eba\u793c\u5305\u5238\",\"valid_end_time\":\"2025-10-20 10:53:25\",\"id\":\"4dbaee58d68ef8ea\",\"current_time\":\"2024-07-04 10:52:11\"},{\"valid_start_time\":\"2018-06-18 10:53:22\",\"name\":\"\u56de\u5f52\u793c\u5305\u5238\",\"valid_end_time\":\"2023-10-20 10:53:25\",\"id\":\"51dee58d68ef8ea\"}]", "headers": {"content-type": "text/plain;charset=UTF-8", "content-length": "299", "date": "Thu, 04 Jul 2024 02:52:11 GMT", "cache-status": "47ea977ee374;fwd=stale;detail=match", "via": "1.1 47ea977ee374 (squid/6.1)", "connection": "keep-alive"}, "files": []}, "status": "succeeded", "error": null, "elapsed_time": 0.06886870801099576, "execution_metadata": null, "created_at": 1720061532, "finished_at": 1720061531, "files": []}}`` ``data: {"event": "node_started", "workflow_run_id": "fdb58da5-87d5-4a65-8c82-214539f573a2", "task_id": "6dc14f97-cc31-404f-911b-42d4967c8e23", "data": {"id": "7b3e53a1-69e8-4be1-b159-62a311a7c29d", "node_id": "1720001028973", "node_type": "knowledge-retrieval", "title": "\u77e5\u8bc6\u68c0\u7d22", "index": 4, "predecessor_node_id": "1720058784300", "inputs": null, "created_at": 1720061532, "extras": {}}}`` ``data: {"event": "node_finished", "workflow_run_id": "fdb58da5-87d5-4a65-8c82-214539f573a2", "task_id": "6dc14f97-cc31-404f-911b-42d4967c8e23", "data": {"id": "7b3e53a1-69e8-4be1-b159-62a311a7c29d", "node_id": "1720001028973", "node_type": "knowledge-retrieval", "title": "\u77e5\u8bc6\u68c0\u7d22", "index": 4, "predecessor_node_id": "1720058784300", "inputs": {"query": "\u4f18\u60e0\u5238"}, "process_data": null, "outputs": {"result": [{"metadata": {"_source": "knowledge", "position": 1, "dataset_id": "9521cccb-313a-42a0-8a2f-ecc040970964", "dataset_name": "\u4f18\u60e0\u5238\u89c4\u5219", "document_id": "6790853d-cd4a-4dfa-8062-ddd1c15aa594", "document_name": "\u4f18\u60e0\u5238\u89c4\", "document_data_source_type": "upload_file", "segment_id": "a36d593d-c3c4-44cb-8ea0-758560fa72fe", "retriever_from": "workflow", "score": 0.54185438, "segment_hit_count": 10, "segment_word_count": 50, "segment_position": 1, "segment_index_node_hash": "1350de447714b3750a132bef35b6e4b16c5c89360c5ca9683ecaa50a31a81e29"}, "title": "\u4f18\u60e0\u5238\u89c4\", "content": "\u5f53\u4f18\u60e0\u5238\u7684valid_end_time\u5c5e\u6027\u5c0f\u4e8ecurrent_time\u5f53\u524d\u65f6\u95f4\u65f6\uff0c\u4f18\u60e0\u5238\u5224\u5b9a\u4e3a\u8fc7\u671f\u3002"}]}, "status": "succeeded", "error": null, "elapsed_time": 0.021647582994773984, "execution_metadata": null, "created_at": 1720061532, "finished_at": 1720061531, "files": []}}`` ``data: {"event": "node_started", "workflow_run_id": "fdb58da5-87d5-4a65-8c82-214539f573a2", "task_id": "6dc14f97-cc31-404f-911b-42d4967c8e23", "data": {"id": "861b49f6-530c-4fb2-92f1-3d690a1e27f0", "node_id": "1720058769328", "node_type": "llm", "title": "LLM 2", "index": 5, "predecessor_node_id": "1720001028973", "inputs": null, "created_at": 1720061532, "extras": {}}}`` ``event: ping`` ``data: {"event": "node_finished", "workflow_run_id": "fdb58da5-87d5-4a65-8c82-214539f573a2", "task_id": "6dc14f97-cc31-404f-911b-42d4967c8e23", "data": {"id": "861b49f6-530c-4fb2-92f1-3d690a1e27f0", "node_id": "1720058769328", "node_type": "llm", "title": "LLM 2", "index": 5, "predecessor_node_id": "1720001028973", "inputs": {"#context#": "\u5f53\u4f18\u60e0\u5238\u7684valid_end_time\u5c5e\u6027\u5c0f\u4e8ecurrent_time\u5f53\u524d\u65f6\u95f4\u65f6\uff0c\u4f18\u60e0\u5238\u5224\u5b9a\u4e3a\u8fc7\u671f\u3002"}, "process_data": {"model_mode": "chat", "prompts": [{"role": "system", "text": "\u6839\u636e[{\"valid_start_time\":\"2018-06-18 10:53:22\",\"name\":\"\u65b0\u4eba\u793c\u5305\u5238\",\"valid_end_time\":\"2025-10-20 10:53:25\",\"id\":\"4dbaee58d68ef8ea\",\"current_time\":\"2024-07-04 10:52:11\"},{\"valid_start_time\":\"2018-06-18 10:53:22\",\"name\":\"\u56de\u5f52\u793c\u5305\u5238\",\"valid_end_time\":\"2023-10-20 10:53:25\",\"id\":\"51dee58d68ef8ea\"}]\u662f\u4f18\u60e0\u5238\u7684\u5217\u8868\uff0c\u5305\u542b\u5230\u671f\u65f6\u95f4\u548c\u5f53\u524d\u65f6\u95f4\uff0c\u4f60\u4ec5\u9700\u8981\u6839\u636e\u8fd9\u4e24\u4e2a\u65f6\u95f4\u8fdb\u884c\u5224\u65ad\u3002\u4ee5\u3010\u53ef\u7528\u7684\u4f18\u60e0\u5238\u540d\u79f0\uff1axxx\uff0c\u5230\u671f\u65f6\u95f4\u4e3ayyy \u3011\u8fd9\u79cd\u683c\u5f0f\u8f93\u51fa\u3002\u4e0d\u9700\u8981\u8f93\u51fa\u63a8\u7406\u8fc7\u7a0b\uff0c\u4ec5\u6309\u89c4\u5b9a\u683c\u5f0f\u8f93\u51fa", "files": []}, {"role": "user", "text": "\u6839\u636e[{\"valid_start_time\":\"2018-06-18 10:53:22\",\"name\":\"\u65b0\u4eba\u793c\u5305\u5238\",\"valid_end_time\":\"2025-10-20 10:53:25\",\"id\":\"4dbaee58d68ef8ea\",\"current_time\":\"2024-07-04 10:52:11\"},{\"valid_start_time\":\"2018-06-18 10:53:22\",\"name\":\"\u56de\u5f52\u793c\u5305\u5238\",\"valid_end_time\":\"2023-10-20 10:53:25\",\"id\":\"51dee58d68ef8ea\"}]\u662f\u4f18\u60e0\u5238\u7684\u5217\u8868\uff0c\u5305\u542b\u5230\u671f\u65f6\u95f4\u548c\u5f53\u524d\u65f6\u95f4\uff0c\u4f60\u4ec5\u9700\u8981\u5f53\u4f18\u60e0\u5238\u7684valid_end_time\u5c5e\u6027\u5c0f\u4e8ecurrent_time\u5f53\u524d\u65f6\u95f4\u65f6\uff0c\u4f18\u60e0\u5238\u5224\u5b9a\u4e3a\u8fc7\u671f\u3002\u4ece\u77e5\u8bc6\u68c0\u7d22\u5185\u5bb9\u4e2d\uff0c\u6839\u636e\u8fd9\u4e24\u4e2a\u65f6\u95f4\u8fdb\u884c\u5224\u65ad\u3002\u4ee5\u3010\u53ef\u7528\u7684\u4f18\u60e0\u5238\u540d\u79f0\uff1axxx\uff0c\u5230\u671f\u65f6\u95f4\u4e3ayyy \u3011\u8fd9\u79cd\u683c\u5f0f\u8f93\u51fa\u3002\u4e0d\u9700\u8981\u8f93\u51fa\u63a8\u7406\u8fc7\u7a0b\uff0c\u4ec5\u6309\u89c4\u5b9a\u683c\u5f0f\u8f93\u51fa", "files": []}]}, "outputs": {"text": "\u6839\u636e\u63d0\u4f9b\u7684\u4f18\u60e0\u5238\u5217\u8868\uff1a\n\n1. \u65b0\u4eba\u793c\u5305\u5238\uff08id: 4dbaee58d68ef8ea\uff09\uff0cvalid_end_time: 2025-10-20 10:53:25\uff0ccurrent_\u65f6\u95f4: 2024-07-04 10:52:11\u3002\u8be5\u5238\u5c1a\u672a\u8fc7\u671f\u3002\n\n2. \u56de\u5f52\u793c\u5305\u5238\uff08id: 51dee58d68ef8ea\uff09\uff0cvalid_end_time: 2023-10-20 10:53:25\uff0ccurrent_\u65f6\u95f4: 2024-07-04 10:52:11\u3002\u8be5\u5238\u5df2\u8fc7\u671f\u3002\n\n\u8f93\u51fa\u683c\u5f0f\u5982\u4e0b\uff1a\n\n\u3010\u53ef\u7528\u7684\u4f18\u60e0\u5238\u540d\u79f0\uff1a\u65b0\u4eba\u793c\u5305\u5238\uff0c\u5230\u671f\u65f6\u95f4\u4e3a2025-10-20 10:53:25\u3011\n\u3010\u5df2\u8fc7\u671f\u7684\u4f18\u60e0\u5238\u540d\u79f0\uff1a\u56de\u5f52\u793c\u5305\u5238\uff0c\u5230\u671f\u65f6\u95f4\u4e3a2023-10-20 10:53:25\u3011", "usage": {"prompt_tokens": 483, "prompt_unit_price": "0", "prompt_price_unit": "0", "prompt_price": "0.0000000", "completion_tokens": 239, "completion_unit_price": "0", "completion_price_unit": "0", "completion_price": "0.0000000", "total_tokens": 722, "total_price": "0.0000000", "currency": "USD", "latency": 8.947470255021472}}, "status": "succeeded", "error": null, "elapsed_time": 8.956229670991888, "execution_metadata": {"total_tokens": 722, "total_price": "0.0000000", "currency": "USD"}, "created_at": 1720061532, "finished_at": 1720061540, "files": []}}`` ``data: {"event": "node_started", "workflow_run_id": "fdb58da5-87d5-4a65-8c82-214539f573a2", "task_id": "6dc14f97-cc31-404f-911b-42d4967c8e23", "data": {"id": "98189293-b1c5-4a91-8b81-13b318eef349", "node_id": "1720061330502", "node_type": "end", "title": "\u7ed3\u675f", "index": 6, "predecessor_node_id": "1720058769328", "inputs": null, "created_at": 1720061541, "extras": {}}}`` ``data: {"event": "node_finished", "workflow_run_id": "fdb58da5-87d5-4a65-8c82-214539f573a2", "task_id": "6dc14f97-cc31-404f-911b-42d4967c8e23", "data": {"id": "98189293-b1c5-4a91-8b81-13b318eef349", "node_id": "1720061330502", "node_type": "end", "title": "\u7ed3\u675f", "index": 6, "predecessor_node_id": "1720058769328", "inputs": null, "process_data": null, "outputs": null, "status": "succeeded", "error": null, "elapsed_time": 0.0010395830031484365, "execution_metadata": null, "created_at": 1720061541, "finished_at": 1720061540, "files": []}}`` ``data: {"event": "workflow_finished", "workflow_run_id": "fdb58da5-87d5-4a65-8c82-214539f573a2", "task_id": "6dc14f97-cc31-404f-911b-42d4967c8e23", "data": {"id": "fdb58da5-87d5-4a65-8c82-214539f573a2", "workflow_id": "df3ab5a5-e15e-4c10-aa34-f4730dc85853", "sequence_number": 14, "status": "succeeded", "outputs": null, "error": null, "elapsed_time": 16.399369008024223, "total_tokens": 1747, "total_steps": 6, "created_by": {"id": "6caaa9b1-0abd-4de7-b780-ddc5ff5f3c2a", "user": "abc-123"}, "created_at": 1720061525, "finished_at": 1720061540, "files": []}}