Skip to content

Commit 210b61f

Browse files
committed
feat: integrate GPT-4 Turbo model support
- 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>
1 parent c03abb4 commit 210b61f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

openai/openai.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ var modelMaps = map[string]string{
2323
"gpt-4-32k": openai.GPT432K,
2424
"gpt-4-0613": openai.GPT40613,
2525
"gpt-4-0314": openai.GPT40314,
26+
"gpt-4-turbo": openai.GPT4Turbo,
27+
"gpt-4-turbo-2024-04-09": openai.GPT4Turbo20240409,
2628
"gpt-4-0125-preview": openai.GPT4Turbo0125,
2729
"gpt-4-1106-preview": openai.GPT4Turbo1106,
2830
"gpt-4-turbo-preview": openai.GPT4TurboPreview,
@@ -190,6 +192,8 @@ func (c *Client) Completion(
190192
openai.GPT4Turbo0125,
191193
openai.GPT4TurboPreview,
192194
openai.GPT4VisionPreview,
195+
openai.GPT4Turbo,
196+
openai.GPT4Turbo20240409,
193197
groq.LLaMA270bChat.GetModel(),
194198
groq.Mixtral8x7bInstructV01.GetModel(),
195199
groq.Gemma7bIt.GetModel():
@@ -310,7 +314,9 @@ func (c *Client) allowFuncCall(cfg *config) bool {
310314
}
311315

312316
switch c.model {
313-
case openai.GPT4TurboPreview,
317+
case openai.GPT4Turbo,
318+
openai.GPT4Turbo20240409,
319+
openai.GPT4TurboPreview,
314320
openai.GPT4Turbo0125,
315321
openai.GPT4Turbo1106,
316322
openai.GPT40613,

0 commit comments

Comments
 (0)