Giter Club home page Giter Club logo

Comments (4)

Teakowa avatar Teakowa commented on June 12, 2024 1

谢谢 大佬讲解。

我还是不是特别理解这个地方应该怎么使用。 我以为会自动出现一个网页, 运行生成api key的东西。

那现在来讲的话, 意思是我们只是需要这个post功能? 这个应该正常运作的话会output什么有啊。。

那么这个页面主要有3个部分:

  1. Post 网址
  2. Header -- add key-val pairs
  3. 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.

IncredibleAaron avatar IncredibleAaron commented on June 12, 2024

根据别的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',

image

from cf-openai-azure-proxy.

Teakowa avatar Teakowa commented on June 12, 2024
  1. 确保你添加了正确的 Authorization Header
  2. 确保你的 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.

IncredibleAaron avatar IncredibleAaron commented on June 12, 2024

谢谢 大佬讲解。

我还是不是特别理解这个地方应该怎么使用。 我以为会自动出现一个网页, 运行生成api key的东西。

那现在来讲的话, 意思是我们只是需要这个post功能? 这个应该正常运作的话会output什么有啊。。

那么这个页面主要有3个部分:

  1. Post 网址
  2. Header -- add key-val pairs
  3. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.