diff --git a/guardrails/schema/json_schema.py b/guardrails/schema/json_schema.py index f555925f2..07c1c1a33 100644 --- a/guardrails/schema/json_schema.py +++ b/guardrails/schema/json_schema.py @@ -453,7 +453,7 @@ async def async_validate( return validated_response - def introspect(self, data: Any) -> Tuple[List[ReAsk], Optional[Dict]]: + def introspect(self, data: Any) -> Tuple[List[ReAsk], Union[Dict, List, None]]: if isinstance(data, SkeletonReAsk): return [data], None elif isinstance(data, NonParseableReAsk): diff --git a/guardrails/utils/reask_utils.py b/guardrails/utils/reask_utils.py index d6a1a4faf..926eb7fd4 100644 --- a/guardrails/utils/reask_utils.py +++ b/guardrails/utils/reask_utils.py @@ -26,8 +26,8 @@ class NonParseableReAsk(ReAsk): def gather_reasks( - validated_output: Optional[Union[str, Dict, ReAsk]] -) -> Tuple[List[ReAsk], Optional[Dict]]: + validated_output: Optional[Union[str, Dict, List, ReAsk]] +) -> Tuple[List[ReAsk], Union[Dict, List, None]]: """Traverse output and gather all ReAsk objects. Args: