/
model.go
61 lines (53 loc) · 1.83 KB
/
model.go
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package openai
type Model struct {
ID string `json:"id"`
Object string `json:"object"`
Created int `json:"created"`
OwnedBy string `json:"owned_by"`
}
type ChatRole string
const (
ChatRoleSystem ChatRole = "system"
ChatRoleUser ChatRole = "user"
ChatRoleAssistant ChatRole = "assistant"
)
type ChatCompletionRequestMessage struct {
Role ChatRole `json:"role"`
Content string `json:"content"`
Name string `json:"name,omitempty"`
}
type ChatCompletionResponseMessage struct {
Role ChatRole `json:"role"`
Content string `json:"content"`
}
type File struct {
ID string `json:"id"`
Object string `json:"object"`
Bytes int `json:"bytes"`
CreatedAt int `json:"created_at"`
Filename string `json:"filename"`
Purpose string `json:"purpose"`
Status string `json:"status"`
StatusDetails map[string]any `json:"status_details"`
}
type FineTune struct {
ID string `json:"id"`
Object string `json:"object"`
CreatedAt int `json:"created_at"`
UpdatedAt int `json:"updated_at"`
Model string `json:"model"`
FineTunedModel string `json:"fine_tuned_model"`
OrganizationID string `json:"organization_id"`
Status string `json:"status"`
Hyperparams map[string]any `json:"hyperparams"`
TrainingFiles []File `json:"training_files"`
ValidationFiles []File `json:"validation_files"`
ResultFiles []File `json:"result_files"`
Events []FineTuneEvent `json:"events"`
}
type FineTuneEvent struct {
Object string `json:"object"`
CreatedAt int `json:"created_at"`
Level string `json:"level"`
Message string `json:"message"`
}