File tree 1 file changed +9
-10
lines changed
1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -14,22 +14,21 @@ def translated_tools
14
14
properties = { }
15
15
required = [ ]
16
16
17
- if t [ : parameters]
17
+ if t . parameters
18
18
properties = { }
19
19
20
- t [ : parameters] . each do |param |
21
- mapped = { type : param [ : type] , description : param [ : description] }
22
- mapped [ :items ] = { type : param [ : item_type] } if param [ : item_type]
23
- mapped [ :enum ] = param [ : enum] if param [ : enum]
24
- properties [ param [ : name] ] = mapped
20
+ t . parameters . each do |param |
21
+ mapped = { type : param . type , description : param . description }
22
+ mapped [ :items ] = { type : param . item_type } if param . item_type
23
+ mapped [ :enum ] = param . enum if param . enum
24
+ properties [ param . name ] = mapped
25
25
end
26
- required =
27
- t [ :parameters ] . select { |param | param [ :required ] } . map { |param | param [ :name ] }
26
+ required = t . parameters . select { |param | param . required } . map { |param | param . name }
28
27
end
29
28
30
29
{
31
- name : t [ : name] ,
32
- description : t [ : description] ,
30
+ name : t . name ,
31
+ description : t . description ,
33
32
input_schema : {
34
33
type : "object" ,
35
34
properties : properties ,
You can’t perform that action at this time.
0 commit comments