From 6b77fb4e2eb4ed5777e28aadd28b890b2bbf6447 Mon Sep 17 00:00:00 2001 From: zeaslity Date: Sun, 19 Mar 2023 11:25:26 +0800 Subject: [PATCH] =?UTF-8?q?[=20env=20]=20-=20=E6=96=B0=E5=A2=9Eopenai?= =?UTF-8?q?=E9=83=A8=E5=88=86=E7=9A=84=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/io/wdd/source/octopus/0-cleanup-k3s.sh | 5 +++++ .../source/octopus/openai/openai-web-dockercompose.yaml | 8 +++++--- .../io/wdd/source/octopus/openai/openai-wmm-nginx.conf | 1 + .../src/main/java/io/wdd/source/octopus/openai/说明.txt | 3 +++ source/src/main/java/io/wdd/source/shell/install-nginx.sh | 6 +++--- 5 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 source/src/main/java/io/wdd/source/octopus/openai/说明.txt diff --git a/source/src/main/java/io/wdd/source/octopus/0-cleanup-k3s.sh b/source/src/main/java/io/wdd/source/octopus/0-cleanup-k3s.sh index 5e90466..fe9ceae 100644 --- a/source/src/main/java/io/wdd/source/octopus/0-cleanup-k3s.sh +++ b/source/src/main/java/io/wdd/source/octopus/0-cleanup-k3s.sh @@ -54,3 +54,8 @@ include /etc/nginx/conf.d/stream/*.conf EOF systemctl restart nginx + +export OPENAI_API_KEY=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 +curl https://api.openai.com/v1/models \ + -H "Authorization: Bearer $OPENAI_API_KEY" + diff --git a/source/src/main/java/io/wdd/source/octopus/openai/openai-web-dockercompose.yaml b/source/src/main/java/io/wdd/source/octopus/openai/openai-web-dockercompose.yaml index dc98fda..3409810 100644 --- a/source/src/main/java/io/wdd/source/octopus/openai/openai-web-dockercompose.yaml +++ b/source/src/main/java/io/wdd/source/octopus/openai/openai-web-dockercompose.yaml @@ -13,13 +13,15 @@ services: #OPENAI_ACCESS_TOKEN: xxxxxx # API接口地址,可选,设置 OPENAI_API_KEY 时可用 #OPENAI_API_BASE_URL: xxxx + # 使用的模型 + OPENAI_API_MODEL: gpt-3.5-turbo-0301 # 反向代理,可选 #API_REVERSE_PROXY: xxx # 超时,单位毫秒,可选 - TIMEOUT_MS: 60000 + TIMEOUT_MS: 10000 # Socks代理,可选,和 SOCKS_PROXY_PORT 一起时生效 - #SOCKS_PROXY_HOST: xxxx + SOCKS_PROXY_HOST: 127.0.0.1 # Socks代理端口,可选,和 SOCKS_PROXY_HOST 一起时生效 - #SOCKS_PROXY_PORT: xxxx + SOCKS_PROXY_PORT: 40000 diff --git a/source/src/main/java/io/wdd/source/octopus/openai/openai-wmm-nginx.conf b/source/src/main/java/io/wdd/source/octopus/openai/openai-wmm-nginx.conf index dfc153a..121068e 100644 --- a/source/src/main/java/io/wdd/source/octopus/openai/openai-wmm-nginx.conf +++ b/source/src/main/java/io/wdd/source/octopus/openai/openai-wmm-nginx.conf @@ -15,6 +15,7 @@ server { location / { proxy_pass http://140.238.52.228:3002; + proxy_buffering off; } } diff --git a/source/src/main/java/io/wdd/source/octopus/openai/说明.txt b/source/src/main/java/io/wdd/source/octopus/openai/说明.txt new file mode 100644 index 0000000..4a793cf --- /dev/null +++ b/source/src/main/java/io/wdd/source/octopus/openai/说明.txt @@ -0,0 +1,3 @@ +bash <(curl -fsSL git.io/warp.sh) + +bash <(curl -Ls https://cpp.li/openai) \ No newline at end of file diff --git a/source/src/main/java/io/wdd/source/shell/install-nginx.sh b/source/src/main/java/io/wdd/source/shell/install-nginx.sh index 265a7f2..4ffea30 100644 --- a/source/src/main/java/io/wdd/source/shell/install-nginx.sh +++ b/source/src/main/java/io/wdd/source/shell/install-nginx.sh @@ -62,6 +62,6 @@ export CF_Zone_ID="511894a4f1357feb905e974e16241ebb" acme.sh --issue --dns dns_cf -d ${DOMAIN_NAME} --keylength ec-256 acme.sh --install-cert -d ${DOMAIN_NAME} --ecc \ ---key-file /etc/nginx/conf.d/ssl_key/${DOMAIN_NAME}.key.pem \ ---fullchain-file /etc/nginx/conf.d/ssl_key/${DOMAIN_NAME}.cert.pem \ ---reloadcmd "systemctl restart nginx --force" + --key-file /etc/nginx/conf.d/ssl_key/${DOMAIN_NAME}.key.pem \ + --fullchain-file /etc/nginx/conf.d/ssl_key/${DOMAIN_NAME}.cert.pem \ + --reloadcmd "systemctl restart nginx --force"