{"id":48498,"date":"2024-04-08T13:47:46","date_gmt":"2024-04-08T05:47:46","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=48498"},"modified":"2024-05-10T17:13:40","modified_gmt":"2024-05-10T09:13:40","slug":"chatgpt-api-jin-jie-diao-yong-zhi-nan","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2024\/04\/08\/chatgpt-api-jin-jie-diao-yong-zhi-nan\/","title":{"rendered":"ChatGPT API \u8fdb\u9636\u8c03\u7528\u6307\u5357"},"content":{"rendered":"<h1><a id=\"chatgpt-api%E8%BF%9B%E9%98%B6%E8%B0%83%E7%94%A8%E6%8C%87%E5%8D%97\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>ChatGPT API \u8fdb\u9636\u8c03\u7528\u6307\u5357<\/h1>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e9b\u4f7f\u7528 Markdown \u8bed\u6cd5\u7684\u8fdb\u9636\u8c03\u7528\u6307\u5357\uff0c\u4ee5\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u5229\u7528 ChatGPT API\u3002<\/p>\n<h2><a id=\"%E8%AE%BE%E7%BD%AE%E7%94%A8%E6%88%B7%E8%A7%92%E8%89%B2\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u8bbe\u7f6e\u7528\u6237\u89d2\u8272<\/h2>\n<p>\u5728\u5bf9\u8bdd\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u8d4b\u4e88\u7528\u6237\u7279\u5b9a\u89d2\u8272\u7684\u65b9\u5f0f\u6765\u589e\u52a0\u5bf9\u8bdd\u7684\u8da3\u5473\u6027\u548c\u4e92\u52a8\u6027\u3002\u6bd4\u5982\uff0c\u53ef\u4ee5\u8bbe\u8ba1\u4e00\u4e2a\u4ee3\u8868\u7528\u6237\u4e2a\u6027\u7279\u8272\u7684\u89d2\u8272\uff0c\u5e76\u5c06\u5176\u878d\u5165\u5bf9\u8bdd\u4e2d\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre><code class=\"language-json\">markdown\n[\n  {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n  {\"role\": \"user\", \"content\": \"Tell me a joke.\"},\n  {\"role\": \"assistant\", \"content\": \"Sure, here's a joke for you: Why don't scientists trust atoms? Because they make up everything!\"}\n]\n<\/code><\/pre>\n<p>\u5728\u8be5\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4e3a\u5bf9\u8bdd\u4e2d\u7684\u5404\u4e2a\u89d2\u8272\u521b\u5efa\u4e86\u5177\u6709 Markdown \u683c\u5f0f\u7684\u63cf\u8ff0\u5b9e\u4f53\uff0c\u5176\u4e2d\u201crole\u201d\u5c5e\u6027\u7528\u4e8e\u754c\u5b9a\u89d2\u8272\u7684\u8eab\u4efd\u540d\u79f0\uff0c\u201ccontent\u201d\u5c5e\u6027\u5219\u627f\u8f7d\u4e86\u5bf9\u5e94\u89d2\u8272\u7684\u5bf9\u8bdd\u6587\u672c\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u60a8\u53ef\u4ee5\u4fbf\u6377\u5730\u4e3a\u4e0d\u540c\u89d2\u8272\u5206\u914d\u5404\u81ea\u7684\u5bf9\u8bdd\u5185\u5bb9\uff0c\u4ece\u800c\u4e30\u5bcc\u5bf9\u8bdd\u573a\u666f\u3002<\/p>\n<h2><a id=\"%E6%A0%BC%E5%BC%8F%E5%8C%96%E5%9B%9E%E5%A4%8D\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u683c\u5f0f\u5316\u56de\u590d<\/h2>\n<p>\u8fd0\u7528 Markdown \u8bed\u8a00\uff0c\u60a8\u80fd\u591f\u5bf9 ChatGPT \u7684\u56de\u7b54\u8fdb\u884c\u7f8e\u5316\u548c\u7ed3\u6784\u5316\u5904\u7406\uff0c\u8fdb\u800c\u63d0\u5347\u5176\u53ef\u8bfb\u6027\u548c\u5438\u5f15\u529b\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u60a8\u53ef\u4ee5\u91c7\u7528 <code>**<\/code> \u7b26\u53f7\u6765\u5b9e\u73b0\u6587\u672c\u52a0\u7c97\u6548\u679c\uff0c\u7528 <code>_<\/code> \u7b26\u53f7\u6765\u6e32\u67d3\u659c\u4f53\u6837\u5f0f\uff0c\u540c\u65f6\u5229\u7528 <code>#<\/code> \u7b26\u53f7\u8bbe\u7acb\u6807\u9898\u5c42\u7ea7\uff0c\u5982\u4e0b\u6240\u793a\u7684\u6f14\u793a\uff1a<\/p>\n<pre><code class=\"language-json\">markdown\n[\n  {\"role\": \"user\", \"content\": \"Tell me about the benefits of exercise.\"},\n  {\"role\": \"assistant\", \"content\": \"**Exercise** has many benefits. It helps improve physical health and **mental well-being**. Regular exercise can also **reduce stress** and **improve sleep quality**. Exercise is also known to help **prevent chronic diseases** like obesity and cardiovascular diseases.\"},\n  {\"role\": \"user\", \"content\": \"That's interesting! Can you tell me more about mental well-being?\"}\n]\n<\/code><\/pre>\n<p>\u5728\u6b64\u6848\u4f8b\u4e2d\uff0c\u6211\u4eec\u5c06 &#8220;Exercise&#8221; \u4e00\u8bcd\u7528 <code>**<\/code> \u5305\u56f4\u4ee5\u5b9e\u73b0\u52a0\u7c97\u5c55\u793a\uff0c\u65e8\u5728\u4f7f\u5176\u5728\u56de\u590d\u5185\u5bb9\u4e2d\u66f4\u4e3a\u7a81\u51fa\uff1b\u800c\u5c06 &#8220;mental well-being&#8221; \u901a\u8fc7 <code>_<\/code> \u7b26\u53f7\u53d8\u4e3a\u659c\u4f53\uff0c\u76ee\u7684\u662f\u5f3a\u8c03\u6b64\u8bcd\u6c47\u7684\u91cd\u8981\u6027\uff1b\u53e6\u5916\uff0c\u6211\u4eec\u8fd0\u7528 <code>#<\/code> \u5c06 &#8220;Exercise&#8221; \u8bbe\u5b9a\u4e3a\u6807\u9898\u7ea7\u522b\uff0c\u4ee5\u589e\u5f3a\u5176\u89c6\u89c9\u51b2\u51fb\u529b\u548c\u9192\u76ee\u7a0b\u5ea6\u3002<\/p>\n<h2><a id=\"%E5%BC%95%E7%94%A8%E4%B8%8A%E4%B8%80%E6%9D%A1%E6%B6%88%E6%81%AF\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u5f15\u7528\u4e0a\u4e00\u6761\u6d88\u606f<\/h2>\n<p>\u5728\u5bf9\u8bdd\u8fc7\u7a0b\u4e2d\uff0c\u5f15\u5165\u4e4b\u524d\u7684\u6d88\u606f\u4f5c\u4e3a\u5f15\u7528\uff0c\u6709\u52a9\u4e8e\u786e\u4fdd\u4fe1\u606f\u7684\u524d\u540e\u4e00\u81f4\u6027\u3002\u60a8\u53ef\u4ee5\u501f\u52a9 <code>&gt; <\/code>\u7b26\u53f7\u6765\u6807\u8bc6\u5e76\u5c55\u73b0\u4e4b\u524d\u6d88\u606f\u7684\u5f15\u7528\u5185\u5bb9\uff0c\u5982\u4e0b\u6240\u6f14\u793a\uff1a<\/p>\n<pre><code class=\"language-json\">markdown\n[\n  {\"role\": \"user\", \"content\": \"Can you recommend a good Italian restaurant in the city?\"},\n  {\"role\": \"assistant\", \"content\": \"Sure! I recommend **Pasta Paradise**. It's a cozy restaurant with authentic Italian cuisine.\"},\n  {\"role\": \"user\", \"content\": \"Great! Where is it located?\"}\n]\n<\/code><\/pre>\n<p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u7528\u6237\u7684\u7b2c\u4e8c\u4e2a\u95ee\u9898\u5f15\u7528\u4e86\u5148\u524d\u52a9\u7406\u7684\u56de\u590d\uff0c\u4ee5\u4fbf\u5728\u5bf9\u8bdd\u4e2d\u4fdd\u6301\u4e0a\u4e0b\u6587\u7684\u4e00\u81f4\u6027\u3002<\/p>\n<h2><a id=\"%E4%BD%BF%E7%94%A8%E5%88%97%E8%A1%A8%E5%92%8C%E9%93%BE%E6%8E%A5\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u4f7f\u7528\u5217\u8868\u548c\u94fe\u63a5<\/h2>\n<p>Markdown \u8fd8\u652f\u6301\u521b\u5efa\u5217\u8868\u548c\u94fe\u63a5\uff0c\u53ef\u4ee5\u7528\u6765\u66f4\u597d\u5730\u7ec4\u7ec7\u548c\u5c55\u793a\u4fe1\u606f\u3002\u4f8b\u5982\uff1a<\/p>\n<ul>\n<li>\u5217\u8868\u793a\u4f8b\uff1a<\/li>\n<\/ul>\n<pre><code class=\"language-json\">markdown\n[\n  {\"role\": \"user\", \"content\": \"Can you recommend some healthy breakfast options?\"},\n  {\"role\": \"assistant\", \"content\": \"Certainly! Here are some healthy breakfast options: \\n\\n- Oatmeal with fresh fruits and nuts\\n- Greek yogurt with honey and berries\\n- Whole grain toast with avocado and eggs\\n- Smoothie with spinach, banana, and almond milk\"}\n]\n<\/code><\/pre>\n<p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u52a9\u7406\u4f7f\u7528\u4e86\u5217\u8868\u7684\u683c\u5f0f\uff0c\u5c06\u5065\u5eb7\u7684\u65e9\u9910\u9009\u9879\u5217\u51fa\uff0c\u4f7f\u5176\u66f4\u52a0\u6e05\u6670\u548c\u6613\u8bfb\u3002<\/p>\n<ul>\n<li>\u94fe\u63a5\u793a\u4f8b\uff1a<\/li>\n<\/ul>\n<pre><code class=\"language-json\">markdown\n[\n  {\"role\": \"user\", \"content\": \"Can you provide more information about the topic?\"},\n  {\"role\": \"assistant\", \"content\": \"Sure! You can refer to these resources for more information: \\n\\n- [National Institutes of Health](https:\/\/www.nih.gov\/)\\n- [World Health Organization](https:\/\/www.who.int\/)\\n- [Centers for Disease Control and Prevention](https:\/\/www.cdc.gov\/)\"}\n]\n<\/code><\/pre>\n<p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u52a9\u7406\u4f7f\u7528\u4e86\u94fe\u63a5\u7684\u683c\u5f0f\uff0c\u5c06\u76f8\u5173\u8d44\u6e90\u94fe\u63a5\u6dfb\u52a0\u5230\u56de\u590d\u4e2d\uff0c\u65b9\u4fbf\u7528\u6237\u67e5\u770b\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n<h2><a id=\"%E6%80%BB%E7%BB%93\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u603b\u7ed3<\/h2>\n<p>\u4ee5\u4e0b\u662f\u9488\u5bf9 ChatGPT API \u7684\u9ad8\u7ea7\u5e94\u7528\u6307\u5bfc\u3002\u901a\u8fc7\u914d\u7f6e\u7528\u6237\u89d2\u8272\u8bbe\u5b9a\u3001\u4f18\u5316\u56de\u590d\u683c\u5f0f\u3001\u63d2\u5165\u5148\u524d\u6d88\u606f\u5f15\u7528\u4ee5\u53ca\u8fd0\u7528\u5217\u8868\u4e0e\u94fe\u63a5\u7b49\u624b\u6bb5\uff0c\u60a8\u53ef\u4ee5\u66f4\u6709\u6548\u5730\u6784\u5efa\u548c\u5448\u73b0\u5bf9\u8bdd\u5185\u5bb9\uff0c\u4ece\u800c\u6253\u9020\u51fa\u66f4\u4e3a\u7cbe\u5f69\u7eb7\u5448\u4e14\u5f15\u4eba\u5165\u80dc\u7684\u5bf9\u8bdd\u4ea4\u4e92\u4f53\u9a8c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ChatGPT API \u8fdb\u9636\u8c03\u7528\u6307\u5357 \u4ee5\u4e0b\u662f\u4e00\u4e9b\u4f7f\u7528 Markdown \u8bed\u6cd5\u7684\u8fdb\u9636\u8c03\u7528\u6307\u5357\uff0c\u4ee5\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u5229\u7528 [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[99],"tags":[],"class_list":["post-48498","post","type-post","status-publish","format-standard","hentry","category-javabase"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/48498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/comments?post=48498"}],"version-history":[{"count":1,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/48498\/revisions"}],"predecessor-version":[{"id":48499,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/48498\/revisions\/48499"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=48498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=48498"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=48498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}