Skip to content

Commit

Permalink
Add support for o1-preview & o1-mini
Browse files Browse the repository at this point in the history
  • Loading branch information
maxduke committed Sep 13, 2024
1 parent eed7f05 commit f5af289
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions conversion/requests/chatgpt/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ func ConvertAPIRequest(api_request official_types.APIRequest, account string, se
chatgpt_request.Model = "gpt-4o"
} else if strings.HasPrefix(api_request.Model, "gpt-4") {
chatgpt_request.Model = "gpt-4"
} else if strings.HasPrefix(api_request.Model, "o1-preview") {
chatgpt_request.Model = "o1-preview"
} else if strings.HasPrefix(api_request.Model, "o1-mini") {
chatgpt_request.Model = "o1-mini"
}
matches := gptsRegexp.FindStringSubmatch(api_request.Model)
if len(matches) == 2 {
Expand Down
12 changes: 12 additions & 0 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@ func simulateModel(c *gin.Context) {
"created": 1688888888,
"owned_by": "chatgpt-to-api",
},
{
"id": "o1-preview",
"object": "model",
"created": 1688888888,
"owned_by": "chatgpt-to-api",
},
{
"id": "o1-mini",
"object": "model",
"created": 1688888888,
"owned_by": "chatgpt-to-api",
},
},
})
}
Expand Down

0 comments on commit f5af289

Please sign in to comment.