forked from intitni/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModels.swift
More file actions
36 lines (31 loc) · 852 Bytes
/
Models.swift
File metadata and controls
36 lines (31 loc) · 852 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
import Foundation
struct Cancellable {
let cancel: () -> Void
func callAsFunction() {
cancel()
}
}
public struct ChatMessage: Equatable, Codable {
public enum Role: String, Codable, Equatable {
case system
case user
case assistant
}
public var role: Role
public var content: String
public var summary: String?
public var id: String?
public init(role: Role, content: String, summary: String? = nil, id: String? = nil) {
self.role = role
self.content = content
self.summary = summary
self.id = id
}
}
public enum ChatGPTModel: String {
case gpt_3_5_turbo = "gpt-3.5-turbo"
case gpt_3_5_turbo_0301 = "gpt-3.5-turbo-0301"
case gpt_4_0314 = "gpt-4-0314"
case gpt_4_32k = "gpt-4-32k"
case gpt_4_32k_0314 = "gpt-4-32k-0314"
}