Skip to content

Commit

Permalink
Quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew committed Feb 4, 2024
1 parent 6fc9413 commit d03c694
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/olekukonko/ts"
)

const localVersion = "2.6.0"
const localVersion = "2.6.1"

var bold = color.New(color.Bold)
var boldBlue = color.New(color.Bold, color.FgBlue)
Expand Down
9 changes: 8 additions & 1 deletion providers/opengpts/opengpts.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/aandrew-me/tgpt/v2/client"
"github.com/aandrew-me/tgpt/v2/structs"
"github.com/aandrew-me/tgpt/v2/utils"
)

type Message struct {
Expand All @@ -35,6 +36,12 @@ func NewRequest(input string, params structs.Params, extraOptions structs.ExtraO
}
safeInput, _ := json.Marshal(input)

randID := utils.RandomString(36)

if len(extraOptions.ThreadID) > 1 {
randID = extraOptions.ThreadID;
}

var data = strings.NewReader(fmt.Sprintf(`{
"input": [
{
Expand All @@ -61,7 +68,7 @@ func NewRequest(input string, params structs.Params, extraOptions structs.ExtraO
req.Header.Add("accept-language", "en-US,en;q=0.7")
req.Header.Add("cache-control", "no-cache")
req.Header.Add("content-type", "application/json")
req.Header.Add("cookie", "opengpts_user_id="+extraOptions.ThreadID)
req.Header.Add("cookie", "opengpts_user_id="+randID)
req.Header.Add("origin", "https://opengpts-example-vz4y4ooboq-uc.a.run.app")
req.Header.Add("pragma", "no-cache")
req.Header.Add("referer", "https://opengpts-example-vz4y4ooboq-uc.a.run.app/")
Expand Down

0 comments on commit d03c694

Please sign in to comment.