{"id":1742,"date":"2024-12-26T07:06:00","date_gmt":"2024-12-25T23:06:00","guid":{"rendered":"https:\/\/blog.laoyulaoyu.top\/?p=1742"},"modified":"2024-12-03T10:31:59","modified_gmt":"2024-12-03T02:31:59","slug":"%e6%99%ba%e8%83%bd%e5%8d%87%e7%ba%a7%ef%bc%9a%e6%9e%84%e5%bb%ba%e7%94%b1open-ai%e9%a9%b1%e5%8a%a8%e7%9a%84%e5%ae%9e%e6%97%b6%e4%ba%a4%e6%98%93%e7%b3%bb%e7%bb%9f%ef%bc%8c%e5%80%8d%e5%a2%9e%e6%94%b6","status":"publish","type":"post","link":"https:\/\/laoyulaoyu.com\/index.php\/2024\/12\/26\/%e6%99%ba%e8%83%bd%e5%8d%87%e7%ba%a7%ef%bc%9a%e6%9e%84%e5%bb%ba%e7%94%b1open-ai%e9%a9%b1%e5%8a%a8%e7%9a%84%e5%ae%9e%e6%97%b6%e4%ba%a4%e6%98%93%e7%b3%bb%e7%bb%9f%ef%bc%8c%e5%80%8d%e5%a2%9e%e6%94%b6\/","title":{"rendered":"\u667a\u80fd\u5347\u7ea7\uff1a\u6784\u5efa\u7531Open AI\u9a71\u52a8\u7684\u5b9e\u65f6\u4ea4\u6613\u7cfb\u7edf\uff0c\u500d\u589e\u6536\u76ca\u6f5c\u529b\uff08\u9644\u6e90\u4ee3\u7801\uff09"},"content":{"rendered":"\n<p>\u4f5c\u8005\uff1a<a href=\"https:\/\/www.laoyulaoyu.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u8001\u4f59\u635e\u9c7c<\/a><\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-cyan-bluish-gray-color\">\u539f\u521b\u4e0d\u6613\uff0c\u8f6c\u8f7d\u8bf7\u6807\u660e\u51fa\u5904\u53ca\u539f\u4f5c\u8005\u3002<\/mark><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/12\/102905.png\" alt=\"\" class=\"wp-image-3209\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<pre class=\"wp-block-verse\"><strong>\u5199\u5728\u524d\u9762\u7684\u8bdd\uff1a<\/strong>\u5728\u91d1\u878d\u79d1\u6280\u7684\u6d6a\u6f6e\u4e2d\uff0c\u5b9e\u65f6\u6570\u636e\u5904\u7406\u548c\u667a\u80fd\u51b3\u7b56\u7684\u91cd\u8981\u6027\u65e5\u76ca\u51f8\u663e\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5c06\u5206\u4eab\u5982\u4f55\u5229\u7528Kafka\u548cLlamaIndex\u6784\u5efa\u4e00\u5957\u57fa\u4e8eGPT-4o\u7684\u9ad8\u6548\u4eba\u5de5\u667a\u80fd\u5b9e\u65f6\u4ea4\u6613\u7cfb\u7edf\u3002\u4ece\u4e0b\u8f7d\u548c\u5206\u6790\u6b27\u5143\/\u7f8e\u5143\u5bf9\u7684\u65e5\u7ebf\u6570\u636e\uff0c\u5230\u8bbe\u7f6eKafka\u6570\u636e\u6d41\u5b9e\u65f6\u8ddf\u8e2a\u5e02\u573a\u52a8\u6001\uff0c\u518d\u5230GPT-4o\u6574\u5408\u4e86\u6240\u6709\u4fe1\u606f\u540e\u505a\u51fa\u4e70\u5165\u3001\u5356\u51fa\u6216\u6301\u6709\u7684\u51b3\u7b56\uff0c\u4ee5\u53ca\u6bcf\u6b65\u9009\u62e9\u80cc\u540e\u7684\u539f\u56e0\u5206\u6790\u3002\u6b64\u6b21\u63a2\u7d22\u4e0d\u4ec5\u662f\u4e00\u4e2a\u6280\u672f\u5b9e\u8df5\u7684\u8fc7\u7a0b\uff0c\u66f4\u662f\u4e3a\u60a8\u6253\u9020\u66f4\u9ad8\u7ea7\u7684 AI \u4ea4\u6613\u7cfb\u7edf\u63d0\u4f9b\u4e86\u575a\u5b9e\u7684\u57fa\u7840\uff0c\u4e5f\u662f\u5bf9\u672a\u6765\u91d1\u878d\u4ea4\u6613\u6a21\u5f0f\u7684\u4e00\u6b21\u6df1\u5ea6\u63a2\u7d22\u3002<\/pre>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e00\u3001\u57fa\u7840\u77e5\u8bc6<\/strong><\/h2>\n\n\n\n<p>\u672c\u6b21\u6211\u4eec\u4f7f\u7528<strong>Kafka<\/strong>\uff08\u7528\u4e8e\u6b27\u5143\/\u7f8e\u5143\u5bf9\u7684\u6570\u636e\u6d41\uff09\u3001<strong>LlamaIndex <\/strong>\u5de5\u4f5c\u6d41\uff08\u7528\u4e8e\u65e0\u7f1d\u903b\u8f91\u5904\u7406\uff09\u548cOpenAI\u7684 <strong>GPT-4o<\/strong> \u6784\u5efa\u4e00\u4e2a\u5b9e\u65f6\u4ea4\u6613\u673a\u5668\u4eba\uff0c\u5b83\u9664\u4e86\u56fe\u50cf\u8bc6\u522b\u5916\uff0c\u8fd8\u4f1a\u6574\u5408\u4fe1\u606f\u505a\u51fa\u4e70\u5165\u3001\u5356\u51fa\u6216\u6301\u6709\u51b3\u7b56\u7684\u6240\u6709\u4fe1\u606f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1.1 Kafka<\/strong><\/h3>\n\n\n\n<p>Kafka\u662f\u4e00\u4e2a\u5f00\u6e90\u6d41\u5904\u7406\u5e73\u53f0\uff0c\u7531Apache\u8f6f\u4ef6\u57fa\u91d1\u4f1a\u5f00\u53d1\u3002\u5b83\u4e3b\u8981\u7528\u4e8e\u6784\u5efa\u5b9e\u65f6\u7684\u6570\u636e\u6d41\u548c\u6d88\u606f\u961f\u5217\u7cfb\u7edf\u3002\u4ee5\u4e0b\u662fKafka\u7684\u4e00\u4e9b\u6838\u5fc3\u7279\u70b9\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/12\/image-10.png\" alt=\"\" class=\"wp-image-3211\"\/><\/figure>\n\n\n\n<p>Kafka\u901a\u5e38\u7528\u4e8e\u4ee5\u4e0b\u573a\u666f\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/12\/image-11.png\" alt=\"\" class=\"wp-image-3212\"\/><\/figure>\n\n\n\n<p>\u5728\u672c\u6b21\u9879\u76ee\u4e2d\uff0c\u6211\u4eec\u5c06\u7528 Kafka\u5efa\u7acb\u4e00\u4e2a\u6570\u636e\u6d41\uff0c\u4ee5\u6bcf5\u79d2\u63a5\u6536\u4e00\u6b21\u65b0\u5b9a\u4ef7\u6570\u636e\u7684\u65b9\u5f0f\u8ddf\u8e2a\u6b27\u5143\u5151\u7f8e\u5143\u7684\u4e70\u5165\u4ef7\u548c\u5356\u51fa\u4ef7\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"bh-Fs9hXz6bPvPsKN445Lqpf\"><strong>1.2 LlamaIndex<\/strong><\/h3>\n\n\n\n<p id=\"bh-ieuEwFQxCRLXVyTRYeNJe\">LlamaIndex\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u6846\u67b6,\u7528\u4e8e\u6784\u5efa\u57fa\u4e8e\u81ea\u7136\u8bed\u8a00\u5904\u7406\u7684\u7d22\u5f15\u548c\u67e5\u8be2\u7cfb\u7edf\u3002\u5b83\u5141\u8bb8\u7528\u6237\u901a\u8fc7\u81ea\u7136\u8bed\u8a00\u67e5\u8be2\u975e\u7ed3\u6784\u5316\u6570\u636e,\u5982\u6587\u6863\u3001\u7535\u5b50\u90ae\u4ef6\u6216\u6570\u636e\u5e93\u4e2d\u7684\u4fe1\u606f\u3002\u4ee5\u4e0b\u662fLlamaIndex\u7684\u4e00\u4e9b\u7279\u70b9\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/12\/image-12.png\" alt=\"\" class=\"wp-image-3213\"\/><\/figure>\n\n\n\n<p>LlamaIndex\u901a\u5e38\u7528\u4e8e\u4ee5\u4e0b\u573a\u666f\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/12\/image-13.png\" alt=\"\" class=\"wp-image-3214\"\/><\/figure>\n\n\n\n<p>LlamaIndex \u5de5\u4f5c\u6d41\u662f\u6211\u4eec\u673a\u5668\u4eba\u903b\u8f91\u7684\u6838\u5fc3\uff0c\u5b83\u6839\u636e\u6280\u672f\u5206\u6790\u548c GPT-4o \u56fe\u50cf\u5206\u6790\u7684\u89c1\u89e3\u5904\u7406\u5b9e\u65f6\u6570\u636e\u5e76\u505a\u51fa\u4ea4\u6613\u51b3\u7b56\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1.3 GPT-4O<\/strong><\/h3>\n\n\n\n<p>GPT-4O\u662fOpenAI\u5f00\u53d1\u7684\u4e00\u79cd\u5148\u8fdb\u7684\u81ea\u7136\u8bed\u8a00\u5904\u7406\u6a21\u578b\uff0c\u65e8\u5728\u63d0\u5347\u673a\u5668\u7406\u89e3\u548c\u751f\u6210\u6587\u672c\u7684\u80fd\u529b\u3002\u901a\u8fc7\u5bf9\u5927\u91cf\u6570\u636e\u7684\u8bad\u7ec3\uff0cGPT-4O\u80fd\u591f\u751f\u6210\u66f4\u52a0\u6d41\u7545\u548c\u81ea\u7136\u7684\u8bed\u8a00\uff0c\u76ee\u524d\u5728\u6570\u5b57\u91d1\u878d\u9886\u57df\u7684\u5e94\u7528\u4e5f\u5f00\u59cb\u5d2d\u9732\u5934\u89d2\u3002\u5176\u7279\u70b9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/12\/image-16.png\" alt=\"\" class=\"wp-image-3219\"\/><\/figure>\n\n\n\n<p>\u5728\u672c\u6587\u4e2d\uff0c GPT-4o \u5c06\u6210\u4e3a\u4e00\u4e2a\u5b9e\u65f6\u4ea4\u6613\u673a\u5668\u4eba\uff0c\u9664\u4e86\u56fe\u50cf\u8bc6\u522b\u5916\uff0c\u8fd8\u8981\u6574\u5408\u4fe1\u606f\u505a\u51fa\u4e70\u5165\u3001\u5356\u51fa\u6216\u6301\u6709\u51b3\u7b56\u7684\u6240\u6709\u4fe1\u606f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1.4 \u5de5\u4f5c\u6d41\u7a0b<\/strong><\/h3>\n\n\n\n<p>\u5728\u91d1\u878d\u9886\u57df\uff0cKafka\u53ef\u4ee5\u7528\u4e8e\u5b9e\u65f6\u5904\u7406\u4ea4\u6613\u6570\u636e\u6d41\uff0c\u800cLlamaIndex\u53ef\u4ee5\u5e2e\u52a9\u5206\u6790\u548c\u67e5\u8be2\u8fd9\u4e9b\u6570\u636e\uff0c\u4ece\u800c\u4e3a\u4ea4\u6613\u51b3\u7b56\u63d0\u4f9b\u652f\u6301\u3002\u4e24\u8005\u7684\u7ed3\u5408\u53ef\u4ee5\u6784\u5efa\u4e00\u4e2a\u5f3a\u5927\u7684\u5b9e\u65f6\u4ea4\u6613\u5206\u6790\u7cfb\u7edf\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/12\/image-14.png\" alt=\"\" class=\"wp-image-3215\"\/><\/figure>\n\n\n\n<p>\u672c\u6b21\u8981\u6784\u5efa\u7684\u5de5\u4f5c\u6d41\u7a0b\u5982\u4e0a\u56fe\u6240\u793a\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e8c\u3001\u6570\u636e\u51c6\u5907<\/strong><\/h2>\n\n\n\n<p>\u6211\u4eec\u9996\u5148\u4f7f\u7528 Selenium\uff08\u4e00\u79cd\u5e38\u7528\u4e8e\u7f51\u9875\u6293\u53d6\u7684\u5de5\u5177\uff09\u4e0b\u8f7d\u6bcf\u65e5 EUR\/USD \u56fe\u50cf\u56fe\u8868\u3002GPT-4 \u5c06\u5904\u7406\u8be5\u56fe\u50cf\u4ee5\u83b7\u5f97\u521d\u6b65\u6570\u636e\uff0c\u7136\u540e\u6307\u5bfc\u6211\u4eec\u7684\u4ea4\u6613\u673a\u5668\u4eba\u3002\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>!pip install selenium\n!apt-get install chromium-driver\nfrom selenium import webdriver\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support import expected_conditions as EC\nimport time\n\ndef initialize_web_driver():\n    \"\"\"Sets up and returns a configured Chrome WebDriver instance.\"\"\"\n    options = webdriver.ChromeOptions()\n    options.add_argument('--verbose')\n    options.add_argument('--no-sandbox')\n    options.add_argument('--headless')\n    options.add_argument('--disable-gpu')\n    options.add_argument('--window-size=1920,1200')\n    options.add_argument('--disable-dev-shm-usage')\n    driver = webdriver.Chrome(options=options)\n    return driver\n\ndriver = initialize_web_driver()\n\ntry:\n    # Navigate to the page\n    driver.get(\"https:\/\/www.tradingview.com\/symbols\/EURUSD\/\")\n\n    # Wait a few seconds for the page to load fully\n    time.sleep(4)  # Adjust sleep duration if necessary\n    driver.refresh()\n    time.sleep(4)\n\n    # Locate the chart using an appropriate selector\n    chart_element = WebDriverWait(driver, 10).until(\n        EC.presence_of_element_located((By.CLASS_NAME, \"container-nORFfEfo\"))\n    )\n\n    # Capture a screenshot of the chart element\n    time.sleep(4)\n    chart_element.screenshot(\"eurusd_chart.png\")\n    print(\"Chart screenshot saved as 'eurusd_chart.png'.\")\n\nexcept Exception as e:\n    print(\"An error occurred:\", e)\n\nfinally:\n    # Close the browser\n    driver.quit()<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u51fd\u6570&nbsp;<code>initialize_web_driver<\/code><\/strong>\uff1a\u8bbe\u7f6e\u7528\u4e8e\u4e0b\u8f7d\u6b27\u5143\/\u7f8e\u5143\u65e5\u7ebf\u56fe\u7684 Chrome WebDriver\u3002<\/li>\n\n\n\n<li><strong>\u56fe\u50cf\u6355\u6349 <strong>Image Capture<\/strong>\uff1a<\/strong>\u6355\u6349\u5e76\u4fdd\u5b58\u6b27\u5143\/\u7f8e\u5143\u56fe\u8868\u622a\u56fe\uff0cGPT-4o \u5c06\u5bf9\u5176\u8fdb\u884c\u5206\u6790\u3002<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/12\/image-17.png\" alt=\"\" class=\"wp-image-3220\"\/><\/figure>\n\n\n\n<p>\u5982\u4e0a\u56fe\u6240\u793a\uff0c\u8be5\u811a\u672c\u5c06\u4e3a\u6211\u4eec\u63d0\u4f9b\u6b27\u5143\/\u7f8e\u5143\u65e5\u7ebf\u56fe\u7684\u5feb\u7167\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e09\u3001Kafka \u5b9e\u65f6\u6d41\u8bbe\u7f6e<\/strong><\/h2>\n\n\n\n<p>\u5728\u672c\u8282\u4e2d\uff0c\u6211\u4eec\u5c06\u5efa\u7acb\u4e00\u4e2a\u57fa\u4e8e Kafka \u7684\u6570\u636e\u6d41\u8bbe\u7f6e\uff0c\u4ee5\u63a5\u8fd1\u5b9e\u65f6\u7684\u65b9\u5f0f\u8ddf\u8e2a\u6b27\u5143\u5151\u7f8e\u5143\u7684\u4e70\u5165\u4ef7\u548c\u5356\u51fa\u4ef7\u3002\u6b27\u5143\u5151\u7f8e\u5143\u4ef7\u683c\u7684\u6570\u636e\u6e90\u5c06\u4ece\u6570\u636e\u63d0\u4f9b\u5546 Investing.com \u83b7\u5f97\u3002\u4e3a\u4f7f\u8be5\u7cfb\u7edf\u6b63\u5e38\u8fd0\u884c\uff0c\u6211\u4eec\u5c06\u521b\u5efa\u4e00\u4e2a Kafka \u4e3b\u9898 eurusd_bidask\uff0c\u8be5\u4e3b\u9898\u5c06\u6bcf 5 \u79d2\u63a5\u6536\u4e00\u6b21\u65b0\u7684\u5b9a\u4ef7\u6570\u636e\u3002\u8fd9\u91cc\u7684\u6838\u5fc3\u7ec4\u6210\u90e8\u5206\u662f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Kafka Producer<\/strong>\uff1a\u8d1f\u8d23\u6bcf 5 \u79d2\u83b7\u53d6\u5e76\u5411 <code>eurusd_bidask<\/code>\u4e3b\u9898\u53d1\u5e03\u7ade\u4ef7\u4efb\u52a1\u6570\u636e\u3002<\/li>\n\n\n\n<li><strong>Kafka Consumer<\/strong>\uff1a\u5b9e\u65f6\u63a5\u6536\u548c\u5904\u7406\u6765\u81ea Kafka \u4e3b\u9898\u7684\u6570\u636e\uff0c\u5e76\u5c06\u5176\u5b58\u50a8\u8d77\u6765\u4ee5\u5907\u8fdb\u4e00\u6b65\u5206\u6790\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u8fd9\u79cd\u8bbe\u7f6e\u901a\u8fc7\u6a21\u62df\u5b9e\u65f6\u6570\u636e\u9988\u9001\u548c\u5904\u7406\uff0c\u4e3a\u6784\u5efa\u52a8\u6001\u4ea4\u6613\u673a\u5668\u4eba\u63d0\u4f9b\u4e86\u4e00\u4e2a\u8d77\u70b9\u3002\u867d\u7136\u7531\u4e8e\u7f51\u7edc\u8bf7\u6c42\uff0c\u6570\u636e\u4f1a\u7a0d\u6709\u5ef6\u8fdf\uff0c\u4f46\u5b83\u4e3a\u66f4\u590d\u6742\u7684\u4ea4\u6613\u7b56\u7565\u5960\u5b9a\u4e86\u575a\u5b9e\u7684\u57fa\u7840\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#setup kafka configuration\n!wget https:\/\/downloads.apache.org\/kafka\/3.8.1\/kafka_2.13-3.8.1.tgz\n!tar -xzf kafka_2.13-3.8.1.tgz\n!.\/kafka_2.13-3.8.1\/bin\/zookeeper-server-start.sh -daemon .\/kafka_2.13-3.8.1\/config\/zookeeper.properties\n!.\/kafka_2.13-3.8.1\/bin\/kafka-server-start.sh -daemon .\/kafka_2.13-3.8.1\/config\/server.properties\n!sleep 10\n#remove topic\n!.\/kafka_2.13-3.8.1\/bin\/kafka-topics.sh --delete --topic eurusd_bidask --bootstrap-server localhost:9092\n!.\/kafka_2.13-3.8.1\/bin\/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic eurusd_bidask<\/code><\/pre>\n\n\n\n<p>\u5728\u96c6\u6210\u6574\u4e2a\u5de5\u4f5c\u6d41\u7a0b\u4e4b\u524d\uff0c\u6211\u4eec\u5148\u6d4b\u8bd5<code>eurusd<\/code>scraper\uff0c\u786e\u4fdd\u5b83\u80fd\u4f7f\u7528&nbsp;<code>BeautifulSoup<\/code>\u5e93\u6bcf 5 \u79d2\u83b7\u53d6\u4e00\u6b21\u6570\u636e\u3002\u6b64\u5916\uff0c\u6211\u4eec\u8fd8\u8981\u68c0\u67e5 Kafka \u961f\u5217\u662f\u5426\u6b63\u5e38\u5de5\u4f5c\uff0c\u4ee5\u786e\u4fdd\u6570\u636e\u6d41\u7684\u65e0\u7f1d\u8854\u63a5\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>!pip install kafka-python nest_asyncio\n\nimport json\nimport requests\nimport time\nimport pandas as pd\nfrom kafka import KafkaProducer, KafkaConsumer\nfrom bs4 import BeautifulSoup\nimport asyncio\nimport nest_asyncio\nimport threading\n\n# Apply nest_asyncio for environments with an already running event loop (e.g., Jupyter\/Colab)\nnest_asyncio.apply()\n\n# Control variable to stop the loop\nstop_flag = False\n\n# Kafka Producer Configuration\nasync def kafka_producer():\n    producer = KafkaProducer(\n        bootstrap_servers=&#91;'localhost:9092'],\n        value_serializer=lambda v: json.dumps(v).encode('utf-8')\n    )\n\n    async def fetch_and_send_bid_ask():\n        url = 'https:\/\/www.investing.com\/currencies\/eur-usd-spreads'\n        headers = {\"User-Agent\": \"Mozilla\/5.0\"}\n        response = requests.get(url, headers=headers)\n        \n        # Check if the response is successful\n        if response.status_code == 200:\n            soup = BeautifulSoup(response.text, 'html.parser')\n            bid_element = soup.find(\"span\", class_=\"inlineblock pid-1-bid\")\n            ask_element = soup.find(\"span\", class_=\"inlineblock pid-1-ask\")\n            \n            # Check if bid and ask elements were found\n            if bid_element and ask_element:\n                bid_value = float(bid_element.text.replace(',', ''))\n                ask_value = float(ask_element.text.replace(',', ''))\n                message = {'bid': bid_value, 'ask': ask_value}\n                \n                # Send message to Kafka\n                producer.send('eurusd_bidask', value=message)\n                producer.flush()\n                print(f\"Producer sent bid: {bid_value}, ask: {ask_value}\")\n            else:\n                print(\"Error: Could not find bid\/ask elements on the page.\")\n        else:\n            print(f\"Error fetching data: Status code {response.status_code}\")\n\n    # Infinite loop to capture and send data every 5 seconds\n    while not stop_flag:\n        await fetch_and_send_bid_ask()\n        await asyncio.sleep(5)\n\n# Kafka Consumer Configuration\ndef kafka_consumer_bot():\n    consumer = KafkaConsumer(\n        'eurusd_bidask',\n        bootstrap_servers=&#91;'localhost:9092'],\n        value_deserializer=lambda x: json.loads(x.decode('utf-8')),\n        auto_offset_reset='latest',\n        enable_auto_commit=False,\n        group_id='my-group'\n    )\n\n    df = pd.DataFrame(columns=&#91;'Bid', 'Ask', 'Mid_Price'], dtype=float)\n\n    print(\"Starting Kafka consumer... Listening for messages on the 'eurusd_bidask' topic.\")\n    \n    for msg in consumer:\n        if stop_flag:\n            break\n        \n        # Debug message to show that a message has been received\n        print(f\"Consumer received raw message: {msg.value}\")\n\n        # Extract bid and ask values\n        bid = float(msg.value&#91;'bid'])\n        ask = float(msg.value&#91;'ask'])\n        mid_price = (bid + ask) \/ 2\n\n        # Add new row to DataFrame and print the updated DataFrame\n        new_row = pd.DataFrame({'Bid': &#91;bid], 'Ask': &#91;ask], 'Mid_Price': &#91;mid_price]})\n        df = pd.concat(&#91;df, new_row], ignore_index=True)\n        \n        print(f\"Consumer processed bid: {bid:.4f}, ask: {ask:.4f}, mid_price: {mid_price:.4f}\")\n        print(\"Updated DataFrame:\")\n        print(df)\n\n        # Keep only the last 50 rows\n        if len(df) &gt; 50:\n            df = df.iloc&#91;-50:].reset_index(drop=True)\n        \n        # Small sleep to avoid rapid polling in this example\n        time.sleep(5)\n\n# Main function to run both producer and consumer\nasync def main():\n    # Start the producer in the event loop\n    producer_task = asyncio.create_task(kafka_producer())\n\n    # Start the consumer in a separate thread\n    consumer_thread = threading.Thread(target=kafka_consumer_bot, daemon=True)\n    consumer_thread.start()\n\n    try:\n        await producer_task\n    except asyncio.CancelledError:\n        pass\n    finally:\n        consumer_thread.join()\n\n# Run the main function\ntry:\n    asyncio.run(main())\nexcept KeyboardInterrupt:\n    print(\"Program terminated by the user.\")<\/code><\/pre>\n\n\n\n<p>Kafka \u6d4b\u8bd5\u8f93\u51fa\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/12\/image-18.png\" alt=\"\" class=\"wp-image-3221\"\/><\/figure>\n\n\n\n<p><strong>\u63d0\u793a\uff1a<\/strong>\u5728\u6d4b\u8bd5\u8fc7\u7a0b\u4e2d\u5c1d\u8bd5\u505c\u6b62 Kafka \u961f\u5217\u65f6\uff0c\u5982\u679c\u4f60\u4f7f\u7528 Colab \u7b14\u8bb0\u672c\u53ef\u80fd\u4f1a\u9047\u5230\u95ee\u9898\u3002\u6211\u7684\u5efa\u8bae\u662f\u91cd\u542f Colab\uff0c\u91cd\u65b0\u5b89\u88c5\u5e76\u91cd\u65b0\u5bfc\u5165\u5e93\u3002\u5982\u679c\u60f3\u6d4b\u8bd5\u5b8c\u6574\u7684\u5de5\u4f5c\u6d41\u7a0b\uff0c\u8bf7\u8df3\u8fc7 Kafka \u6d4b\u8bd5\uff0c\u76f4\u63a5\u8fdb\u5165\u5b8c\u6574\u7684\u5de5\u4f5c\u6d41\u7a0b\uff0c\u786e\u4fdd\u5728\u7b2c\u4e00\u6b65\u5b89\u88c5\u6240\u6709\u4f9d\u8d56\u9879\u5e76\u83b7\u53d6\u6620\u50cf\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u56db\u3001LlamaIndex \u4ea4\u6613\u51b3\u7b56\u5de5\u4f5c\u6d41\u7a0b<\/strong><\/h2>\n\n\n\n<p>\u5148\u5b89\u88c5\u5fc5\u8981\u7684\u5e93\uff0c\u5305\u62ec\u7528\u4e8e\u5de5\u4f5c\u6d41\u7684&nbsp;<code>llama-index<\/code>&nbsp;\u3001\u7528\u4e8e Kafka \u4ea4\u4e92\u7684 <code>kafka-python<\/code>\uff0c\u4ee5\u53ca\u7528\u4e8e\u6280\u672f\u5206\u6790\u7684 <code>pandas_ta<\/code>\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Install necessary packages\n!pip install llama-index-core llama-index-llms-openai llama-index-multi-modal-llms-openai\n!pip install llama_index.readers.file\n!pip install pandas_ta\n!pip install kafka-python<\/code><\/pre>\n\n\n\n<p id=\"ecdf\">LlamaIndex \u5de5\u4f5c\u6d41\u662f\u6211\u4eec\u673a\u5668\u4eba\u903b\u8f91\u7684\u6838\u5fc3\uff0c\u5b83\u6839\u636e\u6280\u672f\u5206\u6790\u548c GPT-4o \u56fe\u50cf\u5206\u6790\u7684\u89c1\u89e3\u5904\u7406\u5b9e\u65f6\u6570\u636e\u5e76\u505a\u51fa\u4ea4\u6613\u51b3\u7b56\u3002\u8fd9\u4e9b\u662f\u4ee3\u7801\u7684\u4e3b\u8981\u90e8\u5206\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>TradingDecisionResult<\/strong><\/code><strong>&nbsp;Class<\/strong>\uff08\u4ea4\u6613\u51b3\u7b56\u7ed3\u679c\u7c7b\uff09\uff1a\u5b9a\u4e49\u7528\u4e8e\u5b58\u50a8\u4ea4\u6613\u51b3\u7b56\u548c\u63a8\u7406\u7684\u6570\u636e\u7ed3\u6784\u3002<\/li>\n\n\n\n<li><strong>\u56fe\u50cf\u5206\u6790\u6b65\u9aa4<\/strong>\uff1a\u4f7f\u7528 GPT-4 \u5206\u6790\u6355\u83b7\u7684\u6b27\u5143\/\u7f8e\u5143\u56fe\u8868\u3002\u5206\u6790\u7ed3\u679c\u5c06\u6307\u5bfc\u673a\u5668\u4eba\u7684\u521d\u59cb\u884c\u4e3a\u3002<\/li>\n\n\n\n<li><strong>\u6570\u636e\u5206\u6790\u6b65\u9aa4\uff1a<\/strong>\u8be5\u6b65\u9aa4\u5229\u7528 EMA\u3001RSI \u548c\u5e03\u6797\u7ebf\u7b49\u6280\u672f\u6307\u6807\u5206\u6790\u5b9e\u65f6\u4e70\u5356\u6570\u636e\u3002\u6839\u636e\u8fd9\u4e9b\u6307\u6807\uff0cGPT\u4f1a\u63d0\u793a\u60a8\u505a\u51fa\u4e70\u5165\u3001\u5356\u51fa\u6216\u6301\u6709\u7684\u51b3\u5b9a\uff0c\u5e76\u8bf4\u660e\u9009\u62e9\u7684\u7406\u7531\u3002<\/li>\n\n\n\n<li><strong>\u505c\u6b62\u547d\u4ee4\u76d1\u542c\u5668\uff1a<\/strong>\u76d1\u542c &#8220;stop &#8220;\u547d\u4ee4\uff0c\u5728\u5fc5\u8981\u65f6\u505c\u6b62\u7a0b\u5e8f\u3002<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/12\/image-19.png\" alt=\"\" class=\"wp-image-3222\"\/><\/figure>\n\n\n\n<p>\u4e0a\u56fe\u662f\u4ea4\u6613\u673a\u5668\u4eba\u8f93\u51fa\uff08\u56fe\u50cf\u5206\u6790\uff09\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/12\/image-20.png\" alt=\"\" class=\"wp-image-3223\"\/><\/figure>\n\n\n\n<p>\u4e0a\u56fe\u662f\u4ea4\u6613\u673a\u5668\u4eba\u8f93\u51fa\uff08\u4ea4\u6613\u51b3\u7b56\u548c\u63a8\u7406\uff09\u3002<\/p>\n\n\n\n<p>\u5728\u7f16\u7a0b\u65f6\uff0c\u7ba1\u7406\u5e93\u7248\u672c\u662f\u4e00\u4ef6\u975e\u5e38\u91cd\u8981\u7684\u4e8b\u60c5\uff0c\u56e0\u4e3a\u968f\u7740\u65f6\u95f4\u7684\u63a8\u79fb\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u517c\u5bb9\u6027\u95ee\u9898\u548c\u529f\u80fd\u8fc7\u65f6\u7684\u95ee\u9898\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u6211\u4eec\u4f7f\u7528 <code>pip freeze<\/code> \u548c<code>pip show<\/code> \u6765\u663e\u793a\u672c\u6559\u7a0b\u4e2d\u4f7f\u7528\u7684\u6240\u6709\u5e93\uff0c\u786e\u4fdd\u7248\u672c\u548c\u4f9d\u8d56\u5173\u7cfb\u7684\u900f\u660e\u5ea6\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>!pip freeze\n!pip show selenium\n!pip show llama-index-core\n!pip show llama-index-llms-openai\n!pip show llama-index-multi-modal-llms-openai\n!pip show llama_index.readers.file\n!pip show pandas_ta\n!pip show kafka-python<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e94\u3001\u672a\u6765\u5c55\u671b<\/strong><\/h2>\n\n\n\n<p>\u5728\u672a\u6765\u7684\u6559\u7a0b\u4e2d\uff0c\u6211\u8fd8\u4f1a\u6dfb\u52a0\u4e00\u9879\u529f\u80fd\uff0c\u6839\u636e\u673a\u5668\u4eba\u751f\u6210\u7684\u4ea4\u6613\u5efa\u8bae\u52a8\u6001\u8c03\u6574\u6295\u8d44\u91d1\u989d\u3002\u8fd9\u4e00\u6539\u8fdb\u5c06\u4f7f\u673a\u5668\u4eba\u5bf9\u5e02\u573a\u8d8b\u52bf\u7684\u9002\u5e94\u80fd\u529b\u548c\u53cd\u5e94\u80fd\u529b\u66f4\u5f3a\uff0c\u4ece\u800c\u505a\u51fa\u66f4\u5177\u6218\u7565\u6027\u548c\u66f4\u6709\u6548\u7387\u7684\u51b3\u7b56\u3002<\/p>\n\n\n\n<p>\u4e0d\u8fc7\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u5728\u5f53\u524d\u73af\u5883\u4e0b\u8fd0\u884c\u8be5\u673a\u5668\u4eba\u6709\u4e00\u4e9b\u9650\u5236\uff0c\u5c24\u5176\u662f\u5728 Colab \u7b14\u8bb0\u672c\u8bbe\u7f6e\u4e2d\u3002\u4f8b\u5982\uff0c\u7531\u4e8e\u7f51\u7edc\u5ef6\u8fdf\u3001\u5904\u7406\u6ede\u540e\u6216\u6570\u636e\u6e90\u7684\u9650\u5236\uff0c\u6355\u6349\u4e70\u5165\u4ef7\u548c\u5356\u51fa\u4ef7\u7684\u7f51\u7edc\u8bf7\u6c42\u53ef\u80fd\u4f1a\u51fa\u73b0\u5ef6\u8fdf\uff0c\u751a\u81f3\u65f6\u95f4\u4e0a\u7684\u8f7b\u5fae\u8bef\u5dee\u3002\u56e0\u6b64\uff0c\u6700\u521d\u7684\u673a\u5668\u4eba\u5e76\u4e0d\u80fd\u50cf\u5728\u4e0e\u91d1\u878d\u4ea4\u6613\u6240\u76f4\u63a5\u76f8\u8fde\u7684\u751f\u4ea7\u73af\u5883\u4e2d\u90a3\u6837\u5b8c\u5168\u5b9e\u65f6\u8fd0\u884c\u3002<\/p>\n\n\n\n<p><strong>\u4ee3\u7801\u4e0b\u8f7d\u5730\u5740\uff1a<\/strong><a href=\"https:\/\/github.com\/alexyu2013\/MediumArticles\/blob\/main\/Medium_EffortlessPressArticleGeneration.ipynb\">https:\/\/github.com\/alexyu2013\/MediumArticles\/blob\/main\/Medium_EffortlessPressArticleGeneration.ipynb<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u516d\u3001\u89c2\u70b9\u603b\u7ed3<\/strong><\/h2>\n\n\n\n<p>\u672c\u6587\u9610\u8ff0\u4e86\u5982\u4f55\u6355\u6349\u548c\u5904\u7406\u5b9e\u65f6\u5e02\u573a\u6570\u636e\u3001\u8fd0\u7528\u673a\u5668\u5b66\u4e60\u6a21\u578b\u63d0\u70bc\u51fa\u5b9e\u7528\u7684\u6d1e\u5bdf\uff0c\u5e76\u63a2\u8ba8\u4e86\u6784\u5efa\u6f5c\u5728\u9ad8\u7ea7AI\u9a71\u52a8\u4ea4\u6613\u7cfb\u7edf\u7684\u6838\u5fc3\u539f\u7406\u3002\u968f\u7740\u672a\u6765\u7248\u672c\u7684\u8fed\u4ee3\u548c\u6559\u7a0b\u7684\u6df1\u5165\uff0c\u6211\u4eec\u5c06\u9488\u5bf9\u73b0\u6709\u5c40\u9650\u8fdb\u884c\u6539\u8fdb\uff0c\u6bd4\u5982\u4f18\u5316\u6570\u636e\u6e90\u7684\u8fde\u63a5\u6216\u5347\u7ea7\u81f3\u751f\u4ea7\u7ea7\u670d\u52a1\u5668\u4ee5\u63d0\u5347\u5b9e\u65f6\u6027\u80fd\uff0c\u4ece\u800c\u63a8\u52a8\u8be5\u4ea4\u6613\u673a\u5668\u4eba\u5411\u66f4\u9ad8\u7ea7\u7684\u4ea4\u6613\u7b56\u7565\u8fc8\u8fdb\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5b9e\u65f6\u4ea4\u6613\u7cfb\u7edf\u7684\u91cd\u8981\u6027<\/strong>\uff1a\u5b9e\u65f6\u5904\u7406\u5e02\u573a\u6570\u636e\u7684\u975e\u5e38\u91cd\u8981\uff0c\u8fd9\u80fd\u4f7f\u60a8\u5728\u91d1\u878d\u5e02\u573a\u4e2d\u505a\u51fa\u5feb\u901f\u800c\u51c6\u786e\u7684\u4ea4\u6613\u51b3\u7b56\u3002<\/li>\n\n\n\n<li><strong>\u6280\u672f\u6808\u7684\u9009\u62e9<\/strong>\uff1a\u672c\u6587\u9009\u62e9\u4e86 Kafka \u7528\u4e8e\u6570\u636e\u6d41\u5904\u7406\uff0cLlamaIndex \u7528\u4e8e\u903b\u8f91\u5904\u7406\u548c\u5de5\u4f5c\u6d41\u7a0b\u7ba1\u7406\uff0cGPT-4o \u7528\u4e8e\u5206\u6790\u548c\u51b3\u7b56\uff0c\u5c55\u793a\u4e86\u8fd9\u4e9b\u6280\u672f\u5728\u91d1\u878d\u9886\u57df\u7684\u5e94\u7528\u6f5c\u529b\u3002<\/li>\n\n\n\n<li><strong>\u4ee3\u7801\u793a\u4f8b\u7684\u5b9e\u7528\u6027<\/strong>\uff1a\u63d0\u4f9b\u4e86\u8be6\u7ec6\u7684\u4ee3\u7801\u793a\u4f8b\uff0c\u5e2e\u52a9\u8bfb\u8005\u7406\u89e3\u5982\u4f55\u5b9e\u73b0\u5b9e\u65f6\u4ea4\u6613\u7cfb\u7edf\u7684\u5404\u4e2a\u7ec4\u4ef6\uff0c\u5305\u62ec\u6570\u636e\u91c7\u96c6\u3001\u5904\u7406\u548c\u51b3\u7b56\u3002<\/li>\n\n\n\n<li><strong>\u73af\u5883\u517c\u5bb9\u6027\u548c\u7248\u672c\u7ba1\u7406<\/strong>\uff1a\u6307\u51fa\u4e86\u5728 Colab \u73af\u5883\u4e2d\u8fd0\u884c\u4ea4\u6613\u673a\u5668\u4eba\u53ef\u80fd\u9047\u5230\u7684\u95ee\u9898\uff0c\u5e76\u5f3a\u8c03\u4e86\u7ba1\u7406\u5e93\u7248\u672c\u7684\u91cd\u8981\u6027\u3002<\/li>\n\n\n\n<li><strong>\u672a\u6765\u53d1\u5c55\u65b9\u5411<\/strong>\uff1a\u9884\u89c1\u4e86\u4ea4\u6613\u7cfb\u7edf\u7684\u672a\u6765\u6269\u5c55\uff0c\u5982\u6295\u8d44\u518d\u5e73\u8861\u529f\u80fd\uff0c\u4ee5\u53ca\u5982\u4f55\u901a\u8fc7\u6539\u8fdb\u6570\u636e\u6e90\u8fde\u63a5\u548c\u4f7f\u7528\u751f\u4ea7\u7ea7\u670d\u52a1\u5668\u6765\u63d0\u9ad8\u7cfb\u7edf\u7684\u5b9e\u65f6\u6027\u80fd\u3002<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><em>\u8c22\u8c22\u60a8\u9605\u8bfb\u5230\u6700\u540e\uff0c\u5e0c\u671b\u672c\u6587\u80fd\u7ed9\u60a8\u5e26\u6765\u65b0\u7684\u6536\u83b7\u3002\u795d\u60a8\u6295\u8d44\u987a\u5229\uff01\u5982\u679c\u5bf9\u6587\u4e2d\u7684\u5185\u5bb9\u6709\u4efb\u4f55\u7591\u95ee\uff0c\u8bf7\u7ed9\u6211\u7559\u8a00\uff0c\u5fc5\u590d\u3002<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"has-text-align-center\" id=\"a1c6\">\u672c\u6587\u5185\u5bb9\u4ec5\u9650\u6280\u672f\u63a2\u8ba8\u548c\u5b66\u4e60\uff0c\u4e0d\u6784\u6210\u4efb\u4f55\u6295\u8d44\u5efa\u8bae\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f5c\u8005\uff1a\u8001\u4f59\u635e\u9c7c \u539f\u521b\u4e0d\u6613\uff0c\u8f6c\u8f7d\u8bf7\u6807\u660e\u51fa\u5904\u53ca\u539f\u4f5c\u8005\u3002&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/laoyulaoyu.com\/index.php\/2024\/12\/26\/%e6%99%ba%e8%83%bd%e5%8d%87%e7%ba%a7%ef%bc%9a%e6%9e%84%e5%bb%ba%e7%94%b1open-ai%e9%a9%b1%e5%8a%a8%e7%9a%84%e5%ae%9e%e6%97%b6%e4%ba%a4%e6%98%93%e7%b3%bb%e7%bb%9f%ef%bc%8c%e5%80%8d%e5%a2%9e%e6%94%b6\/\">Continue reading<span class=\"screen-reader-text\">\u667a\u80fd\u5347\u7ea7\uff1a\u6784\u5efa\u7531Open AI\u9a71\u52a8\u7684\u5b9e\u65f6\u4ea4\u6613\u7cfb\u7edf\uff0c\u500d\u589e\u6536\u76ca\u6f5c\u529b\uff08\u9644\u6e90\u4ee3\u7801\uff09<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[4,5],"class_list":{"0":"post-1742","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-aiinvest","7":"tag-ai","9":"entry"},"_links":{"self":[{"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/1742","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/comments?post=1742"}],"version-history":[{"count":1,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/1742\/revisions"}],"predecessor-version":[{"id":1743,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/1742\/revisions\/1743"}],"wp:attachment":[{"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/media?parent=1742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/categories?post=1742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/tags?post=1742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}