From 365274b5cc4e81657b4578164ead5a5454d4bc5c Mon Sep 17 00:00:00 2001 From: haibbo Date: Sat, 9 Dec 2023 17:03:30 +0800 Subject: [PATCH] Support DALL-E-3 now VIa variable name DEPLOY_NAME_DALLE3 --- cf-openai-azure-proxy.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cf-openai-azure-proxy.js b/cf-openai-azure-proxy.js index 4ba08cc..a1bf1aa 100644 --- a/cf-openai-azure-proxy.js +++ b/cf-openai-azure-proxy.js @@ -6,6 +6,7 @@ const mapper = { 'gpt-3.5-turbo': DEPLOY_NAME_GPT35, 'gpt-3.5-turbo-0613': DEPLOY_NAME_GPT35, 'gpt-4': DEPLOY_NAME_GPT4, + "dall-e-3": typeof DEPLOY_NAME_DALLE3 !== 'undefined' ? DEPLOY_NAME_DALLE3 : "dalle3", }; const apiVersion="2023-12-01-preview" @@ -25,6 +26,8 @@ async function handleRequest(request) { } if (url.pathname === '/v1/chat/completions') { var path="chat/completions" + } else if (url.pathname === '/v1/images/generations') { + var path="images/generations" } else if (url.pathname === '/v1/completions') { var path="completions" } else if (url.pathname === '/v1/models') {