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
| openAPISchema := &openapi3.Schema{
Type: openapi3.TypeObject,
Required: []string{"name", "age"},
Properties: map[string]*openapi3.SchemaRef{
"name": {
Value: &openapi3.Schema{
Type: openapi3.TypeString,
Description: "用户姓名",
MinLength: &[]int{1}[0],
MaxLength: &[]int{50}[0],
},
},
"age": {
Value: &openapi3.Schema{
Type: openapi3.TypeInteger,
Description: "用户年龄",
Minimum: &[]float64{0}[0],
Maximum: &[]float64{150}[0],
},
},
"job": {
Value: &openapi3.Schema{
Type: openapi3.TypeObject,
Description: "工作信息",
Properties: map[string]*openapi3.SchemaRef{
"company": {
Value: &openapi3.Schema{
Type: openapi3.TypeString,
Description: "公司名称",
},
},
"position": {
Value: &openapi3.Schema{
Type: openapi3.TypeString,
Description: "职位",
},
},
},
},
},
},
}
toolInfo := &schema.ToolInfo{
Name: "search_user",
Desc: "搜索用户信息",
ParamsOneOf: schema.NewParamsOneOfByOpenAPIV3(openAPISchema),
}
|