From 1a2e5a0cb0eed76314e430cea49ba4e0e73b78f3 Mon Sep 17 00:00:00 2001 From: Franz Louis Cesista Date: Sat, 4 May 2024 16:45:08 +0800 Subject: [PATCH] fix typing to support python versions < 3.9 --- outlines/fsm/json_schema.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/outlines/fsm/json_schema.py b/outlines/fsm/json_schema.py index 91f3ac7b6..04d16d672 100644 --- a/outlines/fsm/json_schema.py +++ b/outlines/fsm/json_schema.py @@ -2,7 +2,7 @@ import json import re from copy import deepcopy -from typing import Callable, Optional +from typing import Callable, List, Optional from jsonschema.protocols import Validator from pydantic import create_model @@ -106,7 +106,7 @@ def _is_null_type(instance: dict): return False -def _has_null_type(instance_list: list[dict]): +def _has_null_type(instance_list: List[dict]): for instance in instance_list: if _is_null_type(instance): return True