forked from intitni/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChatGPTModel.swift
More file actions
40 lines (31 loc) · 795 Bytes
/
ChatGPTModel.swift
File metadata and controls
40 lines (31 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import Foundation
public enum ChatGPTModel: String {
case gpt4 = "gpt-4"
case gpt40314 = "gpt-4-0314"
case gpt432k = "gpt-4-32k"
case gpt432k0314 = "gpt-4-32k-0314"
case gpt35Turbo = "gpt-3.5-turbo"
case gpt35Turbo0301 = "gpt-3.5-turbo-0301"
}
public extension ChatGPTModel {
var endpoint: String {
"https://api.openai.com/v1/chat/completions"
}
var maxToken: Int {
switch self {
case .gpt4:
return 8192
case .gpt40314:
return 8192
case .gpt432k:
return 32768
case .gpt432k0314:
return 32768
case .gpt35Turbo:
return 4096
case .gpt35Turbo0301:
return 4096
}
}
}
extension ChatGPTModel: CaseIterable {}