46 lines
11 KiB
Plaintext
46 lines
11 KiB
Plaintext
集团制度AI助手dify接口测试
|
||
|
||
curl -X POST 'http://df.clkeji.com/v1/chat-messages' \
|
||
--header 'Authorization: Bearer app-8fifvN9DwYeCiLOBwZaKnq4F' \
|
||
--header 'Content-Type: application/json' \
|
||
--data-raw '{
|
||
"inputs": {},
|
||
"query": "What are the specs of the iPhone 13 Pro Max?",
|
||
"response_mode": "streaming",
|
||
"conversation_id": "",
|
||
"user": "abc-123",
|
||
"files": [
|
||
{
|
||
"type": "image",
|
||
"transfer_method": "remote_url",
|
||
"url": "https://cloud.dify.ai/logo/logo-site.png"
|
||
}
|
||
]
|
||
}'
|
||
|
||
接口返回信息
|
||
|
||
data: {"event":"workflow_started","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"e8041804-adbe-4dca-b686-3338166313a2","workflow_id":"1d5da1ed-27f8-413e-bb82-56ba801ea2d2","inputs":{"sys.files":[],"sys.user_id":"abc-123","sys.app_id":"620a1161-8a63-4708-b1a8-637b2701dd7d","sys.workflow_id":"1d5da1ed-27f8-413e-bb82-56ba801ea2d2","sys.workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","sys.query":"What are the specs of the iPhone 13 Pro Max?","sys.dialogue_count":1},"created_at":1778220111,"reason":"initial"}}
|
||
|
||
data: {"event":"node_started","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"30796137-3c9c-4ba2-9544-e1b555fce241","node_id":"1711528914102","node_type":"start","title":"开始","index":1,"predecessor_node_id":null,"inputs":null,"inputs_truncated":false,"created_at":1778220111,"extras":{},"iteration_id":null,"loop_id":null,"agent_strategy":null}}
|
||
|
||
data: {"event":"message","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","answer":"ok","from_variable_selector":["1711528919501","answer"]}
|
||
|
||
data: {"event":"node_finished","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"30796137-3c9c-4ba2-9544-e1b555fce241","node_id":"1711528914102","node_type":"start","title":"开始","index":1,"predecessor_node_id":null,"inputs":{"sys.files":[],"sys.user_id":"abc-123","sys.app_id":"620a1161-8a63-4708-b1a8-637b2701dd7d","sys.workflow_id":"1d5da1ed-27f8-413e-bb82-56ba801ea2d2","sys.workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","sys.query":"What are the specs of the iPhone 13 Pro Max?","sys.conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","sys.dialogue_count":1},"inputs_truncated":false,"process_data":{},"process_data_truncated":false,"outputs":{"sys.files":[],"sys.user_id":"abc-123","sys.app_id":"620a1161-8a63-4708-b1a8-637b2701dd7d","sys.workflow_id":"1d5da1ed-27f8-413e-bb82-56ba801ea2d2","sys.workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","sys.query":"What are the specs of the iPhone 13 Pro Max?","sys.conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","sys.dialogue_count":1},"outputs_truncated":false,"status":"succeeded","error":null,"elapsed_time":0.000115,"execution_metadata":null,"created_at":1778220111,"finished_at":1778220111,"files":[],"iteration_id":null,"loop_id":null}}
|
||
|
||
data: {"event":"node_started","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"b6d426f3-a890-4a47-be7f-301c22a19834","node_id":"1778147363037","node_type":"knowledge-retrieval","title":"知识检索","index":1,"predecessor_node_id":null,"inputs":null,"inputs_truncated":false,"created_at":1778220111,"extras":{},"iteration_id":null,"loop_id":null,"agent_strategy":null}}
|
||
|
||
data: {"event":"node_finished","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"b6d426f3-a890-4a47-be7f-301c22a19834","node_id":"1778147363037","node_type":"knowledge-retrieval","title":"知识检索","index":1,"predecessor_node_id":null,"inputs":{"query":"What are the specs of the iPhone 13 Pro Max?"},"inputs_truncated":false,"process_data":{"usage":{"prompt_tokens":0,"prompt_unit_price":"0.0","prompt_price_unit":"0.0","prompt_price":"0.0","completion_tokens":0,"completion_unit_price":"0.0","completion_price_unit":"0.0","completion_price":"0.0","total_tokens":0,"total_price":"0.0","currency":"USD","latency":0.0,"time_to_first_token":null,"time_to_generate":null}},"process_data_truncated":false,"outputs":{"result":[]},"outputs_truncated":false,"status":"succeeded","error":null,"elapsed_time":0.567075,"execution_metadata":{"total_tokens":0,"total_price":"0.0","currency":"USD"},"created_at":1778220111,"finished_at":1778220112,"files":[],"iteration_id":null,"loop_id":null}}
|
||
|
||
data: {"event":"node_started","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"ed623bbb-d6a1-440f-85a2-ae8ed2f127ca","node_id":"1711528917469","node_type":"llm","title":"LLM","index":1,"predecessor_node_id":null,"inputs":null,"inputs_truncated":false,"created_at":1778220112,"extras":{},"iteration_id":null,"loop_id":null,"agent_strategy":null}}
|
||
|
||
data: {"event":"node_finished","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"ed623bbb-d6a1-440f-85a2-ae8ed2f127ca","node_id":"1711528917469","node_type":"llm","title":"LLM","index":1,"predecessor_node_id":null,"inputs":{},"inputs_truncated":false,"process_data":{"model_mode":"chat","prompts":[{"role":"system","text":"你是一个乐于助人的助手。\n使用以下内容作为你所学习的知识,放在<context></context> XML标签内。\n<context>\n{{#context#}}\n</context>\n回答用户时:\n如果你不知道,就直说你不知道。如果你在不确定的 时候不知道,就寻求澄清。\n避免提及你是从上下文中获取的信息。\n并根据用户问题的语言来回答。","files":[]},{"role":"user","text":"What are the specs of the iPhone 13 Pro Max?","files":[]}],"usage":{"prompt_tokens":103,"prompt_unit_price":"0","prompt_price_unit":"0","prompt_price":"0","completion_tokens":243,"completion_unit_price":"0","completion_price_unit":"0","completion_price":"0","total_tokens":346,"total_price":"0","currency":"USD","latency":3.909,"time_to_first_token":0.297,"time_to_generate":3.613},"finish_reason":"stop","model_provider":"langgenius/ollama/ollama","model_name":"qwen2.5:14b"},"process_data_truncated":false,"outputs":{"text":"The iPhone 13 Pro Max features a Super Retina XDR display with a resolution of 2778 by 1284 pixels. It comes in two storage variants: 128GB, 256GB, 512GB, and 1TB. The phone is powered by the A15 Bionic chip.\n\nHere are some additional specifications:\n\n- Operating system: iOS\n- Processor: Hexa-core (2x3.21 GHz Avalanche + 4x1.92 GHz Blizzard)\n- RAM: 6 GB\n- Rear camera: Triple 12 MP\n- Front camera: 12 MP TrueDepth sensor\n- Battery: Approximate battery life: Up to 28 hours of talk time, up to 104 hours of audio playback, up to 25 hours of video playback\n\nIt also has features like Super Retina XDR display with ProMotion technology (up to 120Hz), Ceramic Shield front cover, LiDAR Scanner, and more.\n\nFor the most accurate and detailed information directly from Apple, you might want to refer to their official website or product page.","reasoning_content":"","usage":{"prompt_tokens":103,"prompt_unit_price":"0","prompt_price_unit":"0","prompt_price":"0","completion_tokens":243,"completion_unit_price":"0","completion_price_unit":"0","completion_price":"0","total_tokens":346,"total_price":"0","currency":"USD","latency":3.909,"time_to_first_token":0.297,"time_to_generate":3.613},"finish_reason":"stop"},"outputs_truncated":false,"status":"succeeded","error":null,"elapsed_time":3.928194,"execution_metadata":{"total_tokens":346,"total_price":"0","currency":"USD"},"created_at":1778220112,"finished_at":1778220115,"files":[],"iteration_id":null,"loop_id":null}}
|
||
|
||
data: {"event":"node_started","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"579b24a0-083e-4459-a5b3-a777a9cec86c","node_id":"1711528919501","node_type":"answer","title":"直接回复","index":1,"predecessor_node_id":null,"inputs":null,"inputs_truncated":false,"created_at":1778220115,"extras":{},"iteration_id":null,"loop_id":null,"agent_strategy":null}}
|
||
|
||
data: {"event":"node_finished","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"579b24a0-083e-4459-a5b3-a777a9cec86c","node_id":"1711528919501","node_type":"answer","title":"直接回复","index":1,"predecessor_node_id":null,"inputs":{},"inputs_truncated":false,"process_data":{},"process_data_truncated":false,"outputs":{"answer":"ok","files":[]},"outputs_truncated":false,"status":"succeeded","error":null,"elapsed_time":0.000276,"execution_metadata":null,"created_at":1778220115,"finished_at":1778220115,"files":[],"iteration_id":null,"loop_id":null}}
|
||
|
||
data: {"event":"message_end","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","metadata":{"annotation_reply":null,"retriever_resources":[],"usage":{"prompt_tokens":103,"prompt_unit_price":"0","prompt_price_unit":"0","prompt_price":"0","completion_tokens":243,"completion_unit_price":"0","completion_price_unit":"0","completion_price":"0","total_tokens":346,"total_price":"0","currency":"USD","latency":3.909,"time_to_first_token":0.24,"time_to_generate":0.0}},"files":[]}
|
||
|
||
data: {"event":"workflow_finished","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"e8041804-adbe-4dca-b686-3338166313a2","workflow_id":"1d5da1ed-27f8-413e-bb82-56ba801ea2d2","status":"succeeded","outputs":{"answer":"ok","files":[]},"error":null,"elapsed_time":4.586759,"total_tokens":346,"total_steps":4,"created_by":{"id":"b9be62f8-bb81-45ee-95c1-57d7ae3a6d58","user":"abc-123"},"created_at":1778220111,"finished_at":1778220116,"exceptions_count":0,"files":[]}}
|