{"id":97,"date":"2024-03-26T09:58:32","date_gmt":"2024-03-26T01:58:32","guid":{"rendered":"https:\/\/bk.gpt4kkk.com\/?p=97"},"modified":"2024-03-26T10:08:20","modified_gmt":"2024-03-26T02:08:20","slug":"chatgpt-on-wechat%e6%8e%a5%e5%85%a5%e5%be%ae%e4%bf%a1%e5%85%ac%e4%bc%97%e5%8f%b7","status":"publish","type":"post","link":"https:\/\/bk.150831.xyz\/?p=97","title":{"rendered":"chatgpt-on-wechat\u63a5\u5165\u5fae\u4fe1\u516c\u4f17\u53f7"},"content":{"rendered":"\n<p>3\u3001\u5b89\u88c5python<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b89\u88c5\u6784\u5efaPython\u6e90\u6240\u9700\u7684\u5305\uff1a<\/li>\n<\/ul>\n\n\n\n<p><code>apt update apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>curl\u547d\u4ee4\u4ece<a rel=\"noreferrer noopener\" href=\"https:\/\/www.python.org\/downloads\/source\/\" target=\"_blank\">Python\u4e0b\u8f7d\u9875\u9762<\/a>\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u7684\u6e90\u4ee3\u7801\uff1a<\/li>\n<\/ul>\n\n\n\n<p><code>curl -O https:\/\/www.python.org\/ftp\/python\/3.8.18\/Python-3.8.18.tar.xz<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e0b\u8f7d\u5b8c\u6210\u540e\u89e3\u538btar\u538b\u7f29\u5305<\/li>\n<\/ul>\n\n\n\n<p><code>tar -xf Python-3.8.18.tar.xz<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5bfc\u822a\u5230Python\u6e90\u76ee\u5f55\u5e76\u8fd0\u884cconfigure\u811a\u672c<\/li>\n<\/ul>\n\n\n\n<p><code>cd Python-3.8.18 .\/configure --enable-optimizations<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7f16\u8bd1\u5e76\u5b89\u88c5\u7a0b\u5e8f<\/li>\n<\/ul>\n\n\n\n<p><code>make &amp;&amp; make install<\/code><\/p>\n\n\n\n<p>4\u3001\u5b89\u88c5ffmpeg<\/p>\n\n\n\n<p><code>apt install ffmpeg<\/code><\/p>\n\n\n\n<p>5\u3001\u5b89\u88c5git<\/p>\n\n\n\n<p><code>apt install git<\/code><\/p>\n\n\n\n<p>6\u3001\u514b\u9686\u9879\u76ee\u4ee3\u7801\uff1a<\/p>\n\n\n\n<p><code>git clone https:\/\/github.com\/zhayujie\/chatgpt-on-wechat cd <\/code><\/p>\n\n\n\n<p><code>chatgpt-on-wechat\/<\/code><\/p>\n\n\n\n<p>7\u3001\u5b89\u88c5\u6838\u5fc3\u4f9d\u8d56 \uff1a<code>pip3 install -r requirements.txt<\/code><\/p>\n\n\n\n<p>8\u3001\u914d\u7f6econfig.json\uff08\u914d\u7f6e\u6587\u4ef6\u7684\u6a21\u677f\u5728\u6839\u76ee\u5f55\u4e2d<code>config-template.json<\/code>\uff0c\u9700\u8981\u590d\u5236\u8be5\u6a21\u677f\u521b\u5efa\u6700\u7ec8\u751f\u6548\u7684<code>config.json<\/code>\u6587\u4ef6\uff09<\/p>\n\n\n\n<p><code>cp config-template.json config.json<\/code><\/p>\n\n\n\n<p>9\u3001\u5728\u540e\u53f0\u8fd0\u884c\u7a0b\u5e8f\u4f7f\u7528nohup\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>touch nohup.out                                   # \u9996\u6b21\u8fd0\u884c\u9700\u8981\u65b0\u5efa\u65e5\u5fd7\u6587\u4ef6  \nnohup python3 app.py &amp; tail -f nohup.out          # \u5728\u540e\u53f0\u8fd0\u884c\u7a0b\u5e8f\u5e76\u901a\u8fc7\u65e5\u5fd7\u8f93\u51fa\u4e8c\u7ef4\u7801<\/code><\/pre>\n\n\n\n<p>\u914d\u7f6econfig.json<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"channel_type\": \"wechatmp\",\n  \"model\": \"gemini\",\n \"gemini_api_key\": \"YOUR_API_KEY\",\n \"single_chat_prefix\" :\"\",\n\"wechatmp_token\": \"*\",\n\"wechatmp_port\": 80,\n\"wechatmp_app_id\": \"*\",\n\"wechatmp_app_secret\": \"*\",\n\"wechatmp_aes_key\": \"*b\",\n\"single_chat_prefix\": &#91;\"\"],\n\"single_chat_reply_prefix\": \"\",\n\"plugin_trigger_prefix\": \"&amp;\",\n \"speech_recognition\": true,\n  \"group_speech_recognition\": false,\n  \"voice_reply_voice\": true,\n  \"conversation_max_tokens\": 2500,\n  \"expires_in_seconds\": 3600,\n  \"character_desc\": \"\u4f60\u662fGemini\uff0c\u4e00\u4e2a\u7531Google AI\u8bad\u7ec3\u7684\u5927\u578b\u8bed\u8a00\u6a21\u578b\uff0c\u4f60\u65e8\u5728\u56de\u7b54\u5e76\u89e3\u51b3\u4eba\u4eec\u7684\u95ee\u9898\uff0c\u5e76\u4e14\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u8bed\u8a00\u4e0e\u4eba\u4ea4\u6d41\u3002\",\n \"use_linkai\": false,\n  \"linkai_api_key\": \"*\",\n  \"linkai_app_code\": \"*\"\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>3\u3001\u5b89\u88c5python apt update apt install build-essential zlib1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-97","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/bk.150831.xyz\/index.php?rest_route=\/wp\/v2\/posts\/97","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bk.150831.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bk.150831.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bk.150831.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bk.150831.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=97"}],"version-history":[{"count":4,"href":"https:\/\/bk.150831.xyz\/index.php?rest_route=\/wp\/v2\/posts\/97\/revisions"}],"predecessor-version":[{"id":102,"href":"https:\/\/bk.150831.xyz\/index.php?rest_route=\/wp\/v2\/posts\/97\/revisions\/102"}],"wp:attachment":[{"href":"https:\/\/bk.150831.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=97"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bk.150831.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=97"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bk.150831.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}