You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
raiseInvalidArrayTypeError,"Invalid array type: #{of.inspect}. Must be a primitive type (:string, :number, etc.), a symbol reference, a Schema class, or a Schema instance."
103
+
end
104
+
105
+
defdetermine_object_reference(of,description=nil)
106
+
result=caseof
107
+
whenSymbol
108
+
reference(of)
109
+
whenClass
110
+
ifschema_class?(of)
111
+
schema_class_to_inline_schema(of)
112
+
else
113
+
raiseInvalidObjectTypeError,"Invalid object type: #{of.inspect}. Class must inherit from RubyLLM::Schema."
114
+
end
115
+
else
116
+
ifschema_class?(of)
117
+
schema_class_to_inline_schema(of)
118
+
else
119
+
raiseInvalidObjectTypeError,"Invalid object type: #{of.inspect}. Must be a symbol reference, a Schema class, or a Schema instance."
120
+
end
121
+
end
122
+
123
+
description ? result.merge(description: description) : result
124
+
end
125
+
126
+
defcollect_schemas_from_block(&block)
127
+
schemas=[]
128
+
schema_builder=self
129
+
130
+
context=Object.new
131
+
132
+
# Dynamically create methods for all schema builders
raiseInvalidArrayTypeError,"Invalid array type: #{of.inspect}. Must be a primitive type (:string, :number, etc.), a symbol reference, a Schema class, or a Schema instance."
42
-
end
43
-
44
-
defdetermine_object_reference(of,description=nil)
45
-
result=caseof
46
-
whenSymbol
47
-
reference(of)
48
-
whenClass
49
-
ifschema_class?(of)
50
-
schema_class_to_inline_schema(of)
51
-
else
52
-
raiseInvalidObjectTypeError,"Invalid object type: #{of.inspect}. Class must inherit from RubyLLM::Schema."
53
-
end
54
-
else
55
-
ifschema_class?(of)
56
-
schema_class_to_inline_schema(of)
57
-
else
58
-
raiseInvalidObjectTypeError,"Invalid object type: #{of.inspect}. Must be a symbol reference, a Schema class, or a Schema instance."
59
-
end
60
-
end
61
-
62
-
description ? result.merge(description: description) : result
63
-
end
64
-
65
-
defcollect_schemas_from_block(&block)
66
-
schemas=[]
67
-
schema_builder=self
68
-
69
-
context=Object.new
70
-
71
-
# Dynamically create methods for all schema builders
0 commit comments