Skip to content

Commit

Permalink
feat: integrate GPT-4 Turbo model support
Browse files Browse the repository at this point in the history
- Add `gpt-4-turbo` and `gpt-4-turbo-2024-04-09` to the model maps
- Include `GPT4Turbo` and `GPT4Turbo20240409` in the `Completion` function options
- Update the `allowFuncCall` function to include `GPT4Turbo` and `GPT4Turbo20240409`, and reorder to include `GPT4TurboPreview` after these entries

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Apr 24, 2024
1 parent c03abb4 commit 210b61f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion openai/openai.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ var modelMaps = map[string]string{
"gpt-4-32k": openai.GPT432K,
"gpt-4-0613": openai.GPT40613,
"gpt-4-0314": openai.GPT40314,
"gpt-4-turbo": openai.GPT4Turbo,
"gpt-4-turbo-2024-04-09": openai.GPT4Turbo20240409,
"gpt-4-0125-preview": openai.GPT4Turbo0125,
"gpt-4-1106-preview": openai.GPT4Turbo1106,
"gpt-4-turbo-preview": openai.GPT4TurboPreview,
Expand Down Expand Up @@ -190,6 +192,8 @@ func (c *Client) Completion(
openai.GPT4Turbo0125,
openai.GPT4TurboPreview,
openai.GPT4VisionPreview,
openai.GPT4Turbo,
openai.GPT4Turbo20240409,
groq.LLaMA270bChat.GetModel(),
groq.Mixtral8x7bInstructV01.GetModel(),
groq.Gemma7bIt.GetModel():
Expand Down Expand Up @@ -310,7 +314,9 @@ func (c *Client) allowFuncCall(cfg *config) bool {
}

switch c.model {
case openai.GPT4TurboPreview,
case openai.GPT4Turbo,
openai.GPT4Turbo20240409,
openai.GPT4TurboPreview,
openai.GPT4Turbo0125,
openai.GPT4Turbo1106,
openai.GPT40613,
Expand Down

0 comments on commit 210b61f

Please sign in to comment.