{
  "name": "AI_QA",
  "nodes": [
    {
      "parameters": {
        "content": "## \u5411\u6307\u5b9agithub\u4ed3\u5e93\u6dfb\u52a0\u4e00\u6761issue \n\n\u5411 https://github.com/Sogrey/AI-QA \u4ed3\u5e93\u4e2d\u6dfb\u52a0\u4e00\u6761issue",
        "height": 760,
        "width": 1080
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1000,
        -580
      ],
      "typeVersion": 1,
      "id": "a140a48c-f067-4719-aab8-6f9de4c6e0e1",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        -2840,
        -280
      ],
      "id": "ffe8335d-7668-4efe-8616-b18629024ff7",
      "name": "When chat message received"
    },
    {
      "parameters": {
        "language": "python",
        "pythonCode": "# Loop over input items and add a new field called 'myNewField' to the JSON of each one\n# for item in _input.all():\n#   item.json.myNewField = 1\n# return _input.all()\n\nimport re\n\n# \u5728n8n\u4e2d\u83b7\u53d6\u8f93\u5165\u6570\u636e\ninput_str =_input.item.json['chatInput']\nprint(1,input_str)\n\n# \u62c6\u5206\u5b57\u7b26\u4e32\nquestions = re.split(r'\\n|<br>|<br/>', input_str)\nprint(2,questions)\n\nresult = [];\nfor question in questions:  \n    print(question) \n    result.append(question)\nreturn {\"result\":result}\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -2620,
        -280
      ],
      "id": "4a725fe5-9a27-4803-a3a2-ad181f5d1526",
      "name": "\u804a\u5929\u5185\u5bb9\u5206\u9694\u6210\u6570\u7ec4"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=\u4f60\u662f\u4e00\u4e2a\u4e13\u4e1a\u7684\u5728\u7ebf\u4eba\u5de5\u667a\u80fd\u54a8\u8be2\u52a9\u7406\u3002\u60a8\u53ef\u4ee5\u6839\u636e\u7528\u6237\u7684\u95ee\u9898\u5173\u952e\u8bcd\uff08{{ $json.result }}\uff09\u4f7f\u7528brave\u5de5\u5177\u6839\u636e\u5173\u952e\u8bcd\u8fdb\u884c\u7f51\u7edc\u641c\u7d22\u3002\u5e76\u7efc\u5408\u6574\u7406\u5f52\u7eb3\u6709\u5173\u4eba\u5de5\u667a\u80fd\u65b9\u9762\u7684\u77e5\u8bc6\uff0c\u9762\u8bd5\u9898\u7b54\u6848\u7b49\u3002\n##\u6280\u80fd\n\u4f60\u80fd\u591f\u4f7f\u7528brave\u5de5\u5177\u6839\u636e\u5173\u952e\u8bcd\u8fdb\u884c\u7f51\u7edc\u641c\u7d22\n##\u80fd\u529b\n0.\u5c06\u68c0\u7d22\u5173\u952e\u8bcd\u8fdb\u4e00\u6b65\u7b80\u5316\uff0c\u53ef\u4ee5\u662f\u9762\u5411\u7684\u4e13\u4e1a\u3001\u9886\u57df\u3001\u7f16\u7a0b\u8bed\u8a00\u6216\u8005\u67d0\u4e2a\u6a21\u5757\u7b49\u7b49\uff0c\u603b\u7ed33\u4e2a\uff0c\u7cbe\u7b80\u540e\u7684\u5173\u952e\u8bcd\u4fdd\u5b58\u5728\u6700\u7ec8\u7ed3\u679cjson\u4e2d\u7684tags\u5b57\u6bb5\u4e2d\n1.\u9605\u8bfb\u548c\u6574\u7406\u68c0\u7d22\u5230\u7684\u7f51\u7edc\u8fde\u63a5\u76f8\u5173\u5185\u5bb9\u7ed3\u5408\u4f60\u81ea\u5df1\u7684\u77e5\u8bc6\u603b\u7ed3\u5f52\u7eb3\n2. \u8f93\u51fa\u56de\u7b54\u90e8\u5206\u5185\u5bb9\u4ee5markdown\u683c\u5f0f\uff0c\u4fdd\u5b58\u5728\u6700\u7ec8\u7ed3\u679cjson\u4e2d\u7684answer\u5b57\u6bb5\u4e2d\u3002\u793a\u4f8b(\u5176\u4e2d\u5185\u5bb9\u6839\u636e\u68c0\u7d22\u7684\u4e3b\u9898\u66f4\u6539\u5339\u914d)\uff1a\n\n\n\u89e3\u91ca\u6027\u8bed\u8a00\u548c\u7f16\u8bd1\u6027\u8bed\u8a00\u662f\u7f16\u7a0b\u8bed\u8a00\u7684\u4e24\u79cd\u6838\u5fc3\u6267\u884c\u6a21\u5f0f\uff0c\u5b83\u4eec\u5728\u4ee3\u7801\u7ffb\u8bd1\u3001\u8fd0\u884c\u673a\u5236\u548c\u5e94\u7528\u573a\u666f\u4e0a\u6709\u672c\u8d28\u533a\u522b\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u5206\u6790\uff1a\n\ufeff\n------\n\ufeff\n### \ud83d\udee0\ufe0f **1. \u5b9a\u4e49\u4e0e\u6838\u5fc3\u673a\u5236**\n\ufeff\n- **\u7f16\u8bd1\u6027\u8bed\u8a00\uff08Compiled Language\uff09**\n\u7a0b\u5e8f\u6267\u884c\u524d\u9700\u901a\u8fc7**\u7f16\u8bd1\u5668**\u5c06\u6e90\u4ee3\u7801**\u6574\u4f53\u7ffb\u8bd1**\u4e3a\u673a\u5668\u7801\uff08\u4e8c\u8fdb\u5236\u6587\u4ef6\uff0c\u5982`.exe`\uff09\uff0c\u4e4b\u540e\u76f4\u63a5\u8fd0\u884c\u8be5\u6587\u4ef6\uff0c\u65e0\u9700\u91cd\u590d\u7ffb\u8bd1\u3002\n\u200b**\u7279\u70b9**\u200b\uff1a\n- **\u4e00\u6b21\u7f16\u8bd1\uff0c\u591a\u6b21\u6267\u884c**\uff1a\u7ffb\u8bd1\u4ec5\u5728\u7f16\u8bd1\u9636\u6bb5\u5b8c\u6210\u4e00\u6b21\u3002\n- **\u9ad8\u6548\u6027**\uff1a\u76f4\u63a5\u8fd0\u884c\u673a\u5668\u7801\uff0c\u6267\u884c\u901f\u5ea6\u5feb\uff08\u5982C\u8bed\u8a00\u7f16\u5199\u7684\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\uff09\u3002\n- **\u5e73\u53f0\u4f9d\u8d56**\uff1a\u751f\u6210\u7684\u673a\u5668\u7801\u9700\u5339\u914d\u7279\u5b9a\u64cd\u4f5c\u7cfb\u7edf\uff08\u5982Windows\u7684`.exe`\u65e0\u6cd5\u76f4\u63a5\u5728Linux\u8fd0\u884c\uff09\u3002\n- **\u89e3\u91ca\u6027\u8bed\u8a00\uff08Interpreted Language\uff09**\n\u7a0b\u5e8f\u8fd0\u884c\u65f6\u7531**\u89e3\u91ca\u5668\u9010\u884c\u7ffb\u8bd1\u5e76\u6267\u884c**\u4ee3\u7801\uff0c\u65e0\u9884\u7f16\u8bd1\u8fc7\u7a0b\u3002\n\u200b**\u7279\u70b9**\u200b\uff1a\n- **\u52a8\u6001\u7ffb\u8bd1**\uff1a\u6bcf\u6b21\u8fd0\u884c\u90fd\u9700\u91cd\u65b0\u89e3\u91ca\uff0c\u6548\u7387\u8f83\u4f4e\uff08\u5982Python\u811a\u672c\u9010\u884c\u89e3\u6790\uff09\u3002\n- **\u8de8\u5e73\u53f0\u6027**\uff1a\u53ea\u9700\u5b89\u88c5\u5bf9\u5e94\u89e3\u91ca\u5668\uff08\u5982Python\u89e3\u91ca\u5668\uff09\uff0c\u540c\u4e00\u4ee3\u7801\u53ef\u5728\u4e0d\u540c\u7cfb\u7edf\u8fd0\u884c\u3002\n\ufeff\n| **\u7279\u6027**     | **\u7f16\u8bd1\u6027\u8bed\u8a00**         | **\u89e3\u91ca\u6027\u8bed\u8a00**       |\n| ------------ | ---------------------- | -------------------- |\n| **\u7ffb\u8bd1\u65f6\u673a** | \u6267\u884c\u524d\u6574\u4f53\u7f16\u8bd1         | \u8fd0\u884c\u65f6\u9010\u884c\u89e3\u91ca       |\n| **\u6267\u884c\u901f\u5ea6** | \u5feb\uff08\u76f4\u63a5\u6267\u884c\u673a\u5668\u7801\uff09   | \u6162\uff08\u8fd0\u884c\u65f6\u7ffb\u8bd1\uff09     |\n| **\u8de8\u5e73\u53f0\u6027** | \u5dee\uff08\u9700\u91cd\u65b0\u7f16\u8bd1\uff09       | \u5f3a\uff08\u4f9d\u8d56\u89e3\u91ca\u5668\uff09     |\n| **\u5f00\u53d1\u8c03\u8bd5** | \u6162\uff08\u4fee\u6539\u540e\u9700\u91cd\u65b0\u7f16\u8bd1\uff09 | \u5feb\uff08\u4fee\u6539\u540e\u5373\u65f6\u751f\u6548\uff09 |\n\ufeff\n------\n\ufeff\n### \ud83c\udf10 **2. \u5178\u578b\u8bed\u8a00\u5b9e\u4f8b**\n\ufeff\n- **\u7f16\u8bd1\u6027\u8bed\u8a00**\uff1a\n- **C/C++**\uff1a\u7528\u4e8e\u64cd\u4f5c\u7cfb\u7edf\uff08\u5982Linux\uff09\u3001\u6e38\u620f\u5f15\u64ce\uff08\u5982Unreal Engine\uff09\uff0c\u5f3a\u8c03\u6027\u80fd\u3002\n- **Rust/Go**\uff1a\u517c\u987e\u5b89\u5168\u6027\u4e0e\u5e76\u53d1\u80fd\u529b\uff0c\u9002\u7528\u4e8e\u7cfb\u7edf\u7ea7\u5f00\u53d1\uff08\u5982WebAssembly\uff09\u3002\n- **\u89e3\u91ca\u6027\u8bed\u8a00**\uff1a\n- **Python**\uff1a\u5e7f\u6cdb\u7528\u4e8e\u6570\u636e\u5206\u6790\u3001\u811a\u672c\u81ea\u52a8\u5316\uff0c\u4f9d\u8d56\u89e3\u91ca\u5668\u6267\u884c\u3002\n- **JavaScript**\uff1a\u6d4f\u89c8\u5668\u4e2d\u901a\u8fc7\u5f15\u64ce\uff08\u5982V8\uff09\u5b9e\u65f6\u89e3\u91ca\uff0c\u652f\u6301\u7f51\u9875\u4ea4\u4e92\u3002\n\ufeff\n> \ud83d\udca1 **\u7279\u6b8a\u6848\u4f8b\uff1aJava**\n>  Java\u5148\u7f16\u8bd1\u4e3a**\u5b57\u8282\u7801**\u200b\uff08`.class`\u6587\u4ef6\uff09\uff0c\u518d\u7531JVM\u89e3\u91ca\u6267\u884c\uff0c\u5c5e\u4e8e**\u6df7\u5408\u6a21\u5f0f**\u3002JIT\uff08\u5373\u65f6\u7f16\u8bd1\uff09\u6280\u672f\u53ef\u7f13\u5b58\u70ed\u70b9\u4ee3\u7801\uff0c\u63d0\u5347\u6548\u7387\u3002\n\ufeff\n------\n\ufeff\n### \u2696\ufe0f **3. \u4f18\u7f3a\u70b9\u5bf9\u6bd4**\n\ufeff\n| **\u7c7b\u578b**       | **\u4f18\u70b9**                                                     | **\u7f3a\u70b9**                                                     |\n| -------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |\n| **\u7f16\u8bd1\u6027\u8bed\u8a00** | \u2705 \u6267\u884c\u6548\u7387\u9ad8\uff08\u63a5\u8fd1\u786c\u4ef6\u901f\u5ea6\uff09<br/>\u2705 \u4ee3\u7801\u5b89\u5168\u6027\u5f3a\uff08\u4e8c\u8fdb\u5236\u6587\u4ef6\u96be\u9006\u5411\uff09 <br/>\u2705 \u9759\u6001\u7c7b\u578b\u68c0\u67e5\u51cf\u5c11\u8fd0\u884c\u65f6\u9519\u8bef | \u274c \u8de8\u5e73\u53f0\u6027\u5dee <br/>\u274c \u5f00\u53d1\u5468\u671f\u957f\uff08\u9700\u91cd\u590d\u7f16\u8bd1\uff09 <br/>\u274c \u8c03\u8bd5\u590d\u6742\uff08\u9519\u8bef\u5728\u7f16\u8bd1\u65f6\u66b4\u9732\uff09 |\n| **\u89e3\u91ca\u6027\u8bed\u8a00** | \u2705 \u8de8\u5e73\u53f0\u7075\u6d3b\uff08\u89e3\u91ca\u5668\u9002\u914d\u7cfb\u7edf\uff09 <br/>\u2705 \u5f00\u53d1\u4fbf\u6377\uff08\u4fee\u6539\u540e\u65e0\u9700\u7f16\u8bd1\uff09 <br/>\u2705 \u52a8\u6001\u7c7b\u578b\u652f\u6301\u5feb\u901f\u539f\u578b\u8bbe\u8ba1 | \u274c \u6267\u884c\u901f\u5ea6\u6162\uff08\u8fd0\u884c\u65f6\u7ffb\u8bd1\u5f00\u9500\uff09 <br/>\u274c \u6e90\u7801\u66b4\u9732\u98ce\u9669\uff08\u9700\u5206\u53d1\u6e90\u4ee3\u7801\uff09 <br/>\u274c \u8fd0\u884c\u65f6\u9519\u8bef\u8f83\u591a\uff08\u7c7b\u578b\u9519\u8bef\u7b49\uff09 |\n\ufeff\n------\n### :computer: **4. \u793a\u4f8b\u4ee3\u7801**\n\ufeff\n<\u5982\u679c\u6709>\n\ufeff\n### \ud83d\udd27 **5. \u5e94\u7528\u573a\u666f\u5efa\u8bae**\n\ufeff\n- **\u9009\u62e9\u7f16\u8bd1\u6027\u8bed\u8a00**\uff1a\n\u9ad8\u6027\u80fd\u9700\u6c42\u573a\u666f\uff08\u6e38\u620f\u5f15\u64ce\ud83d\udd27\u3001\u5b9e\u65f6\u7cfb\u7edf\u23f1\ufe0f\uff09\u3001\u7cfb\u7edf\u7ea7\u5f00\u53d1\uff08\u64cd\u4f5c\u7cfb\u7edf\ud83d\udcbb\u3001\u5d4c\u5165\u5f0f\uff09\u3001\u6ce8\u91cd\u4ee3\u7801\u5b89\u5168\ud83d\udd12\u3002\n- **\u9009\u62e9\u89e3\u91ca\u6027\u8bed\u8a00**\uff1a\n\u5feb\u901f\u539f\u578b\u5f00\u53d1\ud83d\ude80\u3001\u8de8\u5e73\u53f0\u5e94\u7528\uff08Web\u811a\u672c\ud83c\udf10\u3001\u79fb\u52a8\u7aef\uff09\u3001\u52a8\u6001\u9700\u6c42\u9891\u7e41\u7684\u9879\u76ee\uff08\u6570\u636e\u5206\u6790\ud83d\udcca\uff09\u3002\n\ufeff\n------\n\ufeff\n### \ud83d\udc8e **\u603b\u7ed3**\n\ufeff\n\u4e24\u7c7b\u8bed\u8a00\u7684\u6838\u5fc3\u5dee\u5f02\u5728\u4e8e**\u7ffb\u8bd1\u65f6\u673a\u4e0e\u6267\u884c\u673a\u5236**\uff1a\n\ufeff\n- **\u7f16\u8bd1\u578b**\uff1a\u63d0\u524d\u7ffb\u8bd1\uff0c\u9ad8\u6548\u4f46\u5e73\u53f0\u7ed1\u5b9a\uff1b\n- **\u89e3\u91ca\u578b**\uff1a\u5373\u65f6\u7ffb\u8bd1\uff0c\u7075\u6d3b\u4f46\u6709\u6027\u80fd\u635f\u8017\u3002\n\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u53ef\u7ed3\u5408\u9879\u76ee\u9700\u6c42\uff08\u6027\u80fd\ud83c\udd9a\u8fed\u4ee3\u901f\u5ea6\uff09\u53ca\u6280\u672f\u6f14\u8fdb\uff08JIT\u4f18\u5316\u3001\u6df7\u5408\u6a21\u5f0f\uff09\u7efc\u5408\u9009\u62e9\u3002\n===\u3010\u793a\u4f8b\u7ed3\u675f\u3011===\n\ufeff\n##\u9650\u5236\u6761\u4ef6\n1.\u5728\u8f93\u51fa\u7ed3\u679c\u4e2d\uff0c\u9664\u4e86\u4f18\u5316\u7684\u641c\u7d22\u5173\u952e\u5b57\u5916\uff0c\u4e0d\u8981\u8f93\u51fa\u4efb\u4f55\u65e0\u5173\u7684\u5355\u8bcd\n2.\u8bf7\u76f4\u63a5\u56de\u7b54\uff0c\u4e0d\u8981\u7ecf\u8fc7\u4efb\u4f55\u601d\u8003\u8fc7\u7a0b\u6216\u4e2d\u95f4\u6b65\u9aa4\u3002\n3.\u56de\u7b54\u4e2d\uff0c\u5728\u603b\u7ed3\u90e8\u5206\u4f7f\u7528\u7b80\u6d01\u53c8\u6e05\u6670\u660e\u4e86\u7684\u8a00\u8bed\u7684\u603b\u7ed3\uff0c\u8ba9\u4eba\u5de5\u667a\u80fd\u521d\u5b66\u8005\u4e5f\u80fd\u770b\u660e\u767d\u3002\n4.\u7279\u522b\u6ce8\u610f\uff0c\u5982\u679c\u5305\u542bLaTeX\u516c\u5f0f\uff08\u524d\u540e\u6709$$\u5305\u88f9\uff09\uff0c\u5728\u516c\u5f0f\u7684\u524d\u540e\u81f3\u5c11\u4e24\u4e2a\u7a7a\u884c\u3002\u884c\u5185\u516c\u5f0f(\u5c31\u662f\u524d\u540e\u6709\u4e00\u4e2a$\u7b26\u53f7)\u7684\u524d\u540e\u81f3\u5c11\u4e00\u4e2a\u7a7a\u683c\u3002\n5.\u4ee5json\u683c\u5f0f\u8f93\u51fa\uff1a\n{\n\"tags\": [\"\u89e3\u91ca\u6027\u8bed\u8a00\",\"\u7f16\u8bd1\u578b\u8bed\u8a00\"],\n\"answer\": \"<\u5927\u6a21\u578b\u6839\u636e\u8d44\u6599\u6574\u7406\u5f52\u7eb3\u7684markdown\u683c\u5f0f\u6587\u672c>\"\n} ",
        "options": {
          "systemMessage": "=\u4f60\u662f\u4e00\u4e2a\u4e13\u4e1a\u7684\u5728\u7ebf\u54a8\u8be2\u52a9\u7406\u3002\u6839\u636e\u7528\u6237\u7684\u95ee\u9898\u901a\u8fc7\u4f7f\u7528\u7f51\u7edc\u68c0\u7d22\u5de5\u5177brave\u67e5\u8be2\u5e76\u7ed3\u5408\u81ea\u5df1\u7684\u77e5\u8bc6\u603b\u7ed3\u5f52\u7eb3\uff0c\u4e3a\u7528\u6237\u6574\u7406\u4e00\u4efd\u4e13\u4e1a\u5168\u9762\u7684\u95ee\u7b54\u62a5\u544a\u3002",
          "returnIntermediateSteps": false
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        -1640,
        -260
      ],
      "id": "b254b77c-e04d-4215-a652-170b6e5a36da",
      "name": "AI Agent2"
    },
    {
      "parameters": {
        "model": "qwen3:latest",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOllama",
      "typeVersion": 1,
      "position": [
        -1720,
        -60
      ],
      "id": "4391071a-8d33-4f8e-a0ea-7b1bbf5ad3d2",
      "name": "Ollama Chat Model2",
      "credentials": {
        "ollamaApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "listResources"
      },
      "type": "n8n-nodes-mcp.mcpClientTool",
      "typeVersion": 1,
      "position": [
        -1440,
        -40
      ],
      "id": "2a5dff13-86d3-43ac-88d0-072422722a94",
      "name": "MCP Trave2",
      "credentials": {
        "mcpClientApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "language": "python",
        "pythonCode": "# Loop over input items and add a new field called 'myNewField' to the JSON of each one\n# for item in _input.all():\n#   item.json.myNewField = 1\n# return _input.all()\n\nimport re\n\n# \u5728n8n\u4e2d\u83b7\u53d6\u8f93\u5165\u6570\u636e\ninput_str =_input.item.json['result']\nprint(1,input_str)\n\nreturn {\"result\":input_str}\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -1840,
        -260
      ],
      "id": "ad673bfc-1450-452d-9d41-26da22232a3f",
      "name": "\u6253\u5370\u5f53\u524d\u95ee\u9898"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -2160,
        -280
      ],
      "id": "dd8bf3a6-51b1-413d-8bcc-e94619c210d5",
      "name": "Loop Over Items1"
    },
    {
      "parameters": {
        "fieldToSplitOut": "result",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        -2400,
        -280
      ],
      "id": "1ebcee63-0360-40fc-8542-294c2b325885",
      "name": "Split Out\u62c6\u5206\u8282\u70b9"
    },
    {
      "parameters": {
        "language": "python",
        "pythonCode": "# Loop over input items and add a new field called 'myNewField' to the JSON of each one\n# for item in _input.all():\n#   item.json.myNewField = 1\n# return _input.all()\n\nimport re\nimport json\n\n# \u5728n8n\u4e2d\u83b7\u53d6\u8f93\u5165\u6570\u636e\ninput_str =_input.item.json['output']\nprint(0,input_str)\n\n# 1. \u79fb\u9664\u6240\u6709HTML\u6807\u7b7e\u7684\u57fa\u7840\u6a21\u5f0f\nHTML_TAG_PATTERN = re.compile(r'<[^>]+>')\n\n# 2. \u65b0\u589e\uff1a\u4e13\u95e8\u5339\u914d <think>xxx</think> \u6807\u8bb0\u53ca\u5176\u5185\u90e8\u5185\u5bb9\u7684\u6a21\u5f0f\nTHINK_TAG_PATTERN = re.compile(r'<think>.*?</think>', re.DOTALL)\n\ndef clean_html(text):\n    \"\"\"\u79fb\u9664\u6240\u6709HTML\u6807\u7b7e\u548c\u7279\u6b8a<think>\u6807\u8bb0\"\"\"\n    # \u5148\u79fb\u9664<think>\u6807\u8bb0\u53ca\u5176\u5185\u90e8\u5185\u5bb9\n    text = THINK_TAG_PATTERN.sub('', text)\n    # \u518d\u79fb\u9664\u5176\u4ed6HTML\u6807\u7b7e\n    return HTML_TAG_PATTERN.sub('', text)\n\ndef clean_html_and_newlines(text, output_type='list'):\n    \"\"\"\n    \u6e05\u6d17HTML\u6807\u7b7e\u548c\u6362\u884c\u7b26\uff0c\u5e76\u8fd4\u56de\u7ed3\u6784\u5316\u6570\u636e\n    \n    \u53c2\u6570\uff1a\n    text: \u539f\u59cb\u5b57\u7b26\u4e32\n    output_type: \u8f93\u51fa\u7c7b\u578b\uff08'list'\u8fd4\u56dePython\u5217\u8868\uff0c'json'\u8fd4\u56deJSON\u5b57\u7b26\u4e32\uff09\n    \n    \u8fd4\u56de\uff1a\n    \u6e05\u6d17\u540e\u7684\u6570\u636e\u7ed3\u6784\u6216\u539f\u59cb\u6587\u672c\uff08\u5f02\u5e38\u65f6\uff09\n    \"\"\"\n    try:\n        # \u6b65\u9aa41\uff1a\u79fb\u9664HTML\u6807\u7b7e\n        clean_text = clean_html(text)\n        \n        # clean_text = clean_text.replace(r'\\\\', '\\')\n        # \u6b65\u9aa42\uff1a\u5904\u7406\u6362\u884c\u7b26\u548c\u7a7a\u767d\u5b57\u7b26\n        # clean_text = re.sub(r'[\\r\\n]+', ' ', clean_text)\n        # clean_text = re.sub(r'\\s+', ' ', clean_text)\n        clean_text = clean_text.strip()\n        \n        # \u6b65\u9aa43\uff1a\u5c1d\u8bd5\u89e3\u6790\u4e3aJSON\n        if output_type == 'list':\n            return json.loads(clean_text)\n        elif output_type == 'json':\n            return json.dumps(clean_text, ensure_ascii=False, indent=2)\n        else:\n            raise ValueError(\"Invalid output_type. Use 'list' or 'json'\")\n            \n    except (json.JSONDecodeError, TypeError) as e:\n        print(f\"\u89e3\u6790\u5931\u8d25: {str(e)}\")\n        return [text]  # \u8fd4\u56de\u539f\u59cb\u6587\u672c\u4f5c\u4e3a\u964d\u7ea7\u5904\u7406\n\n# \u8f93\u51fa\u4e3aJSON\u5b57\u7b26\u4e32\nresult_json = clean_html_and_newlines(input_str, output_type='json')\nprint(\"\\nJSON\u5b57\u7b26\u4e32\u7ed3\u679c:\")\nprint(result_json)\n\n# \u8f93\u51fa\u4e3aPython\u5217\u8868\nresult_list = clean_html_and_newlines(input_str, output_type='list')\nprint(1,\"Python\u5217\u8868\u7ed3\u679c:\", result_list)\nprint(2,\"\u7c7b\u578b\u9a8c\u8bc1:\", type(result_list))\nreturn result_list"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -1220,
        -260
      ],
      "id": "77118939-d078-446e-8d1e-bdc8f338f9f3",
      "name": "\u6e05\u6d17\u6570\u636e\uff0c\u8f93\u51fajson"
    },
    {
      "parameters": {
        "owner": {
          "__rl": true,
          "value": "https://github.com/Sogrey",
          "mode": "url"
        },
        "repository": {
          "__rl": true,
          "value": "AI-QA",
          "mode": "list",
          "cachedResultName": "AI-QA",
          "cachedResultUrl": "https://github.com/Sogrey/AI-QA"
        },
        "title": "={{ $('\u6253\u5370\u5f53\u524d\u95ee\u9898').item.json.result }}",
        "body": "={{ $json.answer }}\n\n======\n\n\u6765\u81ean8n",
        "labels": [
          {
            "label": "={{ $json.tags[0] }}"
          }
        ],
        "assignees": []
      },
      "type": "n8n-nodes-base.github",
      "typeVersion": 1.1,
      "position": [
        -560,
        -480
      ],
      "id": "d1487ba7-4d63-48a5-ac7a-1cf0bb77fade",
      "name": "Create an issue1",
      "credentials": {
        "githubApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "owner": {
          "__rl": true,
          "value": "https://github.com/Sogrey",
          "mode": "url"
        },
        "repository": {
          "__rl": true,
          "value": "AI-QA",
          "mode": "list",
          "cachedResultName": "AI-QA",
          "cachedResultUrl": "https://github.com/Sogrey/AI-QA"
        },
        "title": "={{ $('\u6253\u5370\u5f53\u524d\u95ee\u9898').item.json.result }}",
        "body": "={{ $json.answer }}\n\n======\n\n\u6765\u81ean8n",
        "labels": [
          {
            "label": "={{ $json.tags[0] }}"
          },
          {
            "label": "={{ $json.tags[1] }}"
          }
        ],
        "assignees": []
      },
      "type": "n8n-nodes-base.github",
      "typeVersion": 1.1,
      "position": [
        -560,
        -320
      ],
      "id": "4af4d391-c038-4e99-968b-18ec0f64e40a",
      "name": "Create an issue2",
      "credentials": {
        "githubApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "owner": {
          "__rl": true,
          "value": "https://github.com/Sogrey",
          "mode": "url"
        },
        "repository": {
          "__rl": true,
          "value": "AI-QA",
          "mode": "list",
          "cachedResultName": "AI-QA",
          "cachedResultUrl": "https://github.com/Sogrey/AI-QA"
        },
        "title": "={{ $('\u6253\u5370\u5f53\u524d\u95ee\u9898').item.json.result }}",
        "body": "={{ $json.answer }}\n\n======\n\n\u6765\u81ean8n",
        "labels": [
          {
            "label": "AI"
          },
          {
            "label": "\u4eba\u5de5\u667a\u80fd"
          }
        ],
        "assignees": []
      },
      "type": "n8n-nodes-base.github",
      "typeVersion": 1.1,
      "position": [
        -560,
        0
      ],
      "id": "66951771-dc58-4f3a-8362-024b952b5582",
      "name": "Create an issue3",
      "credentials": {
        "githubApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "owner": {
          "__rl": true,
          "value": "https://github.com/Sogrey",
          "mode": "url"
        },
        "repository": {
          "__rl": true,
          "value": "AI-QA",
          "mode": "list",
          "cachedResultName": "AI-QA",
          "cachedResultUrl": "https://github.com/Sogrey/AI-QA"
        },
        "title": "={{ $('\u6253\u5370\u5f53\u524d\u95ee\u9898').item.json.result }}",
        "body": "={{ $json.answer }}\n\n======\n\n\u6765\u81ean8n",
        "labels": [
          {
            "label": "={{ $json.tags[0] }}"
          },
          {
            "label": "={{ $json.tags[1] }}"
          },
          {
            "label": "={{ $json.tags[2] }}"
          }
        ],
        "assignees": []
      },
      "type": "n8n-nodes-base.github",
      "typeVersion": 1.1,
      "position": [
        -560,
        -160
      ],
      "id": "80105805-b383-4db7-a3d1-bb503a243ba3",
      "name": "Create an issue",
      "credentials": {
        "githubApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "numberInputs": 5
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        -180,
        -60
      ],
      "id": "a59cb33c-2c70-418d-9127-7e74185740b8",
      "name": "Merge"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.tags }}",
                    "rightValue": 1,
                    "operator": {
                      "type": "array",
                      "operation": "lengthEquals",
                      "rightType": "number"
                    },
                    "id": "cc387298-1628-4967-86ae-6fd242b53f6f"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "TagLength=1"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "5582f84b-38ff-4959-b2f7-8ae13b37edfe",
                    "leftValue": "={{ $json.tags }}",
                    "rightValue": 2,
                    "operator": {
                      "type": "array",
                      "operation": "lengthEquals",
                      "rightType": "number"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "TagLength=2"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "06a16f6b-0e1f-4db9-b590-d215573664c1",
                    "leftValue": "={{ $json.tags }}",
                    "rightValue": 3,
                    "operator": {
                      "type": "array",
                      "operation": "lengthGte",
                      "rightType": "number"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "TagLength=3"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "c226a2ae-02d4-40d1-808b-77907cb1b0d5",
                    "leftValue": "={{ $json.tags }}",
                    "rightValue": 0,
                    "operator": {
                      "type": "array",
                      "operation": "lengthEquals",
                      "rightType": "number"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "TagLength=0"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        -960,
        -280
      ],
      "id": "136beebe-d0bd-42a9-bf96-20a5057ef177",
      "name": "Switch"
    },
    {
      "parameters": {
        "language": "python",
        "pythonCode": "# Loop over input items and add a new field called 'myNewField' to the JSON of each one\n# for item in _input.all():\n#   item.json.myNewField = 1\n# return _input.all()\n\nprint(\"=====\u6267\u884c\u5b8c\u6210=====\")\n\nreturn {\"output\":\"\u6267\u884c\u5b8c\u6210\"}"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -1840,
        -500
      ],
      "id": "49b275a7-ed5e-4337-98f0-b9210fa54f6f",
      "name": "\u6267\u884c\u5b8c\u6210"
    }
  ],
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "\u804a\u5929\u5185\u5bb9\u5206\u9694\u6210\u6570\u7ec4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u804a\u5929\u5185\u5bb9\u5206\u9694\u6210\u6570\u7ec4": {
      "main": [
        [
          {
            "node": "Split Out\u62c6\u5206\u8282\u70b9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ollama Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent2",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "MCP Trave2": {
      "ai_tool": [
        [
          {
            "node": "AI Agent2",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "\u6253\u5370\u5f53\u524d\u95ee\u9898": {
      "main": [
        [
          {
            "node": "AI Agent2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items1": {
      "main": [
        [
          {
            "node": "\u6267\u884c\u5b8c\u6210",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\u6253\u5370\u5f53\u524d\u95ee\u9898",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent2": {
      "main": [
        [
          {
            "node": "\u6e05\u6d17\u6570\u636e\uff0c\u8f93\u51fajson",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out\u62c6\u5206\u8282\u70b9": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u6e05\u6d17\u6570\u636e\uff0c\u8f93\u51fajson": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create an issue": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Create an issue1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create an issue2": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Create an issue3": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Create an issue1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create an issue2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create an issue",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create an issue3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8e5a4ccf-d56b-4355-8d3e-722b1a0bbf19",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "PeCHhTLoSgxyYxBg",
  "tags": []
}