File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed
py/plugins/google-genai/src/genkit/plugins/google_genai/models Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -544,17 +544,23 @@ def _convert_schema_property(
544
544
if defs is None :
545
545
defs = input_schema .get ('$defs' ) if '$defs' in input_schema else {}
546
546
547
+ if '$ref' in input_schema :
548
+ ref_path = input_schema ['$ref' ]
549
+ ref_tokens = ref_path .split ('/' )
550
+ ref_name = ref_tokens [- 1 ]
551
+
552
+ if ref_name not in defs :
553
+ raise ValueError (f'Failed to resolve schema for { ref_tokens [2 ]} ' )
554
+
555
+ schema = self ._convert_schema_property (defs [ref_tokens [2 ]], defs )
556
+
557
+ if input_schema .get ('description' ):
558
+ schema .description = input_schema ['description' ]
559
+
560
+ return schema
561
+
547
562
if 'type' not in input_schema :
548
- if '$ref' in input_schema :
549
- ref_tokens = input_schema ['$ref' ].split ('/' )
550
- if ref_tokens [2 ] not in defs :
551
- raise ValueError (f'Failed to resolve schema for { ref_tokens [2 ]} ' )
552
- schema = self ._convert_schema_property (defs [ref_tokens [2 ]], defs )
553
- if input_schema .get ('description' ):
554
- schema .description = input_schema ['description' ]
555
- return schema
556
- else :
557
- return None
563
+ return None
558
564
559
565
schema = genai_types .Schema ()
560
566
if input_schema .get ('description' ):
You can’t perform that action at this time.
0 commit comments