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: