Skip to content

Commit

Permalink
Add support for GPT4o Mini (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldmannak authored Jul 19, 2024
1 parent b30d43f commit d100fb1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Sources/CleverBird/chat/ChatModel.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
public enum ChatModel: Codable {
case gpt35Turbo
case gpt4oMini
case gpt4
case gpt4Turbo
case gpt4o
Expand All @@ -12,6 +13,8 @@ public enum ChatModel: Codable {
switch modelString {
case _ where modelString.starts(with: "gpt-3.5"):
self = .gpt35Turbo
case _ where modelString.starts(with: "gpt-4o-mini"):
self = .gpt4oMini
case _ where modelString.starts(with: "gpt-4o"):
self = .gpt4o
case _ where modelString.starts(with: "gpt-4-turbo"):
Expand All @@ -36,6 +39,8 @@ extension ChatModel: CustomStringConvertible {
switch self {
case .gpt35Turbo:
return "gpt-3.5-turbo"
case .gpt4oMini:
return "gpt-4o-mini"
case .gpt4o:
return "gpt-4o"
case .gpt4Turbo:
Expand Down
2 changes: 1 addition & 1 deletion Sources/CleverBird/chat/ChatThread+tokenCount.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ extension ChatThread {
tokensPerMessage = 4
case .gpt4, .gpt4Turbo:
tokensPerMessage = 3
case .gpt4o:
case .gpt4o, .gpt4oMini:
tokensPerMessage = 3
case .specific(_):
tokensPerMessage = 3
Expand Down

0 comments on commit d100fb1

Please sign in to comment.