Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/test_au' into test_au
Browse files Browse the repository at this point in the history
  • Loading branch information
aurorax-neo committed Apr 4, 2024
2 parents 8391c82 + 5555435 commit 5078c4e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

免费的GPT3.5 api

### 注:仅ip属地支持免登录使用ChatGpt可以使用

## Deploy

### Render部署
[![Deploy](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy)

### 编译部署

Expand Down Expand Up @@ -38,9 +42,6 @@ cd aurora
docker-compose up -d
```

### Render部署
[![Deploy](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy)

## Usage

```bash
Expand Down
1 change: 1 addition & 0 deletions httpclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func NewStdClient() *RestyClient {
client.Client.SetRetryCount(3)
client.Client.SetRetryWaitTime(5 * time.Second)
client.Client.SetRetryMaxWaitTime(20 * time.Second)

client.Client.SetTimeout(600 * time.Second)
client.Client.SetHeader("user-agent", browser.Random()).
SetHeader("accept", "*/*").
Expand Down
7 changes: 3 additions & 4 deletions internal/chatgpt/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/aurorax-neo/go-logger"
"io"
"net/http"
"net/url"
Expand All @@ -22,6 +21,8 @@ import (
"sync"
"time"

"github.com/aurorax-neo/go-logger"

"github.com/gorilla/websocket"

fhttp "github.com/bogdanfinn/fhttp"
Expand Down Expand Up @@ -304,7 +305,7 @@ func POSTconversation(client *httpclient.RestyClient, message chatgpt_types.Chat
if proxy != "" {
client.Client.SetProxy(proxy)
}
apiUrl := "https://chat.openai.com/backend-api/conversation"
apiUrl := "https://chat.openai.com/backend-anon/conversation"
if API_REVERSE_PROXY != "" {
apiUrl = API_REVERSE_PROXY
}
Expand Down Expand Up @@ -753,8 +754,6 @@ func GETTokenForRefreshToken(refresh_token string, proxy string) (interface{}, i
}

req, _ := fhttp.NewRequest("POST", url, bytes.NewBuffer(reqBody))


req.Header.Set("authority", "auth0.openai.com")
req.Header.Add("Accept-Language", "en-US,en;q=0.9")
req.Header.Set("Content-Type", "application/json")
Expand Down

0 comments on commit 5078c4e

Please sign in to comment.