-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathapi_chat_completions_tool.go
45 lines (38 loc) · 1.57 KB
/
api_chat_completions_tool.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
package moonshot
type ChatCompletionsTool struct {
Type ChatCompletionsToolType `json:"type"`
Function *ChatCompletionsToolFunction `json:"function"`
}
type ChatCompletionsToolFunction struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Parameters *ChatCompletionsToolFunctionParameters `json:"parameters,omitempty"`
}
type ChatCompletionsToolFunctionParameters struct {
Type ChatCompletionsParametersType `json:"type"`
Properties map[string]*ChatCompletionsToolFunctionProperties `json:"properties"`
Required []string `json:"required,omitempty"`
}
type ChatCompletionsToolFunctionProperties struct {
Type string `json:"type"`
Description string `json:"description,omitempty"`
Enum []string `json:"enum,omitempty"`
}
type ChatCompletionsResponseToolCalls struct {
Index int64 `json:"index"`
ID string `json:"id"`
Type string `json:"type"`
Function *ChatCompletionsResponseToolCallsFunction `json:"function"`
}
type ChatCompletionsResponseToolCallsFunction struct {
Name string `json:"name"`
Arguments string `json:"arguments"`
}
type ChatCompletionsToolBuiltinFunctionWebSearchArguments struct {
SearchResult struct {
SearchId string `json:"search_id"`
} `json:"search_result"`
Usage struct {
TotalTokens int `json:"total_tokens"`
} `json:"usage"`
}