forked from coaidev/coai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtools.go
40 lines (33 loc) · 994 Bytes
/
tools.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
package globals
type ToolCallId string
type FunctionTools []ToolObject
type ToolObject struct {
Type string `json:"type"`
Function ToolFunction `json:"function"`
}
type ToolFunction struct {
Name string `json:"name"`
Description string `json:"description"`
Parameters ToolParameters `json:"parameters"`
}
type ToolParameters struct {
Type string `json:"type"`
Properties ToolProperties `json:"properties"`
Required []string `json:"required"`
}
type ToolProperties map[string]ToolProperty
type ToolProperty struct {
Type string `json:"type"`
Description string `json:"description"`
Enum *[]string `json:"enum,omitempty"`
}
type ToolCallFunction struct {
Name string `json:"name"`
Arguments string `json:"arguments"`
}
type ToolCall struct {
Type string `json:"type"`
Id ToolCallId `json:"id"`
Function ToolCallFunction `json:"function"`
}
type ToolCalls []ToolCall