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
33 lines (29 loc) · 661 Bytes
/
Models.swift
File metadata and controls
33 lines (29 loc) · 661 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
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(
id: String = UUID().uuidString,
role: Role,
content: String,
summary: String? = nil
) {
self.role = role
self.content = content
self.summary = summary
self.id = id
}
}