Giter Site home page Giter Site logo

chatgpt-to-api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chatgpt-to-api's Issues

与go-chatgpt-api 搭配使用,总是抛出422 Unprocessable Entity

你好,我之前使用一直是搭配go-chatgpt-api使用的
近期我更新了go-chatgpt-api代码之后,总是出现
{"detail":[{"loc":["body","messages",0,"metadata"],"msg":"none is not an allowed value","type":"type_error.none.not_allowed"}]}

我尝试了许多次,我发现
单独传:

{
     "model": "text-davinci-002-render-sha",
     "messages": [ {"role": "user", "content": "你是谁?"}]
   }

是没问题的,但是如果你加入了system这个role,那么就会抛出这个问题

{
     "model": "text-davinci-002-render-sha",
     "messages": [{"role": "system", "content": "神奇"}, {"role": "user", "content": "你是谁?"}]
   }

我尝试解决了很久都没解决

所以想问下,你是如何与go-chatgpt-api搭配的,你是否出现过这个问题

无法识别HAR

今天使用api收到提示
API Error: Status Code 401, {"error":{"code":"error","message":{"code":"token_expired","message":"Provided authentication token is expired. Please try signing in again."},"param":null,"type":"401 Unauthorized"}}
显示token过期了。

我用之前的方式重新登录openai获取HAR和access token但是不管怎么尝试,登录的时候都提示:
Error: not a HAR file!
Updating access token for [email protected]
Location: begin
Status code: 0
Details: Failed to get CSRF token.

API返回API Error: Status Code 500,

最新版本无法显示完整回复

谢谢David,最新版支持websocket后可以正常对话了,但是通过API获取的回答并不全,经常只能显示部分结果,我测试了ChatBox,NextChatWeb等第三方客户端,3.5和4.0都会出现这个问题。
一般像文本翻译等GPT可以一次性给出解答的基本可以完全显示,逐渐展示的只能显示前几秒的内容。

Updating access token for vdmg××××@email.com,Error getting auth Arkose token

Here is the configuration file in the root directory of my project

  • freechatgpt
  • accounts.txt : vdmg××××@email.com:9zok2×××
  • access_tokens.json : {}
  • harPool folder >> chat.openai.com.har
  • cookies.json :
{
    "Email": [
        {
            "Name": "__Secure-next-auth.session-token",
            "Value": "eyJhbGciOiJkaXIiLC......",
            "Path": "/",
            "Domain": "",
            "Expires": "0001-01-01T00:00:00Z",
            "MaxAge": 0,
            "Secure": true,
            "HttpOnly": true,
            "SameSite": 2,
            "Unparsed": null
        }
    ]
}

When I run the command ./freechatgpt the following error occurs. Error getting auth Arkose token

image

I appreciate any response from anyone. Thank you.

新代码404错误

[GIN] 2024/05/14 - 21:42:24 | 404 | 937.436989ms | 154.12.xxx | POST "/v1/chat/completions"
[GIN] 2024/05/14 - 21:42:25 | 404 | 516.464169ms | 154.12.xxx | POST "/v1/chat/completions"
[GIN] 2024/05/14 - 21:42:26 | 404 | 671.040845ms | 154.12.xxx | POST "/v1/chat/completions"
[GIN] 2024/05/14 - 21:42:54 | 404 | 1.620388804s | 154.12.xxx | POST "/v1/chat/completions"
[GIN] 2024/05/14 - 21:42:55 | 404 | 579.647476ms | 154.12.xxx | POST "/v1/chat/completions"
[GIN] 2024/05/14 - 21:43:00 | 404 | 392.099484ms | 154.12.xxx | POST "/v1/chat/completions"
image

谢谢了

报错: Embedded error: Get "https://chat.openai.com/api/auth/csrf": x509: certificate signed by unknown authority

您好,在使用您的项目时发生了如下报错:

Embedded error: Get "https://chat.openai.com/api/auth/csrf": x509: certificate signed by unknown authority

启动命令:

docker-compose up

docker-compose.yaml:

version: '3'

services:
  app:
    image: acheong08/chatgpt-to-api # 总是使用latest,更新时重新pull该tag镜像即可
    container_name: chatgpttoapi
    restart: unless-stopped
    ports:
      - '8080:8080'
    environment:
      SERVER_HOST: 0.0.0.0
      SERVER_PORT: 8080
      ADMIN_PASSWORD: TotallySecurePassword
      # If the parameter API_REVERSE_PROXY is empty, the default request URL is https://chat.openai.com/backend-api/conversation, and the PUID is <NOT> equired.
      PUID: xxx
    volumes:
      - ./tools/authenticator/accounts.txt:/app/accounts.txt
      - ./tools/authenticator/api_keys.txt:/app/api_keys.txt # 假设您也想挂载这个文件
      - ./access_tokens.json:/app/access_tokens.json #

继续对话的时候会在没有完成对话的时候就返回

Continuing conversation
[GIN-debug] [WARNING] Headers were already written. Wanted to override status code 200 with 403

继续对话的会在没有完成对话时就返回错误“Our systems have detected unusual activity from your system. Please try again later.” 但是状态码却是200

后面的请求出现Only one message at a time.错误。

大佬,希望增加rt刷新at

希望增加rt刷新at,以下是python示例

url = "https://auth0.openai.com/oauth/token"
headers = {"Content-Type": "application/json"}
data = {
    "redirect_uri": "com.openai.chat://auth0.openai.com/ios/com.openai.chat/callback",
    "grant_type": "refresh_token",
    "client_id": "pdlLIX2Y72MIl2rhLhTE9VV9bN905kBh",
    "refresh_token": "替换成你的refresh_token"
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json()["access_token"])

The new update from Open AI seems to f*** up the Access Token & PUID Auth

Since yesterday, the Auth has been returning stuff like this, I tried proxy, no proxy, using my local machine, but nothing works. The HAR has also been provided

Updating access token for @.com
Error getting auth Arkose token
Location: begin
Status code: 0
Details: a valid HAR file required

How to use Image generation with gpt-4?

Hi, I know: "no free support" ... but I don't understand the processing of images. Do I have to convert the received link from my "Create an image of X for me." into a download myself, or am I misunderstanding "GetImageSource"? If I see correctly, there is only an endpoint for ChatCompletion, none for image generation.

Details: Failed to get CSRF token

最近,刷新令牌时会出现这个错误。其他人也是这样吗,还是只有我?

success read auth arkose
success read chat4 arkose
Updating access token for [email protected]
Location: begin
Status code: 0
Details: Failed to get CSRF token.
Updating access token for [email protected]
Location: begin
Status code: 0
Details: Failed to get CSRF token.
Updating access token for [email protected]
Location: begin
Status code: 0
Details: Failed to get CSRF token.

报错:Details, Failed to get CSRF token.

你好,在本地编译您的项目的时候出现了如下报错:

Details: Failed to get CSRF token.

启动命令:

go build && ./freechatgpt

输出内容(账号信息已经处理):

success read chat arkose
success read chat arkose
Updating access token for mi*****
Updating access token for !o***   # 这里是我print输出来查看有没有读取到密码的 
proxy_url
Location: begin
Status code: 0
Details: Failed to get CSRF token.
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:   export GIN_MODE=release
 - using code:  gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET    /ping                     --> main.main.func1 (4 handlers)
[GIN-debug] PATCH  /admin/password           --> main.passwordHandler (5 handlers)
[GIN-debug] PATCH  /admin/tokens             --> main.tokensHandler (5 handlers)
[GIN-debug] OPTIONS /v1/chat/completions      --> main.optionsHandler (4 handlers)
[GIN-debug] POST   /v1/chat/completions      --> main.nightmare (5 handlers)
[GIN-debug] GET    /v1/models                --> main.simulateModel (5 handlers)
2024/04/03 04:13:51 2478046 127.0.0.1:8080

接口的所有回答为空

这两天 OpenAI 貌似修改了一些东西,所有的请求返回的信息都是空的。比如下面的例子:

user@machine ~ % curl http://127.0.0.1:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H 'Authorization: Bearer Testing' \
  -d '{
    "model": "gpt-3.5-turbo",
    "messages": [
      {
        "role": "user",
        "content": "???"
      }
    ]
  }'

其中返回的内容中,message 字段为:

"message":{
  "role":"assistant",
  "content":""
}

参考其他项目的 issue,发现可能的原因

chatpire/chatgpt-web-share#360 (comment)

大佬能看看吗?

这个拿到响应的wss_url,有个优化的想法。

firstStr, _ := reader.ReadString('\n')

if strings.Contains(firstStr, ""wss_url"") {
//
}

可以通过响应头的content-type来判断是否是流式响应。
if !strings.Contains(response.Header.Get("Content-Type"), "text/event-stream") {
isWSS = true
conn = connPool[token]
var conversationResult chatgpt_types.ChatGPTWSSResponse
json.NewDecoder(response.Body).Decode(&conversationResult)
respId = conversationResult.ResponseId
convId = conversationResult.ConversationId
}

这样是否更方便呢?然后就不用处理下面这段了,因为有时候err := json.Unmarshal([]byte(firstStr[6:]), &original_response)有边界问题,有时候开始拿的数据解构不出json服务会报错。
err := json.Unmarshal([]byte(firstStr[6:]), &original_response)
if err != nil {
c.JSON(500, gin.H{"error": err.Error()})
return "", nil
}
if original_response.Error != nil {
c.JSON(500, gin.H{"error": original_response.Error})
return "", nil
}
convId = original_response.ConversationID

我把它改成了

line, err = reader.ReadString('\n')
if err != nil {
if err == io.EOF {
break
}
return "", nil
}

Go Build throwing error

go build is throwing following error

./../../go/pkg/mod/github.com/klauspost/[email protected]/zstd/dict.go:479:32: binary.LittleEndian.AppendUint32 undefined (type binary.littleEndian has no field or method AppendUint32)
../../../go/pkg/mod/github.com/klauspost/[email protected]/zstd/dict.go:490:32: binary.LittleEndian.AppendUint32 undefined (type binary.littleEndian has no field or method AppendUint32)
../../../go/pkg/mod/github.com/klauspost/[email protected]/zstd/dict.go:491:32: binary.LittleEndian.AppendUint32 undefined (type binary.littleEndian has no field or method AppendUint32)
../../../go/pkg/mod/github.com/klauspost/[email protected]/zstd/dict.go:492:32: binary.LittleEndian.AppendUint32 undefined (type binary.littleEndian has no field or method AppendUint32)

Error 500

It seems Open AI has just updated their system

Error messgae:

{
    "error": {
        "code": "500",
        "details": "          opacity: 1;\n          transform: scale(100%) rotate(0deg);\n        }\n      }\n\n      .logo {\n        color: #8e8ea0;\n        padding-bottom: 1.5rem;\n      }\n\n      .scale-appear {\n        animation: enlarge-appear 400ms ease-out;\n      }\n\n      @media (min-width: 768px) {\n        .scale-appear {\n          width: 48px;\n          height: 48px;\n        }\n      }\n\n      .data:empty {\n        display: none;\n      }\n\n      .data {\n        border-radius: 5px;\n        color: #8e8ea0;\n        text-align: center;\n        width: 100%;\n        max-width: 420px;\n      }\n\n      .data ul {\n        list-style: none;\n        padding: 0;\n      }\n\n      .blocked-icon {\n        color: #ef4444;\n      }\n\n      .message {\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        gap: 1rem;\n        font-size: 1.5rem;\n      }\n\n      .explanation {\n        font-size: 0.9rem;\n        opacity: 50%;\n        width: 100%;\n        max-width: 420px;\n        text-align: center;\n        line-height: 1.5;\n      }\n\n      .explanation a {\n        color: black;\n      }\n\n      @media (prefers-color-scheme: dark) {\n        body {\n          background-color: #343541;\n          color: #eee;\n        }\n\n        .logo {\n          color: #acacbe;\n        }\n\n        .explanation a {\n          color: white;\n        }\n      }\n    </style>\n  \n</head>\n  <body>\n    <div class=\"container\">\n      <div class=\"logo\">\n        <svg\n          width=\"41\"\n          height=\"41\"\n          viewBox=\"0 0 41 41\"\n          fill=\"none\"\n          xmlns=\"http://www.w3.org/2000/svg\"\n          strokeWidth=\"2\"\n          class=\"scale-appear\"\n        >\n          <path\n            d=\"M37.5324 16.8707C37.9808 15.5241 38.1363 14.0974 37.9886 12.6859C37.8409 11.2744 37.3934 9.91076 36.676 8.68622C35.6126 6.83404 33.9882 5.3676 32.0373 4.4985C30.0864 3.62941 27.9098 3.40259 25.8215 3.85078C24.8796 2.7893 23.7219 1.94125 22.4257 1.36341C21.1295 0.785575 19.7249 0.491269 18.3058 0.500197C16.1708 0.495044 14.0893 1.16803 12.3614 2.42214C10.6335 3.67624 9.34853 5.44666 8.6917 7.47815C7.30085 7.76286 5.98686 8.3414 4.8377 9.17505C3.68854 10.0087 2.73073 11.0782 2.02839 12.312C0.956464 14.1591 0.498905 16.2988 0.721698 18.4228C0.944492 20.5467 1.83612 22.5449 3.268 24.1293C2.81966 25.4759 2.66413 26.9026 2.81182 28.3141C2.95951 29.7256 3.40701 31.0892 4.12437 32.3138C5.18791 34.1659 6.8123 35.6322 8.76321 36.5013C10.7141 37.3704 12.8907 37.5973 14.9789 37.1492C15.9208 38.2107 17.0786 39.0587 18.3747 39.6366C19.6709 40.2144 21.0755 40.5087 22.4946 40.4998C24.6307 40.5054 26.7133 39.8321 28.4418 38.5772C30.1704 37.3223 31.4556 35.5506 32.1119 33.5179C33.5027 33.2332 34.8167 32.6547 35.9659 31.821C37.115 30.9874 38.0728 29.9178 38.7752 28.684C39.8458 26.8371 40.3023 24.6979 40.0789 22.5748C39.8556 20.4517 38.9639 18.4544 37.5324 16.8707ZM22.4978 37.8849C20.7443 37.8874 19.0459 37.2733 17.6994 36.1501C17.7601 36.117 17.8666 36.0586 17.936 36.0161L25.9004 31.4156C26.1003 31.3019 26.2663 31.137 26.3813 30.9378C26.4964 30.7386 26.5563 30.5124 26.5549 30.2825V19.0542L29.9213 20.998C29.9389 21.0068 29.9541 21.0198 29.9656 21.0359C29.977 21.052 29.9842 21.0707 29.9867 21.0902V30.3889C29.9842 32.375 29.1946 34.2791 27.7909 35.6841C26.3872 37.0892 24.4838 37.8806 22.4978 37.8849ZM6.39227 31.0064C5.51397 29.4888 5.19742 27.7107 5.49804 25.9832C5.55718 26.0187 5.66048 26.0818 5.73461 26.1244L13.699 30.7248C13.8975 30.8408 14.1233 30.902 14.3532 30.902C14.583 30.902 14.8088 30.8408 15.0073 30.7248L24.731 25.1103V28.9979C24.7321 29.0177 24.7283 29.0376 24.7199 29.0556C24.7115 29.0736 24.6988 29.0893 24.6829 29.1012L16.6317 33.7497C14.9096 34.7416 12.8643 35.0097 10.9447 34.4954C9.02506 33.9811 7.38785 32.7263 6.39227 31.0064ZM4.29707 13.6194C5.17156 12.0998 6.55279 10.9364 8.19885 10.3327C8.19885 10.4013 8.19491 10.5228 8.19491 10.6071V19.808C8.19351 20.0378 8.25334 20.2638 8.36823 20.4629C8.48312 20.6619 8.64893 20.8267 8.84863 20.9404L18.5723 26.5542L15.206 28.4979C15.1894 28.5089 15.1703 28.5155 15.1505 28.5173C15.1307 28.5191 15.1107 28.516 15.0924 28.5082L7.04046 23.8557C5.32135 22.8601 4.06716 21.2235 3.55289 19.3046C3.03862 17.3858 3.30624 15.3413 4.29707 13.6194ZM31.955 20.0556L22.2312 14.4411L25.5976 12.4981C25.6142 12.4872 25.6333 12.4805 25.6531 12.4787C25.6729 12.4769 25.6928 12.4801 25.7111 12.4879L33.7631 17.1364C34.9967 17.849 36.0017 18.8982 36.6606 20.1613C37.3194 21.4244 37.6047 22.849 37.4832 24.2684C37.3617 25.6878 36.8382 27.0432 35.9743 28.1759C35.1103 29.3086 33.9415 30.1717 32.6047 30.6641C32.6047 30.5947 32.6047 30.4733 32.6047 30.3889V21.188C32.6066 20.9586 32.5474 20.7328 32.4332 20.5338C32.319 20.3348 32.154 20.1698 31.955 20.0556ZM35.3055 15.0128C35.2464 14.9765 35.1431 14.9142 35.069 14.8717L27.1045 10.2712C26.906 10.1554 26.6803 10.0943 26.4504 10.0943C26.2206 10.0943 25.9948 10.1554 25.7963 10.2712L16.0726 15.8858V11.9982C16.0715 11.9783 16.0753 11.9585 16.0837 11.9405C16.0921 11.9225 16.1048 11.9068 16.1207 11.8949L24.1719 7.25025C25.4053 6.53903 26.8158 6.19376 28.2383 6.25482C29.6608 6.31589 31.0364 6.78077 32.2044 7.59508C33.3723 8.40939 34.2842 9.53945 34.8334 10.8531C35.3826 12.1667 35.5464 13.6095 35.3055 15.0128ZM14.2424 21.9419L10.8752 19.9981C10.8576 19.9893 10.8423 19.9763 10.8309 19.9602C10.8195 19.9441 10.8122 19.9254 10.8098 19.9058V10.6071C10.8107 9.18295 11.2173 7.78848 11.9819 6.58696C12.7466 5.38544 13.8377 4.42659 15.1275 3.82264C16.4173 3.21869 17.8524 2.99464 19.2649 3.1767C20.6775 3.35876 22.0089 3.93941 23.1034 4.85067C23.0427 4.88379 22.937 4.94215 22.8668 4.98473L14.9024 9.58517C14.7025 9.69878 14.5366 9.86356 14.4215 10.0626C14.3065 10.2616 14.2466 10.4877 14.2479 10.7175L14.2424 21.9419ZM16.071 17.9991L20.4018 15.4978L24.7325 17.9975V22.9985L20.4018 25.4983L16.071 22.9985V17.9991Z\"\n            fill=\"currentColor\"\n          />\n        </svg>\n      </div>\n      <div class=\"message\">\n        <svg\n          xmlns=\"http://www.w3.org/2000/svg\"\n          fill=\"none\"\n          width=\"24\"\n          height=\"24\"\n          viewBox=\"0 0 24 24\"\n          stroke-width=\"1.5\"\n          stroke=\"currentColor\"\n          class=\"blocked-icon\"\n        >\n          <path\n            stroke-linecap=\"round\"\n            stroke-linejoin=\"round\"\n            d=\"M12 9v3.75m0-10.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.75c0 5.592 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.57-.598-3.75h-.152c-3.196 0-6.1-1.249-8.25-3.286zm0 13.036h.008v.008H12v-.008z\"\n          />\n        </svg>\n        <p>Unable to load site</p>\n      </div>\n      <span class=\"explanation\">\n        Please try again later. If you are using a VPN, try turning it off.\n        Check the\n        <a href=\"https://status.openai.com/\" target=\"_new\">status page</a> for\n        information on outages.\n      </span>\n      <br />\n      <span class=\"explanation\"> [IP:2402:800:61cf:d8a8:b934:3c53:a6a8:c8e2 | Ray ID:8751bac61ddf84fa] </span>\n    </div>\n  <script>(function(){if (!document.body) return;var js = \"window['__CF$cv$params']={r:'8751bac61ddf84fa',t:'MTcxMzI0NDg2Mi40MTIwMDA='};_cpo=document.createElement('script');_cpo.nonce='',_cpo.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js',document.getElementsByTagName('head')[0].appendChild(_cpo);\";var _0xh = document.createElement('iframe');_0xh.height = 1;_0xh.width = 1;_0xh.style.position = 'absolute';_0xh.style.top = 0;_0xh.style.left = 0;_0xh.style.border = 'none';_0xh.style.visibility = 'hidden';document.body.appendChild(_0xh);function handler() {var _0xi = _0xh.contentDocument || _0xh.contentWindow.document;if (_0xi) {var _0xj = _0xi.createElement('script');_0xj.innerHTML = js;_0xi.getElementsByTagName('head')[0].appendChild(_0xj);}}if (document.readyState !== 'loading') {handler();} else if (window.addEventListener) {document.addEventListener('DOMContentLoaded', handler);} else {var prev = document.onreadystatechange || function () {};document.onreadystatechange = function (e) {prev(e);if (document.readyState !== 'loading') {document.onreadystatechange = prev;handler();}};}})();</script></body>\n</html>\n",
        "message": "Unknown error",
        "param": null,
        "type": "internal_server_error"
    }
}

无法使用OpenAI Embeddings Model

plus转换的api似乎无法使用embeddings model(https://api.openai.com/v1/embeddings ),返回404 page not found,自建的API可以访问/v1/embeddings这个api,但是好像无法获取返回的内容?
目前在用的几个文本向量化的基于ai的知识库都无法利用openai的embedding model (text-embedding-ada-002)
使用gpt-4-vision-preview,如果询问openai是哪个模型,它会回答自己是gpt3.5,好像这个目前也没法使用

如何配置多个oauth账号?

我尝试在cookie.json中增加多个账号,在accounts.txt中配置相同多个账号
貌似是不行的,请问有办法配置多账号,负载均衡吗。

另外我在使用的过程中,常常会遇到无响应的情况,但是重启容器后,就恢复正常了。不知道你是否遇到过。这个该怎么解决。

大佬有考虑添加多媒体功能吗?

data: {"message": {"id": "021e423c-1abc-4473-bd81-2aa75e745f70", "author": {"role": "tool", "name": "dalle.text2im", "metadata": {}}, "create_time": null, "update_time": null, "content": {"content_type": "multimodal_text", "parts": [

{"content_type": "image_asset_pointer", "asset_pointer": "file-service://file-wXiaaOn5Glt0XvRdzglDxXe0", "size_bytes": 142344, "width": 1024, "height": 1024, "fovea": null, "metadata": {"dalle": {"prompt": "Photo of a fluffy white cat with blue eyes sitting gracefully on a windowsill, with sunrays illuminating its fur.", "seed": 5000, "serialization_title": "DALL-E generation metadata"}}},

{"content_type": "image_asset_pointer", "asset_pointer": "file-service://file-L6IAt6o1InshqAn3aNEDkWPZ", "size_bytes": 346572, "width": 1024, "height": 1024, "fovea": null, "metadata": {"dalle": {"prompt": "Illustration of a sleek black cat with green eyes perched atop a fence against a starry night sky.", "seed": 5000, "serialization_title": "DALL-E generation metadata"}}},

{"content_type": "image_asset_pointer", "asset_pointer": "file-service://file-z15jm2RKoAO2KBQayrhM3cuN", "size_bytes": 339150, "width": 1024, "height": 1024, "fovea": null, "metadata": {"dalle": {"prompt": "Watercolor painting of a ginger tabby cat playfully chasing a butterfly in a flower-filled garden.", "seed": 5000, "serialization_title": "DALL-E generation metadata"}}},

{"content_type": "image_asset_pointer", "asset_pointer": "file-service://file-JvNFCc1QP7ClgEm6kCrV9vnG", "size_bytes": 134044, "width": 1024, "height": 1024, "fovea": null, "metadata": {"dalle": {"prompt": "Photo of a Siamese cat lounging lazily on a plush red cushion, with its tail curled around its body.", "seed": 5000, "serialization_title": "DALL-E generation metadata"}}}]}, "status": "finished_successfully", "end_turn": null, "weight": 1.0, "metadata": {"message_type": "next", "model_slug": "gpt-4-dalle", "parent_id": "e1db25d4-e787-49e2-b172-82626f24ddea"}, "recipient": "all"}, "conversation_id": "524c825a-fb6e-49b9-91e7-8e9cd63cef82", "error": null}

这种多媒体流好像直接忽略了,能不能考虑获取里面的asset_pointer,然后通过backend-api/files得到他的下载连接(下载连接好像有时效),最后(用markdown格式)返回给客户端。

运行报错Error getting auth Arkose token

success read chat arkose
Updating access token for 邮箱@outlook.com
Error getting auth Arkose token
Location: begin
Status code: 0
Details: a valid HAR file which contains login arkose is required
HAR文件也放入了程序同级的harPool文件夹里
accounts.txt - 也存放OpenAI账号邮箱和密码

多了个\n

          多了个\n

Originally posted by @xqdoo00o in #39 (comment)

谢谢回复,现在是500错误,还请看下,谢谢

[GIN-debug] GET    /ping                     --> main.main.func1 (4 handlers)
[GIN-debug] PATCH  /admin/password           --> main.passwordHandler (5 handlers)
[GIN-debug] PATCH  /admin/tokens             --> main.tokensHandler (5 handlers)
[GIN-debug] PATCH  /admin/puid               --> main.puidHandler (5 handlers)
[GIN-debug] PATCH  /admin/openai             --> main.openaiHandler (5 handlers)
[GIN-debug] OPTIONS /v1/chat/completions      --> main.optionsHandler (4 handlers)
[GIN-debug] POST   /v1/chat/completions      --> main.nightmare (5 handlers)
[GIN-debug] GET    /v1/engines               --> main.engines_handler (5 handlers)
[GIN-debug] GET    /v1/models                --> main.engines_handler (5 handlers)
2024/04/08 12:19:11 1 0.0.0.0:8080
[GIN] 2024/04/08 - 12:19:45 | 500 |   73.535584ms | 123.152.165.219 | POST     "/v1/chat/completions"
[GIN] 2024/04/08 - 12:20:05 | 500 |   43.097267ms | 123.152.165.219 | POST     "/v1/chat/completions"

Please enable Cookies and reload the page.

#8e8ea0;text-align:center}@media (prefers-color-scheme:dark){body{background-color:#343541}.logo{color:#acacbe}}</style>\n \n</head>\n
<body>\n
               <div class=\ "container\">\n
                              <div class=\ "logo\">\n
                                             <svg\n width=\ "41\"\n height=\ "41\"\n viewBox=\ "0 0 41 41\"\n fill=\ "none\"\n xmlns=\ "http://www.w3.org/2000/svg\"\n strokeWidth=\ "2\"\n class=\ "scale-appear\"\n>\n
                                                            <path\n d=\
                                                            "M37.5324 16.8707C37.9808 15.5241 38.1363 14.0974 37.9886 12.6859C37.8409 11.2744 37.3934 9.91076 36.676 8.68622C35.6126 6.83404 33.9882 5.3676 32.0373 4.4985C30.0864 3.62941 27.9098 3.40259 25.8215 3.85078C24.8796 2.7893 23.7219 1.94125 22.4257 1.36341C21.1295 0.785575 19.7249 0.491269 18.3058 0.500197C16.1708 0.495044 14.0893 1.16803 12.3614 2.42214C10.6335 3.67624 9.34853 5.44666 8.6917 7.47815C7.30085 7.76286 5.98686 8.3414 4.8377 9.17505C3.68854 10.0087 2.73073 11.0782 2.02839 12.312C0.956464 14.1591 0.498905 16.2988 0.721698 18.4228C0.944492 20.5467 1.83612 22.5449 3.268 24.1293C2.81966 25.4759 2.66413 26.9026 2.81182 28.3141C2.95951 29.7256 3.40701 31.0892 4.12437 32.3138C5.18791 34.1659 6.8123 35.6322 8.76321 36.5013C10.7141 37.3704 12.8907 37.5973 14.9789 37.1492C15.9208 38.2107 17.0786 39.0587 18.3747 39.6366C19.6709 40.2144 21.0755 40.5087 22.4946 40.4998C24.6307 40.5054 26.7133 39.8321 28.4418 38.5772C30.1704 37.3223 31.4556 35.5506 32.1119 33.5179C33.5027 33.2332 34.8167 32.6547 35.9659 31.821C37.115 30.9874 38.0728 29.9178 38.7752 28.684C39.8458 26.8371 40.3023 24.6979 40.0789 22.5748C39.8556 20.4517 38.9639 18.4544 37.5324 16.8707ZM22.4978 37.8849C20.7443 37.8874 19.0459 37.2733 17.6994 36.1501C17.7601 36.117 17.8666 36.0586 17.936 36.0161L25.9004 31.4156C26.1003 31.3019 26.2663 31.137 26.3813 30.9378C26.4964 30.7386 26.5563 30.5124 26.5549 30.2825V19.0542L29.9213 20.998C29.9389 21.0068 29.9541 21.0198 29.9656 21.0359C29.977 21.052 29.9842 21.0707 29.9867 21.0902V30.3889C29.9842 32.375 29.1946 34.2791 27.7909 35.6841C26.3872 37.0892 24.4838 37.8806 22.4978 37.8849ZM6.39227 31.0064C5.51397 29.4888 5.19742 27.7107 5.49804 25.9832C5.55718 26.0187 5.66048 26.0818 5.73461 26.1244L13.699 30.7248C13.8975 30.8408 14.1233 30.902 14.3532 30.902C14.583 30.902 14.8088 30.8408 15.0073 30.7248L24.731 25.1103V28.9979C24.7321 29.0177 24.7283 29.0376 24.7199 29.0556C24.7115 29.0736 24.6988 29.0893 24.6829 29.1012L16.6317 33.7497C14.9096 34.7416 12.8643 35.0097 10.9447 34.4954C9.02506 33.9811 7.38785 32.7263 6.39227 31.0064ZM4.29707 13.6194C5.17156 12.0998 6.55279 10.9364 8.19885 10.3327C8.19885 10.4013 8.19491 10.5228 8.19491 10.6071V19.808C8.19351 20.0378 8.25334 20.2638 8.36823 20.4629C8.48312 20.6619 8.64893 20.8267 8.84863 20.9404L18.5723 26.5542L15.206 28.4979C15.1894 28.5089 15.1703 28.5155 15.1505 28.5173C15.1307 28.5191 15.1107 28.516 15.0924 28.5082L7.04046 23.8557C5.32135 22.8601 4.06716 21.2235 3.55289 19.3046C3.03862 17.3858 3.30624 15.3413 4.29707 13.6194ZM31.955 20.0556L22.2312 14.4411L25.5976 12.4981C25.6142 12.4872 25.6333 12.4805 25.6531 12.4787C25.6729 12.4769 25.6928 12.4801 25.7111 12.4879L33.7631 17.1364C34.9967 17.849 36.0017 18.8982 36.6606 20.1613C37.3194 21.4244 37.6047 22.849 37.4832 24.2684C37.3617 25.6878 36.8382 27.0432 35.9743 28.1759C35.1103 29.3086 33.9415 30.1717 32.6047 30.6641C32.6047 30.5947 32.6047 30.4733 32.6047 30.3889V21.188C32.6066 20.9586 32.5474 20.7328 32.4332 20.5338C32.319 20.3348 32.154 20.1698 31.955 20.0556ZM35.3055 15.0128C35.2464 14.9765 35.1431 14.9142 35.069 14.8717L27.1045 10.2712C26.906 10.1554 26.6803 10.0943 26.4504 10.0943C26.2206 10.0943 25.9948 10.1554 25.7963 10.2712L16.0726 15.8858V11.9982C16.0715 11.9783 16.0753 11.9585 16.0837 11.9405C16.0921 11.9225 16.1048 11.9068 16.1207 11.8949L24.1719 7.25025C25.4053 6.53903 26.8158 6.19376 28.2383 6.25482C29.6608 6.31589 31.0364 6.78077 32.2044 7.59508C33.3723 8.40939 34.2842 9.53945 34.8334 10.8531C35.3826 12.1667 35.5464 13.6095 35.3055 15.0128ZM14.2424 21.9419L10.8752 19.9981C10.8576 19.9893 10.8423 19.9763 10.8309 19.9602C10.8195 19.9441 10.8122 19.9254 10.8098 19.9058V10.6071C10.8107 9.18295 11.2173 7.78848 11.9819 6.58696C12.7466 5.38544 13.8377 4.42659 15.1275 3.82264C16.4173 3.21869 17.8524 2.99464 19.2649 3.1767C20.6775 3.35876 22.0089 3.93941 23.1034 4.85067C23.0427 4.88379 22.937 4.94215 22.8668 4.98473L14.9024 9.58517C14.7025 9.69878 14.5366 9.86356 14.4215 10.0626C14.3065 10.2616 14.2466 10.4877 14.2479 10.7175L14.2424 21.9419ZM16.071 17.9991L20.4018 15.4978L24.7325 17.9975V22.9985L20.4018 25.4983L16.071 22.9985V17.9991Z\"\n fill=\ "currentColor\"\n />\n</svg>\n</div>\n
                              <div class=\ "data\">
                                             <form id=\ "challenge-form\" class=\ "challenge-form\">
                                                            <div id=\ "cf-please-wait\">
                                                                           <div id=\ "spinner\">
                                                                                          <div id=\ "cf-bubbles\">
                                                                                                         <div class=\ "bubbles\"></div>
                                                                                                         <div class=\ "bubbles\"></div>
                                                                                                         <div class=\ "bubbles\"></div>
                                                                                          </div>
                                                                           </div>
                                                                           <p id=\ "cf-spinner-please-wait\">Please stand by, while we are checking your browser...</p>
                                                                           <p id=\ "cf-spinner-redirecting\" style=\ "display:none\">Redirecting...</p>
                                                            </div>
                                                            <noscript id=\ "cf-captcha-bookmark\" class=\ "cf-captcha-info\">
                                                                           <h1 style=\ "color:#bd2426;\">Please turn JavaScript on and reload the page.</h1>
                                                            </noscript>
                                                            <div id=\ "no-cookie-warning\" class=\ "cookie-warning\" style=\ "display:none\">
                                                                           <p style=\ "color:#bd2426;\">Please enable Cookies and reload the page.</p>
                                                            </div>
                                             </form>
                                             <script>
                                                            (function() {
                                                                                          window._cf_chl_opt = {
                                                                                                                        cvId: '2',
                                                                                                                        cZone: 'chat.openai.com',
                                                                                                                        cType: 'managed',
                                                                                                                        cNounce: '48185',
                                                                                                                        cRay: '7f13b8be1ecc17dc',
                                                                                                                        cHash: '0d3261861b3d3d9',
                                                                                                                        cUPMDTk: \ "\/backend-api\/conversation?__cf_chl_tk=o4VpzCbn8p_cIgaw.pYVKAuQvlLIPBb6EaKXQyMLbG0-1691119825-0-gaNycGzNDSU\",cFPWv: 'g',cTTimeMs: '1000',cMTimeMs: '0',cTplV: 1,cTplB: 'cf',cK: \"\",fa: \"/backend-api/conversation?__cf_chl_f_tk=o4VpzCbn8p_cIgaw.pYVKAuQvlLIPBb6EaKXQyMLbG0-1691119825-0-gaNycGzNDSU\",md: \"_X2L6yr38LIxJ1p.4xYGKBOsvLaECSrErZV6yjyHXbA-1691119825-0-AfbKgiqb_PjkNVSG2tmEfR3PrW8TQhOKPox__GM6Hje_anfqO7IJ-1cbwuaManRkQvv68ZcQHt8MYw4hfOD4DvDANNYgcjdN0uL_Y-ppFfdt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ZaNUJIHhxzxFNzSPNnVe6rJjiQw728=',}};var cpo = document.createElement('script');cpo.src = '/cdn-cgi/challenge-platform/h/g/orchestrate/chl_page/v1?ray=7f13b8be1ecc17dc';window._cf_chl_opt.cOgUHash = location.hash === '' && location.href.indexOf('#') !== -1 ? '#' : location.hash;window._cf_chl_opt.cOgUQuery = location.search === '' && location.href.slice(0, location.href.length - window._cf_chl_opt.cOgUHash.length).indexOf('?') !== -1 ? '?' : location.search;if (window.history && window.history.replaceState) {var ogU = location.pathname + window._cf_chl_opt.cOgUQuery + window._cf_chl_opt.cOgUHash;history.replaceState(null, null, \"\/backend-api\/conversation?__cf_chl_rt_tk=o4VpzCbn8p_cIgaw.pYVKAuQvlLIPBb6EaKXQyMLbG0-1691119825-0-gaNycGzNDSU\" + window._cf_chl_opt.cOgUHash);cpo.onload = function() {history.replaceState(null, null, ogU);};}document.getElementsByTagName('head')[0].appendChild(cpo);}());
                                             </script>
                              </div>\n</div>\n
               <script>
                              ! function() {
                                             var e = document.createElement(\"iframe\");function t(){var t=e.contentDocument||e.contentWindow.document;if(t){var n=t.createElement(\"script\");n.nonce=\"\",n.innerHTML=\"window['__CF$cv$params']={r:'79271b319741fa72',m:'sCXwl7Hde_jVE6GIOe0wKz4oMt3Lh8w0Eua1mDgehB0-1675216960-0-AYp1IKwNU5u8yMiuEYyoErcqoHVV4YDI+VMoX7mzAvt9fZ4EOB3++PlEm7wtksX3Xttwni3QWV/tKTeRlCy+/nY6nCAYRHzWlB1zXw1KXyx/+B5lo5mvtnyYfuCVVJEWfwzAUnF4MwJWDszLxIwECgs=',s:[0xb58b3307a5,0x39915b3715],u:'/cdn-cgi/challenge-platform/h/g'};var now=Date.now()/1000,offset=14400,ts=''+(Math.floor(now)-Math.floor(now%offset)),_cpo=document.createElement('script');_cpo.nonce='',_cpo.src='/cdn-cgi/challenge-platform/h/g/scripts/alpha/invisible.js?ts='+ts,document.getElementsByTagName('head')[0].appendChild(_cpo);\",t.getElementsByTagName(\"head\")[0].appendChild(n)}}if(e.height=1,e.width=1,e.style.position=\"absolute\",e.style.top=0,e.style.left=0,e.style.border=\"none\",e.style.visibility=\"hidden\",document.body.appendChild(e),\"loading\"!==document.readyState)t();else if(window.addEventListener)document.addEventListener(\"DOMContentLoaded\",t);else{var n=document.onreadystatechange||function(){};document.onreadystatechange=function(e){n(e),\"loading\"!==document.readyState&&(document.onreadystatechange=n,t())}}}();
               </script>
</body>\n
</html>\n

为什么请求的模型是 gpt-4 但接口返回的回答里显示 gpt-3.5-turbo-0301

在 chatgpt 网页上是可以正常使用 gpt4 的

curl 127.0.0.1:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer NONEED" \
  -d '{
     "model": "gpt-4",
     "messages": [{"role": "user", "content": "你会说中文吗"}],
     "temperature": 0.7
   }'
{"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion","created":0,"model":"gpt-3.5-turbo-0301","usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0},"choices":[{"index":0,"message":{"role":"assistant","content":"会的,我可以用中文回答问题。请随时告诉我您的问题或需求。"},"finish_reason":null}]}

最新版有错误,无法运行

运行环境:docker
最新版更改了har的位置,我修改docker compose设置,把har文件挂载到容器:/app/harPool/chat.openai.com.har但是却无法正常运行,访问api全都返回无响应,尝试修改har到根目录,访问api依然无响应
{
"error": true,
"message": "empty response"
}

切换回92d55a9后可以正常运行
查看了下修改日志,似乎没有修改har的访问位置?之前直接放到根目录是可以正常识别的

报错:404 error

作者你好,今天运行你的项目。出现如下错误,请问是什么问题,以及如何解决,谢谢:

[GIN] 2024/04/08 - 10:41:46 | 404 |       2.841µs |   45.79.160.193 | POST     "/v1/chat/completions\n"
[GIN] 2024/04/08 - 10:42:19 | 404 |       14.56µs |   45.79.160.193 | POST     "/v1/chat/completions\n"
[GIN] 2024/04/08 - 10:43:48 | 404 |           3µs |   45.79.160.193 | POST     "/v1/chat/completions\n"
[GIN] 2024/04/08 - 10:44:11 | 404 |       21.24µs | 123.152.165.219 | POST     "/v1/chat/completions\n"
[GIN] 2024/04/08 - 10:44:15 | 404 |        2.96µs | 123.152.165.219 | POST     "/v1/chat/completions\n"
[GIN] 2024/04/08 - 10:45:16 | 404 |        2.48µs | 123.152.165.219 | POST     "/v1/chat/completions\n"
[GIN] 2024/04/08 - 10:45:35 | 404 |        2.96µs | 123.152.165.219 | POST     "/v1/chat/completions\n"
[GIN] 2024/04/08 - 10:45:50 | 404 |        2.92µs |   45.79.160.193 | POST     "/v1/chat/completions\n"
[GIN] 2024/04/08 - 10:45:54 | 404 |        3.44µs |   45.79.160.193 | POST     "/v1/chat/completions\n"

最新版本无法正常使用

昨天的0a7512d和当前的f50aab0都会提示出现错误:
time: missing Location in call to Time
操作系统:Debian 5.10.197 x86_64
安装方式:Dockerfile 编译

chatgpttoapi  | POST /v1/chat/completions HTTP/1.0
chatgpttoapi  | Host:a.a.a
chatgpttoapi  | Accept: */*
chatgpttoapi  | Accept-Encoding: gzip, deflate, br
chatgpttoapi  | Accept-Language: zh-CN
chatgpttoapi  | Authorization: *
chatgpttoapi  | Connection: close
chatgpttoapi  | Content-Length: 695
chatgpttoapi  | Content-Type: application/json
chatgpttoapi  | Remote-Host: 1.2.3.4
chatgpttoapi  | Sec-Ch-Ua: "Not?A_Brand";v="8", "Chromium";v="108"
chatgpttoapi  | Sec-Ch-Ua-Mobile: ?0
chatgpttoapi  | Sec-Ch-Ua-Platform: "Windows"
chatgpttoapi  | Sec-Fetch-Dest: empty
chatgpttoapi  | Sec-Fetch-Mode: cors
chatgpttoapi  | Sec-Fetch-Site: cross-site
chatgpttoapi  | User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537 (KHTML, like Gecko) xyz.chatboxapp.app/1.3 Chrome/108.0.5 Electron/22.3 Safari/537
chatgpttoapi  | X-Forwarded-For: 1.2.3.4
chatgpttoapi  | X-Real-Ip: 1.2.3.4
chatgpttoapi  | 
chatgpttoapi  | 
chatgpttoapi  | time: missing Location in call to Time.In
chatgpttoapi  | /usr/local/go/src/time/time.go:1146 (0x9a203a)
chatgpttoapi  | /app/internal/chatgpt/request.go:225 (0x9a1f7d)
chatgpttoapi  | /app/internal/chatgpt/request.go:233 (0x9a225b)
chatgpttoapi  | /app/internal/chatgpt/request.go:240 (0x9a2456)
chatgpttoapi  | /app/handlers.go:148 (0x9b1c31)
chatgpttoapi  | /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x9b3bc7)
chatgpttoapi  | /app/middleware.go:66 (0x9b38ae)
chatgpttoapi  | /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x9b3637)
chatgpttoapi  | /app/middleware.go:35 (0x9b361e)
chatgpttoapi  | /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x99a801)
chatgpttoapi  | /go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:102 (0x99a7ec)
chatgpttoapi  | /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x999926)
chatgpttoapi  | /go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:240 (0x999909)
chatgpttoapi  | /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x99898a)
chatgpttoapi  | /go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:620 (0x998611)
chatgpttoapi  | /go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:576 (0x9982bc)
chatgpttoapi  | /usr/local/go/src/net/http/server.go:2936 (0x702395)
chatgpttoapi  | /usr/local/go/src/net/http/server.go:1995 (0x6fec11)
chatgpttoapi  | /usr/local/go/src/runtime/asm_amd64.s:1598 (0x467660)

请求支持 refresh_token to access_token

通过refresh_token 生成 access_token

通过官网获取 https://auth0.openai.com/oauth/token 以下是python实现

import requests,json
url = "https://auth0.openai.com/oauth/token"
headers = {"Content-Type": "application/json"}
data = {
    "redirect_uri": "com.openai.chat://auth0.openai.com/ios/com.openai.chat/callback",
    "grant_type": "refresh_token",
    "client_id": "pdlLIX2Y72MIl2rhLhTE9VV9bN905kBh",
    "refresh_token": "替换成你的refresh_token"
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json()["access_token"])

调用 zhele 的免费api接口获取

import requests
url = "https://token.oaifree.com/api/auth/refresh"
headers = {
    "Content-Type": " x-www-form-urlencoded;charset=UTF-8"
}
data = {
    "refresh_token": "替换成你的refresh_token"
}
response = requests.post(url, data=data)
print(response.json()["access_token"])

"error": "No websocket connection"

./freechatgpt
success read auth arkose
success read chat arkose
success read chat arkose
success read chat arkose
Updating access token for [email protected]
Success!
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.

  • using env: export GIN_MODE=release
  • using code: gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET /ping --> main.main.func1 (4 handlers)
[GIN-debug] PATCH /admin/password --> main.passwordHandler (5 handlers)
[GIN-debug] PATCH /admin/tokens --> main.tokensHandler (5 handlers)
[GIN-debug] OPTIONS /v1/chat/completions --> main.optionsHandler (4 handlers)
[GIN-debug] POST /v1/chat/completions --> main.nightmare (5 handlers)
[GIN-debug] GET /v1/models --> main.simulateModel (5 handlers)
2024/04/27 18:05:55 1185704 127.0.0.1:8888
[GIN] 2024/04/27 - 18:06:13 | 500 | 12.068618495s | 127.0.0.1 | POST "/v1/chat/completions"

之前都好好的。昨天plus过期又续费后,一直出现"error": "No websocket connection",中间短暂可用2个小时后,又出现这个error。

已多次更新har文件,har文件严格按照先登录再对话的指示保存,并删除access_tokens.json,cookies.json。

如果不设置accounts.txt,可以正常gpt3.5 api。一旦设置accounts.txt,就 no websocket connection.

chatGPT-to-API已更新最新版本。

我的chatGPT-to-API是Linux,chatGPT是Windows或mac,是不是需要我在windows或mac上装个chatGPT-to-API ?

请老大指个路,非常感谢。

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.