Skip to content

Commit 4a39591

Browse files
committed
Add new OpenAI model
1 parent fd84744 commit 4a39591

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

Tool/Sources/AIModel/ChatModel.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public struct ChatModel: Codable, Equatable, Identifiable {
3131
public var maxTokens: Int
3232
@FallbackDecoding<EmptyBool>
3333
public var supportsFunctionCalling: Bool
34+
@FallbackDecoding<EmptyBool>
35+
public var supportsOpenAIAPI2023_11: Bool
3436
@FallbackDecoding<EmptyString>
3537
public var modelName: String
3638
public var azureOpenAIDeploymentName: String {
@@ -43,12 +45,14 @@ public struct ChatModel: Codable, Equatable, Identifiable {
4345
baseURL: String = "",
4446
maxTokens: Int = 4000,
4547
supportsFunctionCalling: Bool = true,
48+
supportsOpenAIAPI2023_11: Bool = false,
4649
modelName: String = ""
4750
) {
4851
self.apiKeyName = apiKeyName
4952
self.baseURL = baseURL
5053
self.maxTokens = maxTokens
5154
self.supportsFunctionCalling = supportsFunctionCalling
55+
self.supportsOpenAIAPI2023_11 = supportsOpenAIAPI2023_11
5256
self.modelName = modelName
5357
}
5458
}

Tool/Sources/Preferences/Types/ChatGPTModel.swift

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ public enum ChatGPTModel: String {
77
case gpt432k = "gpt-4-32k"
88
case gpt40314 = "gpt-4-0314"
99
case gpt40613 = "gpt-4-0613"
10+
case gpt41106Preview = "gpt-4-1106-preview"
11+
case gpt4VisionPreview = "gpt-4-vision-preview"
1012
case gpt35Turbo0301 = "gpt-3.5-turbo-0301"
1113
case gpt35Turbo0613 = "gpt-3.5-turbo-0613"
14+
case gpt35Turbo1106 = "gpt-3.5-turbo-1106"
1215
case gpt35Turbo16k0613 = "gpt-3.5-turbo-16k-0613"
1316
case gpt432k0314 = "gpt-4-32k-0314"
1417
case gpt432k0613 = "gpt-4-32k-0613"
@@ -31,14 +34,29 @@ public extension ChatGPTModel {
3134
return 4096
3235
case .gpt35Turbo0613:
3336
return 4096
37+
case .gpt35Turbo1106:
38+
return 16385
3439
case .gpt35Turbo16k:
35-
return 16384
40+
return 16385
3641
case .gpt35Turbo16k0613:
37-
return 16384
42+
return 16385
3843
case .gpt40613:
3944
return 8192
4045
case .gpt432k0613:
4146
return 32768
47+
case .gpt41106Preview:
48+
return 128000
49+
case .gpt4VisionPreview:
50+
return 128000
51+
}
52+
}
53+
54+
var supportsImages: Bool {
55+
switch self {
56+
case .gpt4VisionPreview:
57+
return true
58+
default:
59+
return false
4260
}
4361
}
4462
}

0 commit comments

Comments
 (0)