This repository has been archived by the owner on Aug 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
types.go
52 lines (45 loc) · 1.52 KB
/
types.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
package gpt35
type RoleType string
type ModelType string
type Request struct {
Model ModelType `json:"model"`
Messages []*Message `json:"messages"`
Temperature float64 `json:"temperature,omitempty"`
TopP float64 `json:"top_p,omitempty"`
N int `json:"n,omitempty"`
Stream bool `json:"stream,omitempty"`
Stop interface{} `json:"stop,omitempty"`
MaxTokens int `json:"max_tokens,omitempty"`
PresencePenalty float64 `json:"presence_penalty,omitempty"`
FrequencyPenalty float64 `json:"frequency_penalty,omitempty"`
LogitBias interface{} `json:"logit_bias,omitempty"`
User string `json:"user,omitempty"`
}
type Response struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
Choices []*Choice `json:"choices"`
Usage *Usage `json:"usage"`
Error *Error `json:"error,omitempty"`
}
type Message struct {
Role RoleType `json:"role,omitempty"`
Content string `json:"content"`
}
type Choice struct {
Index int `json:"index"`
Message *Message `json:"message"`
FinishReason string `json:"finish_reason"`
}
type Usage struct {
PromptTokens int `json:"prompt_tokens"`
CompletionTokens int `json:"completion_tokens"`
TotalTokens int `json:"total_tokens"`
}
type Error struct {
Message string `json:"message"`
Type string `json:"type"`
Param string `json:"param"`
Code string `json:"code"`
}