forked from potproject/claude-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrequest.go
48 lines (41 loc) · 1.91 KB
/
request.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
package v1
type RequestBodyMessages struct {
Model string `json:"model"`
Messages []RequestBodyMessagesMessages `json:"messages"`
System string `json:"system"` // optional
MaxTokens int `json:"max_tokens"`
MetaData map[string]interface{} `json:"metadata"` // optional
StopSequences []string `json:"stop_sequences"` // optional
Stream bool `json:"stream"` // optional
Temperature float64 `json:"temperature"` // optional
TopP float64 `json:"top_p"` // optional
TopK float64 `json:"top_k"` // optional
}
type RequestBodyMessagesMessages struct {
Role string `json:"role"`
ContentRaw interface{} `json:"content"`
Content string `json:"-"`
ContentTypeText []RequestBodyMessagesMessagesContentTypeText `json:"-"`
ContentTypeImage []RequestBodyMessagesMessagesContentTypeImage `json:"-"`
}
const (
RequestBodyMessagesMessagesContentTypeTextType = "text"
RequestBodyMessagesMessagesContentTypeImageType = "image"
)
type RequestBodyMessagesMessagesContentTypeText struct {
Type string `json:"type"` // always "text"
Text string `json:"text"`
}
type RequestBodyMessagesMessagesContentTypeImage struct {
Type string `json:"type"` // always "image"
Source RequestBodyMessagesMessagesContentTypeImageSource `json:"source"`
}
type RequestBodyMessagesMessagesContentTypeImageSource struct {
Type string `json:"type"`
MediaType string `json:"media_type"`
Data string `json:"data"`
}
const (
MessagesRoleUser = "user"
MessagesRoleAssistant = "assistant"
)