Comments (4)
谢谢 大佬讲解。
我还是不是特别理解这个地方应该怎么使用。 我以为会自动出现一个网页, 运行生成api key的东西。
那现在来讲的话, 意思是我们只是需要这个post功能? 这个应该正常运作的话会output什么有啊。。
那么这个页面主要有3个部分:
- Post 网址
- Header -- add key-val pairs
- Body
麻烦问一下这3个部分分别应该怎么放呢.根据前面的, 我试用如下, 感觉还是不太对, 麻烦指点一下, 谢谢
` POST: https://mygpt.incredible_li.workers.dev/v1/chat/completions
Header: Content-Type: application/json Authorization: Host: openai-proxy.exmaple.com // 这个不是很确定放啥。。 Connection: close Content-Length: 97
Body: {"model":"gpt-3.5-turbo","messages":[{"role":"user","content":"Please work as an translator"}],"temperature":0.7} `
这个项目只是一个实现 Azure OpenAI 代理的,目的是让 Azure 的 OpenAI 服务响应和 OpenAI API 一致,这样一些只支持 OpenAI API 的第三方客户端也可以使用,要配合其他的 ChatGPT 客户端用的呀,iOS 有 OpenCat,桌面平台有 Chatbox 什么的,可以自己搜一下。
你其实不需要管具体实现,你只要按照 README 步骤在 Cloudflare 上部署好了 proxy,然后找一个第三方客户端填上你的 proxy 地址,在 API key 里面填 Azure OpenAI Key 就可以了。
如果第三方客户端本来就支持 Azure OpenAI,那你就直接在 Azure OpenAI 相关的地方填你的 Azure OpenAI url 和密钥就好了。
from cf-openai-azure-proxy.
根据别的Issue, 修改了 Post 地址, 加了 /v1/chat/completions, POST 是ok的, 但是又得到了 Missing model mapper 。。
mapper 加了 0301 也不对。。
'gpt-3.5-turbo': "aBot", // DEPLOY_NAME_GPT35,
'gpt-3.5-turbo-0301': 'aBot',
from cf-openai-azure-proxy.
- 确保你添加了正确的
Authorization
Header - 确保你的 Request Body 与 OpenAI 一致
一个简单的例子:
POST /v1/chat/completions HTTP/1.1
Content-Type: application/json
Authorization: <Your Azure OpenAI Key>
Host: openai-proxy.exmaple.com
Connection: close
Content-Length: 97
{"model":"gpt-3.5-turbo","messages":[{"role":"user","content":"\u4f60\u597d"}],"temperature":0.7}
Authorization 和 OpenAI 不一样,是没有 Bearer
的,另外建议用第三方 API 工具测,比如 Postman 什么的。
from cf-openai-azure-proxy.
谢谢 大佬讲解。
我还是不是特别理解这个地方应该怎么使用。 我以为会自动出现一个网页, 运行生成api key的东西。
那现在来讲的话, 意思是我们只是需要这个post功能? 这个应该正常运作的话会output什么有啊。。
那么这个页面主要有3个部分:
- Post 网址
- Header -- add key-val pairs
- Body
麻烦问一下这3个部分分别应该怎么放呢.
根据前面的, 我试用如下, 感觉还是不太对, 麻烦指点一下, 谢谢
`
POST: https://mygpt.incredible_li.workers.dev/v1/chat/completions
Header:
Content-Type: application/json
Authorization:
Host: openai-proxy.exmaple.com // 这个不是很确定放啥。。
Connection: close
Content-Length: 97
Body:
{"model":"gpt-3.5-turbo","messages":[{"role":"user","content":"Please work as an translator"}],"temperature":0.7}
`
from cf-openai-azure-proxy.
Related Issues (20)
- OpenAl: Unexpected http code 403 HOT 2
- 在cloudflare新建worker后,系统报错,代码 (Code: 10021) HOT 2
- 编译报错了
- 是否能支持openai的其他功能
- 求救,怎么都不行。使用opencat弹出Unexpected http code 403 HOT 2
- 按照示例改的代码,报错Missing model mapper?想问下如何解决 HOT 12
- Set response Content-Type to text/event-stream to fix ChatGPT typer/printer style output.
- Set response Content-Type to text/event-stream to fix the third-party client compatibility
- 求助,为什么不支持上下文啊 HOT 3
- 404报错
- 问个小白问题 HOT 1
- Stream 偶尔还是会返回不完整的内容
- 求更新增加dall-e-3 HOT 3
- Function Calling HOT 1
- apiVersion可以填写哪些? HOT 3
- 在使用chatgpt-web-share遇到问题 HOT 1
- 加上最新的gpt-4-vision-preview 返回都被截断 HOT 1
- gpt3.5部署成功,gpt4就错误 HOT 7
- 调用此 Proxy 接口时出现 CloudFlare 质询 HOT 1
- 如何调试自定义的proxy HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cf-openai-azure-proxy.