diff --git a/src/mistralai/extra/utils/_pydantic_helper.py b/src/mistralai/extra/utils/_pydantic_helper.py index 08523f41..f042c394 100644 --- a/src/mistralai/extra/utils/_pydantic_helper.py +++ b/src/mistralai/extra/utils/_pydantic_helper.py @@ -1,11 +1,12 @@ from typing import Any + def rec_strict_json_schema(schema_node: Any) -> Any: """ Recursively set the additionalProperties property to False for all objects in the JSON Schema. This makes the JSON Schema strict (i.e. no additional properties are allowed). """ - if isinstance(schema_node, (str, bool)): + if isinstance(schema_node, (str, bool)) or schema_node is None: return schema_node if isinstance(schema_node, dict): if "type" in schema_node and schema_node["type"] == "object":