{"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":-372.04442424896183,"y":22.337336050605984},"targetPosition":"left","sourcePosition":"right","positionAbsolute":{"x":-372.04442424896183,"y":22.337336050605984},"width":244,"height":116,"selected":false},{"id":"1721703178244","type":"custom","data":{"type":"llm","title":"LLM","desc":"","variables":[],"model":{"provider":"zhipuai","name":"glm-4","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":false},"position":{"x":48.10740655073306,"y":455.56071564948724},"targetPosition":"left","sourcePosition":"right","positionAbsolute":{"x":48.10740655073306,"y":455.56071564948724},"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":649.157165665104,"y":257},"targetPosition":"left","sourcePosition":"right","positionAbsolute":{"x":649.157165665104,"y":257},"width":244,"height":90,"selected":false}],"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,"selected":false},{"id":"1721703178244-source-1721703327908-target","type":"custom","source":"1721703178244","sourceHandle":"source","target":"1721703327908","targetHandle":"target","data":{"sourceType":"llm","targetType":"end","isInIteration":false},"zIndex":0,"selected":false}],"viewport":{"x":500.669483800579,"y":176.97561989169435,"zoom":0.6093853943072876}},"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"]}}},"environment_variables":[],"hash":"9b3000c25c35ef5cdf55e098a05e7ef945fe705ced556e79394f3eecffb31395"}curl --location --request POST 'http://172.20.238.8:48806/ai-portal/proxy/console/api/apps/216a4deb-2b26-4a99-8f78-d709085907d9/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":-372.04442424896183,"y":22.337336050605984},"targetPosition":"left","sourcePosition":"right","positionAbsolute":{"x":-372.04442424896183,"y":22.337336050605984},"width":244,"height":116,"selected":false},{"id":"1721703178244","type":"custom","data":{"type":"llm","title":"LLM","desc":"","variables":[],"model":{"provider":"zhipuai","name":"glm-4","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":false},"position":{"x":48.10740655073306,"y":455.56071564948724},"targetPosition":"left","sourcePosition":"right","positionAbsolute":{"x":48.10740655073306,"y":455.56071564948724},"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":649.157165665104,"y":257},"targetPosition":"left","sourcePosition":"right","positionAbsolute":{"x":649.157165665104,"y":257},"width":244,"height":90,"selected":false}],"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,"selected":false},{"id":"1721703178244-source-1721703327908-target","type":"custom","source":"1721703178244","sourceHandle":"source","target":"1721703327908","targetHandle":"target","data":{"sourceType":"llm","targetType":"end","isInIteration":false},"zIndex":0,"selected":false}],"viewport":{"x":500.669483800579,"y":176.97561989169435,"zoom":0.6093853943072876}},"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"]}}},"environment_variables":[],"hash":"9b3000c25c35ef5cdf55e098a05e7ef945fe705ced556e79394f3eecffb31395"}'{}