Skip to content

Commit d100fb1

Browse files
authored
Add support for GPT4o Mini (#23)
1 parent b30d43f commit d100fb1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Sources/CleverBird/chat/ChatModel.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
public enum ChatModel: Codable {
22
case gpt35Turbo
3+
case gpt4oMini
34
case gpt4
45
case gpt4Turbo
56
case gpt4o
@@ -12,6 +13,8 @@ public enum ChatModel: Codable {
1213
switch modelString {
1314
case _ where modelString.starts(with: "gpt-3.5"):
1415
self = .gpt35Turbo
16+
case _ where modelString.starts(with: "gpt-4o-mini"):
17+
self = .gpt4oMini
1518
case _ where modelString.starts(with: "gpt-4o"):
1619
self = .gpt4o
1720
case _ where modelString.starts(with: "gpt-4-turbo"):
@@ -36,6 +39,8 @@ extension ChatModel: CustomStringConvertible {
3639
switch self {
3740
case .gpt35Turbo:
3841
return "gpt-3.5-turbo"
42+
case .gpt4oMini:
43+
return "gpt-4o-mini"
3944
case .gpt4o:
4045
return "gpt-4o"
4146
case .gpt4Turbo:

Sources/CleverBird/chat/ChatThread+tokenCount.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ extension ChatThread {
1919
tokensPerMessage = 4
2020
case .gpt4, .gpt4Turbo:
2121
tokensPerMessage = 3
22-
case .gpt4o:
22+
case .gpt4o, .gpt4oMini:
2323
tokensPerMessage = 3
2424
case .specific(_):
2525
tokensPerMessage = 3

0 commit comments

Comments
 (0)