cf-openai-azure-proxy
cf-openai-azure-proxy copied to clipboard
A Cloudflare worker script to proxy OpenAI‘s request to Azure OpenAI Service
I resolved the compatibility issue with ChatGPT Web Next by setting the response Content-Type to text/event-stream. Please see the changes in my express app https://github.com/ShinChven/cf-openai-azure-proxy/commit/f642d34cda64b8b08a8f81486837d94b62fa6370 (Pull request not merged https://github.com/haibbo/cf-openai-azure-proxy/pull/53)
Azure API may encounter internal server error occasionally, when this happens a raw HTML source code is returned which harms user experience. This PR catches internal server error exceptions, provides...
是否考虑支持openai的其他功能,例如 embeddings
1. Added support for the new gpt-35-turbo-16k model 2. Update api version for new models
I recently obtained access to the PaLM API for testing, but I found that there are hardly any client applications or products available for PaLM in the market. Therefore, I...
add different model mapping, it works fine on cloudflare workers. the system variables need to be created before the deployment.
我建议添加针对具有视觉能力的 GPT-4 模型的功能,以便正确处理它们,并使查询响应与传统的 OpenAI API 兼容。
现在不同的模型在不同的地域可用,甚至我想用的最新的3.5和4居然没有一个可以同时用的区域,我不得不创建不同的resource,改了一下代码,感觉没必要发pr,直接贴在下面,需要用的自取。 要点如下 - 将不同模型的resourceName, deployName和对应的apikey写成二维数组,有多少写多少。 - 不同的modelname映射为models的索引,为数字。 - authKey要设置下,代表客户端请求用的apikey,因为要使用不同的resource,所以apikey不同,不能直接用客户端的,只能单独约定一个跟客户端交互的key,服务端的用定义在脚本里面的 代码如下,要改的就前三个。 ``` // 不同的模型写到下面的数组里面 const models = [ ["resourceName1", "deployName1", "apikey1:*****7633c5e7289d"], ["resourceName2", "deployName2", "apikey2:*****7630a45b8531"] ]; //这是跟客户端的约定key,客户端设置成这个就行 const authKey = "sk-*************RtoJlKP9BfU0X5"; //...