From 2a6996f5d0a4573cfa28a2155d2b951795667924 Mon Sep 17 00:00:00 2001 From: qingxu fu <505030475@qq.com> Date: Mon, 18 Sep 2023 21:19:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DAzure=E7=9A=84ENDPOINT?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=85=BC=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/use_azure.md | 6 ++++++ request_llm/bridge_all.py | 1 + 2 files changed, 7 insertions(+) diff --git a/docs/use_azure.md b/docs/use_azure.md index f7e7b77..4c43a7e 100644 --- a/docs/use_azure.md +++ b/docs/use_azure.md @@ -107,6 +107,12 @@ AZURE_API_KEY = "填入azure openai api的密钥" AZURE_API_VERSION = "2023-05-15" # 默认使用 2023-05-15 版本,无需修改 AZURE_ENGINE = "填入部署名" # 见上述图片 + +# 例如 +API_KEY = '6424e9d19e674092815cea1cb35e67a5' +AZURE_ENDPOINT = 'https://rhtjjjjjj.openai.azure.com/' +AZURE_ENGINE = 'qqwe' +LLM_MODEL = "azure-gpt-3.5" # 可选 ↓↓↓ ``` diff --git a/request_llm/bridge_all.py b/request_llm/bridge_all.py index bb325e4..c4823ce 100644 --- a/request_llm/bridge_all.py +++ b/request_llm/bridge_all.py @@ -52,6 +52,7 @@ API_URL_REDIRECT, AZURE_ENDPOINT, AZURE_ENGINE = get_conf("API_URL_REDIRECT", "A openai_endpoint = "https://api.openai.com/v1/chat/completions" api2d_endpoint = "https://openai.api2d.net/v1/chat/completions" newbing_endpoint = "wss://sydney.bing.com/sydney/ChatHub" +if not AZURE_ENDPOINT.endswith('/'): AZURE_ENDPOINT += '/' azure_endpoint = AZURE_ENDPOINT + f'openai/deployments/{AZURE_ENGINE}/chat/completions?api-version=2023-05-15' # 兼容旧版的配置 try: