Skip to content

Commit

Permalink
Merge pull request #75 from maxduke/patch-1
Browse files Browse the repository at this point in the history
Add support for gpt-4o-mini, drop support for gpt-3.5
  • Loading branch information
xqdoo00o authored Jul 19, 2024
2 parents 108f924 + 372ec72 commit 8d4df01
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'

- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.22

- name: Build
run: go build -o bin/ .
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use the official Golang image as the builder
FROM golang:1.20.3-alpine as builder
FROM golang:alpine AS builder

# Enable CGO to use C libraries (set to 0 to disable it)
# We set it to 0 to build a fully static binary for our final image
Expand Down
11 changes: 5 additions & 6 deletions conversion/requests/chatgpt/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ var gptsRegexp = regexp.MustCompile(`-gizmo-g-(\w+)`)

func ConvertAPIRequest(api_request official_types.APIRequest, account string, secret *tokens.Secret, deviceId string, proxy string) chatgpt_types.ChatGPTRequest {
chatgpt_request := chatgpt_types.NewChatGPTRequest()
if strings.HasPrefix(api_request.Model, "gpt-3.5") {
chatgpt_request.Model = "text-davinci-002-render-sha"
if strings.HasPrefix(api_request.Model, "gpt-4o-mini") {
chatgpt_request.Model = "gpt-4o-mini"
} else if strings.HasPrefix(api_request.Model, "gpt-4o") {
chatgpt_request.Model = "gpt-4o"
} else if strings.HasPrefix(api_request.Model, "gpt-4") {
chatgpt_request.Model = "gpt-4"
if strings.HasPrefix(api_request.Model, "gpt-4o") {
chatgpt_request.Model = "gpt-4o"
}
}
}
matches := gptsRegexp.FindStringSubmatch(api_request.Model)
if len(matches) == 2 {
chatgpt_request.ConversationMode.Kind = "gizmo_interaction"
Expand Down

0 comments on commit 8d4df01

Please sign in to comment.