-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstructs.go
More file actions
32 lines (27 loc) · 743 Bytes
/
structs.go
File metadata and controls
32 lines (27 loc) · 743 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
package main
type OpenaiRequest struct {
Model string `json:"model"`
Messages []Message `json:"messages"`
}
type OpenaiResponse struct {
ID string `json:"id"`
Object string `json:"object"`
Created int `json:"created"`
Choices []Choice `json:"choices"`
Usages Usage `json:"usage"`
Model string `json:"model"`
}
type Choice struct {
Index int `json:"index"`
Messages Message `json:"message"`
FinishReason string `json:"finish_reason"`
}
type Message struct {
Role string `json:"role"`
Content string `json:"content"`
}
type Usage struct {
PromptTokens int `json:"prompt_tokens"`
CompletionTokens int `json:"completion_tokens"`
TotalTokens int `json:"total_tokens"`
}