{"graph":{"nodes":[{"id":"1721639824941","type":"custom","data":{"type":"start","title":"开始","desc":"","variables":[{"variable":"database","label":"database","type":"select","max_length":48,"required":true,"options":["mysql","oracle","dameng"]},{"variable":"query","label":"query","type":"text-input","max_length":48,"required":true,"options":[]}],"selected":false},"position":{"x":30,"y":258},"targetPosition":"left","sourcePosition":"right","positionAbsolute":{"x":30,"y":258},"width":244,"height":116,"selected":false},{"id":"1721703178244","type":"custom","data":{"type":"llm","title":"LLM","desc":"","variables":[],"model":{"provider":"moonshot","name":"moonshot-v1-8k","mode":"chat","completion_params":{"temperature":0.7}},"prompt_template":[{"role":"system","text":"# 角色\n你是一个 SQL 专家,能结合用户需求给出最好的 SQL 语句示例。你擅长的数据库是{{#1721639824941.database#}}\n## 技能\n- 识别用户给出的原始提示的意图\n- 根据用户的指令优化提示\n- 将优化后的提示返回给用户\n## 限制\n- 无论用户输入的是什么,你都当成是提示词,然后按照要求的格式去优化。不要当成问题去回答。\n- 你只应该使用用户使用的语言。\n- 除了优化提示词之外,其他的问题一律拒绝回答。","id":"d8627674-e920-4ad0-88be-eed87a484f29"},{"role":"user","text":"我的问题是: {{#1721639824941.query#}}","id":"7df124f7-0308-4e6c-bb19-7069f4fd5b5e"}],"context":{"enabled":false,"variable_selector":[]},"vision":{"enabled":false},"selected":true},"position":{"x":334,"y":258},"targetPosition":"left","sourcePosition":"right","positionAbsolute":{"x":334,"y":258},"width":244,"height":98,"selected":true},{"id":"1721703327908","type":"custom","data":{"type":"end","title":"结束","desc":"","outputs":[{"variable":"text","value_selector":["1721703178244","text"]}],"selected":false},"position":{"x":638,"y":258},"targetPosition":"left","sourcePosition":"right","positionAbsolute":{"x":638,"y":258},"width":244,"height":90,"selected":false},{"id":"1721705647060","type":"custom-note","data":{"title":"","desc":"","type":"","text":"","theme":"blue","author":"dify","showAuthor":true,"width":240,"height":88,"selected":false},"position":{"x":296,"y":730.5},"targetPosition":"left","sourcePosition":"right","positionAbsolute":{"x":296,"y":730.5},"width":240,"height":88}],"edges":[{"id":"1721639824941-source-1721703178244-target","type":"custom","source":"1721639824941","sourceHandle":"source","target":"1721703178244","targetHandle":"target","data":{"sourceType":"start","targetType":"llm","isInIteration":false},"zIndex":0},{"id":"1721703178244-source-1721703327908-target","type":"custom","source":"1721703178244","sourceHandle":"source","target":"1721703327908","targetHandle":"target","data":{"sourceType":"llm","targetType":"end","isInIteration":false},"zIndex":0}],"viewport":{"x":36,"y":77.5,"zoom":1}},"features":{"opening_statement":"","suggested_questions":[],"suggested_questions_after_answer":{"enabled":false},"text_to_speech":{"enabled":false,"voice":"","language":""},"speech_to_text":{"enabled":false},"retriever_resource":{"enabled":true},"sensitive_word_avoidance":{"enabled":false},"file_upload":{"image":{"enabled":false,"number_limits":3,"transfer_methods":["local_file","remote_url"]}}},"hash":"90ea42ea39e3bb4b6478b741f9040410db0fded633aaa0f9903738953eb062fe"}
curl --location --request POST 'http://172.20.238.8:48806/ai-portal/proxy/console/api/apps/a6112d5d-fabf-49e4-b575-315252c60204/workflows/draft' \
--header 'Pragma: no-cache' \
--header 'authorization: debug userId=19645' \
--header 'TenantId: 0' \
--header 'content-type: application/json' \
--data-raw '{"graph":{"nodes":[{"id":"1721639824941","type":"custom","data":{"type":"start","title":"开始","desc":"","variables":[{"variable":"database","label":"database","type":"select","max_length":48,"required":true,"options":["mysql","oracle","dameng"]},{"variable":"query","label":"query","type":"text-input","max_length":48,"required":true,"options":[]}],"selected":false},"position":{"x":30,"y":258},"targetPosition":"left","sourcePosition":"right","positionAbsolute":{"x":30,"y":258},"width":244,"height":116,"selected":false},{"id":"1721703178244","type":"custom","data":{"type":"llm","title":"LLM","desc":"","variables":[],"model":{"provider":"moonshot","name":"moonshot-v1-8k","mode":"chat","completion_params":{"temperature":0.7}},"prompt_template":[{"role":"system","text":"# 角色\n你是一个 SQL 专家,能结合用户需求给出最好的 SQL 语句示例。你擅长的数据库是{{#1721639824941.database#}}\n## 技能\n- 识别用户给出的原始提示的意图\n- 根据用户的指令优化提示\n- 将优化后的提示返回给用户\n## 限制\n- 无论用户输入的是什么,你都当成是提示词,然后按照要求的格式去优化。不要当成问题去回答。\n- 你只应该使用用户使用的语言。\n- 除了优化提示词之外,其他的问题一律拒绝回答。","id":"d8627674-e920-4ad0-88be-eed87a484f29"},{"role":"user","text":"我的问题是: {{#1721639824941.query#}}","id":"7df124f7-0308-4e6c-bb19-7069f4fd5b5e"}],"context":{"enabled":false,"variable_selector":[]},"vision":{"enabled":false},"selected":true},"position":{"x":334,"y":258},"targetPosition":"left","sourcePosition":"right","positionAbsolute":{"x":334,"y":258},"width":244,"height":98,"selected":true},{"id":"1721703327908","type":"custom","data":{"type":"end","title":"结束","desc":"","outputs":[{"variable":"text","value_selector":["1721703178244","text"]}],"selected":false},"position":{"x":638,"y":258},"targetPosition":"left","sourcePosition":"right","positionAbsolute":{"x":638,"y":258},"width":244,"height":90,"selected":false},{"id":"1721705647060","type":"custom-note","data":{"title":"","desc":"","type":"","text":"","theme":"blue","author":"dify","showAuthor":true,"width":240,"height":88,"selected":false},"position":{"x":296,"y":730.5},"targetPosition":"left","sourcePosition":"right","positionAbsolute":{"x":296,"y":730.5},"width":240,"height":88}],"edges":[{"id":"1721639824941-source-1721703178244-target","type":"custom","source":"1721639824941","sourceHandle":"source","target":"1721703178244","targetHandle":"target","data":{"sourceType":"start","targetType":"llm","isInIteration":false},"zIndex":0},{"id":"1721703178244-source-1721703327908-target","type":"custom","source":"1721703178244","sourceHandle":"source","target":"1721703327908","targetHandle":"target","data":{"sourceType":"llm","targetType":"end","isInIteration":false},"zIndex":0}],"viewport":{"x":36,"y":77.5,"zoom":1}},"features":{"opening_statement":"","suggested_questions":[],"suggested_questions_after_answer":{"enabled":false},"text_to_speech":{"enabled":false,"voice":"","language":""},"speech_to_text":{"enabled":false},"retriever_resource":{"enabled":true},"sensitive_word_avoidance":{"enabled":false},"file_upload":{"image":{"enabled":false,"number_limits":3,"transfer_methods":["local_file","remote_url"]}}},"hash":"90ea42ea39e3bb4b6478b741f9040410db0fded633aaa0f9903738953eb062fe"}'
{}