Giter Club home page Giter Club logo

aurora's Issues

报错

root@vm3:~/chatgpt-qq# curl --location 'http://127.0.0.1:8080/v1/chat/completions' --header 'Content-Type: application/json' --data '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Say this is a test!"}],
"stream": true
}'
{"code":500,"message":"error sending request","param":{},"type":"InitTurnStile_request_error"}

koyeb部署无法正常使用

https://planned-lorianna-yunfeiyang.koyeb.app/
使用返回500错误码。尝试更换过环境变量中的baseurl

控制台log有以下报错出现
2024/04/06 08:30:35 [Recovery] 2024/04/06 - 08:30:35 panic recovered:
runtime error: invalid memory address or nil pointer dereference
/layers/heroku_go/shim/go1.21.5/go/src/runtime/panic.go:261 (0x44def7)
/layers/heroku_go/shim/go1.21.5/go/src/runtime/signal_unix.go:861 (0x44dec5)
/workspace/internal/chatgpt/request.go:225 (0x8cbe5d)
InitTurnStile: defer response.Body.Close()
/workspace/handlers.go:173 (0x8e4524)
(*Handler).nightmare: turnStile, status, err := chatgpt.InitTurnStile(client, secret, proxyUrl, 5)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8e6baf)
[GIN] 2024/04/06 - 08:30:35 | 500 | 9.144953309s | 193.122.113.204 | POST "/v1/chat/completions"
/workspace/middleware.go:33 (0x8e6af4)
Authorization: c.Next()
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8e6955)
/workspace/middleware.go:14 (0x8e6943)
cors: c.Next()
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8b4599)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:102 (0x8b4587)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8b373d)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:240 (0x8b3700)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8b27fa)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:620 (0x8b248d)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:576 (0x8b213c)
/layers/heroku_go/shim/go1.21.5/go/src/net/http/server.go:2938 (0x6ac48d)
/layers/heroku_go/shim/go1.21.5/go/src/net/http/server.go:2009 (0x6a9133)
/layers/heroku_go/shim/go1.21.5/go/src/runtime/asm_amd64.s:1650 (0x46a3e0)
2024/04/06 08:30:44 [Recovery] 2024/04/06 - 08:30:44 panic recovered:
[GIN] 2024/04/06 - 08:30:44 | 500 | 14.685266049s | 193.122.113.204 | POST "/v1/chat/completions"
runtime error: invalid memory address or nil pointer dereference
/layers/heroku_go/shim/go1.21.5/go/src/runtime/panic.go:261 (0x44def7)
/layers/heroku_go/shim/go1.21.5/go/src/runtime/signal_unix.go:861 (0x44dec5)
/workspace/internal/chatgpt/request.go:225 (0x8cbe5d)
InitTurnStile: defer response.Body.Close()
/workspace/handlers.go:173 (0x8e4524)
(*Handler).nightmare: turnStile, status, err := chatgpt.InitTurnStile(client, secret, proxyUrl, 5)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8e6baf)
/workspace/middleware.go:33 (0x8e6af4)
Authorization: c.Next()
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8e6955)
/workspace/middleware.go:14 (0x8e6943)
cors: c.Next()
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8b4599)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:102 (0x8b4587)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8b373d)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:240 (0x8b3700)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8b27fa)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:620 (0x8b248d)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:576 (0x8b213c)
/layers/heroku_go/shim/go1.21.5/go/src/net/http/server.go:2938 (0x6ac48d)
/layers/heroku_go/shim/go1.21.5/go/src/net/http/server.go:2009 (0x6a9133)
/layers/heroku_go/shim/go1.21.5/go/src/runtime/asm_amd64.s:1650 (0x46a3e0)
[GIN] 2024/04/06 - 08:30:53 | 500 | 20.395820899s | 193.122.113.204 | POST "/v1/chat/completions"
2024/04/06 08:30:53 [Recovery] 2024/04/06 - 08:30:53 panic recovered:
runtime error: invalid memory address or nil pointer dereference
/layers/heroku_go/shim/go1.21.5/go/src/runtime/panic.go:261 (0x44def7)
/layers/heroku_go/shim/go1.21.5/go/src/runtime/signal_unix.go:861 (0x44dec5)
/workspace/internal/chatgpt/request.go:225 (0x8cbe5d)
InitTurnStile: defer response.Body.Close()
/workspace/handlers.go:173 (0x8e4524)
(*Handler).nightmare: turnStile, status, err := chatgpt.InitTurnStile(client, secret, proxyUrl, 5)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8e6baf)
/workspace/middleware.go:33 (0x8e6af4)
Authorization: c.Next()
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8e6955)
/workspace/middleware.go:14 (0x8e6943)
cors: c.Next()
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8b4599)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:102 (0x8b4587)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8b373d)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:240 (0x8b3700)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8b27fa)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:620 (0x8b248d)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:576 (0x8b213c)
/layers/heroku_go/shim/go1.21.5/go/src/net/http/server.go:2938 (0x6ac48d)
/layers/heroku_go/shim/go1.21.5/go/src/net/http/server.go:2009 (0x6a9133)
/layers/heroku_go/shim/go1.21.5/go/src/runtime/asm_amd64.s:1650 (0x46a3e0)
2024/04/06 08:32:04 [Recovery] 2024/04/06 - 08:32:04 panic recovered:
runtime error: invalid memory address or nil pointer dereference
/layers/heroku_go/shim/go1.21.5/go/src/runtime/panic.go:261 (0x44def7)
/layers/heroku_go/shim/go1.21.5/go/src/runtime/signal_unix.go:861 (0x44dec5)
/workspace/internal/chatgpt/request.go:225 (0x8cbe5d)
InitTurnStile: defer response.Body.Close()
/workspace/handlers.go:173 (0x8e4524)
(*Handler).nightmare: turnStile, status, err := chatgpt.InitTurnStile(client, secret, proxyUrl, 5)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8e6baf)
/workspace/middleware.go:33 (0x8e6af4)
Authorization: c.Next()
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8e6955)
/workspace/middleware.go:14 (0x8e6943)
cors: c.Next()
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8b4599)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:102 (0x8b4587)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8b373d)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:240 (0x8b3700)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174 (0x8b27fa)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:620 (0x8b248d)
/layers/heroku_go/shim/go-path/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:576 (0x8b213c)
/layers/heroku_go/shim/go1.21.5/go/src/net/http/server.go:2938 (0x6ac48d)
/layers/heroku_go/shim/go1.21.5/go/src/net/http/server.go:2009 (0x6a9133)
/layers/heroku_go/shim/go1.21.5/go/src/runtime/asm_amd64.s:1650 (0x46a3e0)
[GIN] 2024/04/06 - 08:32:04 | 500 | 8.808112068s | 193.122.113.204 | POST "/v1/chat/completions"

如何流式打印返回的内容

我看是支持stream=ture的。请问如何流式打印返回的内容?请大侠指导。
我使用的python代码是这样的:
import requests
import json
url = "http://127.0.0.1:8080/v1/chat/completions"
headers = {"Content-Type": "application/json"}
data = {
"model": "gpt-3.5-turbo",
"messages": [{
"role": "user",
"content": "Hi"
}],
"stream":True
}
response = requests.post(url, headers=headers, data=json.dumps(data))

能否支持https?

查了一下,好像比较容易🥹

import (
  "github.com/gin-gonic/autotls"
  "github.com/gin-gonic/gin"
  "golang.org/x/crypto/acme/autocert"
)

Improving Version Control with .gitattributes File

  • 我已确认目前没有类似 issue
  • 我已确认目前没有类似 issue
  • 我已确认我已升级到最新版本
  • 我已完整查看过项目 README,已确定现有版本无法满足需求
  • 我理解并愿意跟进此 issue,协助测试和提供反馈
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

.gitattributes 文件可以用于定义项目中文件的属性,以优化项目的版本控制。

  1. 定义行尾风格:,.gitattributes 文件可以用于定义行尾风格。你可以设置所有的 .go.html 文件在提交时自动转换为 LF 行尾,而在检出时转换为 CRLF 行尾。

    *.go text eol=lf
    *.html text eol=lf
  2. 定义文件的合并策略:.gitattributes 文件可以用于定义特定文件的合并策略。可以设置所有的 .json 文件使用 merge=ours 策略,这意味着在合并冲突时,总是选择当前分支的版本。

    *.json merge=ours

Usage is not correct

I tried the example in the README.

curl --location 'http://127.0.0.1:8080/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data '{
     "model": "gpt-3.5-turbo",
     "messages": [{"role": "user", "content": "Say this is a test!"}],
     "stream": true
   }'

The response is as following:

{"id":"xxxx","object":"chat.completion","created":0,"model":"gpt-3.5-turbo-0125","usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0},"choices":[{"index":0,"message":{"role":"assistant","content":"\"This is a test!\""},"finish_reason":null}]}

The tokens in the "usage" are all zero.

Can you fix it.

Thank for your great work.

401错误是不是机器的ip不支持运行

{
"code": 401,
"message": "response status code is not 200",
"param": {},
"type": "InitTurnStile_request_error"
}

有另外一台ip可以正常运行,这台KR的就不行,但是在KR的chatgptnext上面填我另外一条的api就可以

unable to check chat requirement

报告佬: 有错误,不知道如何解决


 $docker ps
CONTAINER ID   IMAGE                                  COMMAND      CREATED              STATUS              PORTS                    NAMES
baa2171b690f   ghcr.io/aurora-develop/aurora:latest   "./aurora"   About a minute ago   Up About a minute   0.0.0.0:8080->8080/tcp   naughty_bartik


$curl --location 'http://127.0.0.1:8080/v1/chat/completions' --header 'Content-Type: application/json' --data '{
     "model": "gpt-3.5-turbo",
     "messages": [{"role": "user", "content": "Say this is a test!"}]
   }'
{"error":"unable to check chat requirement"}

为什么提示500错误

如题,昨天晚上还是可以的,今天就总是500了,拼命重试可以刷新出几次可以正常回答。

目前好像还不支持中文

测试了一下,用中文提问,返回的text是乱码。如果用英文,一切正常。大家是这种情况吗?

剥离 TlsClient

  1. Tlsclinet 抽出来,方便更换http框架
  2. 一个request context 使用一个 clinet的instance 不要全局用一个

访问 Web端 http://127.0.0.1:8080/web 404 page not found

curl --location 'http://127.0.0.1:8080/v1/chat/completions' \

--header 'Content-Type: application/json'
--data '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Say this is a test!"}],
"stream": true
}'
data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"role":"assistant"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"This"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":" is"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":" a"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":" test"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"!"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0125","choices":[{"delta":{},"index":0,"finish_reason":"stop"}]}

data: [DONE]

[root@instance-20221012-2111 ~]# curl --location 'http://127.0.0.1:8080/v1/chat/completions' \

--header 'Content-Type: application/json'
--data '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Say this is a test!"}],
"stream": true
}'
data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"role":"assistant"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"This"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":" is"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":" a"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":" test"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"!"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0125","choices":[{"delta":{},"index":0,"finish_reason":"stop"}]}

data: [DONE]
使用nextchat也报错{
"error": true,
"message": "Failed to fetch"
}
接口地址写入的http://127.0.0.1:8080/v1/chat/completions
postman 请求http://127.0.0.1:8080/v1/chat/completions 也是404 page not found

部署后打开网址只有提示{"message":"Hello, world!"}

部署后打开网址只有提示{"message":"Hello, world!"},在vps上用curl输出结果如下:

curl --location 'http://127.0.0.1:8080/v1/chat/completions'
--header 'Content-Type: application/json'
--data '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Say this is a test!"}],
"stream": true
}
data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"role":"assistant"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"This"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":" is"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":" a"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":" test"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"!"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion.chunk","created":0,"model":"gpt-3.5-turbo-0125","choices":[{"delta":{},"index":0,"finish_reason":"stop"}]}

data: [DONE]

非常棒的应用

之前我一直使用: ChatGPT-to-API

后来这个不能用,目前这个aurora是我用过最好的同类应用,可以直接用api !!!希望再接再厉!

UI界面

UI界面管理账号、指纹等功能

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.