forked from coaidev/coai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
54 lines (46 loc) · 1.62 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
53
54
package globals
type Hook func(data *Chunk) error
type Message struct {
Role string `json:"role"`
Content string `json:"content"`
Name *string `json:"name,omitempty"`
FunctionCall *FunctionCall `json:"function_call,omitempty"` // only `function` role
ToolCallId *string `json:"tool_call_id,omitempty"` // only `tool` role
ToolCalls *ToolCalls `json:"tool_calls,omitempty"` // only `assistant` role
}
type Chunk struct {
Content string `json:"content"`
ToolCall *ToolCalls `json:"tool_call,omitempty"`
FunctionCall *FunctionCall `json:"function_call,omitempty"`
}
type ChatSegmentResponse struct {
Conversation int64 `json:"conversation"`
Quota float32 `json:"quota"`
Keyword string `json:"keyword"`
Message string `json:"message"`
End bool `json:"end"`
Plan bool `json:"plan"`
}
type GenerationSegmentResponse struct {
Quota float32 `json:"quota"`
Message string `json:"message"`
Hash string `json:"hash"`
End bool `json:"end"`
Error string `json:"error"`
}
type ListModels struct {
Object string `json:"object"`
Data []ListModelsItem `json:"data"`
}
type ListModelsItem struct {
Id string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
OwnedBy string `json:"owned_by"`
}
type ProxyConfig struct {
ProxyType int `json:"proxy_type" mapstructure:"proxytype"`
Proxy string `json:"proxy" mapstructure:"proxy"`
Username string `json:"username" mapstructure:"username"`
Password string `json:"password" mapstructure:"password"`
}