File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -239,13 +239,21 @@ def refresh_metadata(self) -> None:
239239 @classmethod
240240 def model_json_schema (cls , ** kwargs ):
241241 schema = super ().model_json_schema (** kwargs )
242- schema ["$id" ] = "/schemas/File"
243242 # Create a schema that accepts either a string or the full object
244- return {
243+ base_schema = {
245244 "anyOf" : [
246245 {"type" : "string" }, # Accept string input
247- schema # Accept full object input
248- ],
249- "title" : "File" ,
250- "description" : "A class representing a file in the inference.sh ecosystem."
251- }
246+ {
247+ "type" : "object" ,
248+ "properties" : schema ["properties" ],
249+ "title" : schema .get ("title" , "File" ),
250+ "description" : "A class representing a file in the inference.sh ecosystem."
251+ }
252+ ]
253+ }
254+ # If this is the top-level schema, return as is
255+ if not kwargs .get ("ref_template" ):
256+ return base_schema
257+ # If this is being used in $defs, include it in the schema
258+ schema .update (base_schema )
259+ return schema
You can’t perform that action at this time.
0 commit comments