haibbo / cf-openai-azure-proxy

A Cloudflare worker script to proxy OpenAI‘s request to Azure OpenAI Service
MIT License
1.66k stars 207 forks source link

feat: support use Azure API key starts with 'sk-' #45

Closed zthxxx closed 1 year ago

zthxxx commented 1 year ago

部分第三方 ChatGPT 客户端限制了输入的 key 必须是 OpenAI 格式的 sk- 开头的 key,再他们还没修复或支持 Azure API 前,使本项目内代理对 Azure key 添加并替换 sk- 开头字符串以支持这些三方客户端

kotobuki09 commented 1 year ago

Great idea! I also want to try it. Which one have you test with this one?

zthxxx commented 1 year ago

I have tested it in my Cloudflare worker, and you can also test it in your Cloudflare worker by changing just one line as this PR.

ShinChven commented 1 year ago

我觉得这种需求自己私下维护一份就好了,因为不是核心功能也不是常见需求。

kotobuki09 commented 1 year ago

I try a couple of times to see if it's working with this repo: https://github.com/binary-husky/gpt_academic/blob/master/config.py Seem like I missing something here cause it still shows an error API!

zthxxx commented 1 year ago

@ShinChven 还好几个第三方客户端这么限制了 😵‍💫

你看这个改动也是完全兼容的,给一些大众用户扩宽了一点使用场景也算好嘛