diff --git a/opencontractserver/llms/tools/tool_factory.py b/opencontractserver/llms/tools/tool_factory.py index 9c7e93f4c..d60433b4d 100644 --- a/opencontractserver/llms/tools/tool_factory.py +++ b/opencontractserver/llms/tools/tool_factory.py @@ -175,15 +175,15 @@ def parameters(self) -> dict[str, Any]: # Try to infer type from annotation if param.annotation != inspect.Parameter.empty: - if param.annotation == int: + if param.annotation is int: param_info["type"] = "integer" - elif param.annotation == float: + elif param.annotation is float: param_info["type"] = "number" - elif param.annotation == bool: + elif param.annotation is bool: param_info["type"] = "boolean" - elif param.annotation == list: + elif param.annotation is list: param_info["type"] = "array" - elif param.annotation == dict: + elif param.annotation is dict: param_info["type"] = "object" properties[param_name] = param_info diff --git a/opencontractserver/pipeline/utils.py b/opencontractserver/pipeline/utils.py index 2ba07aa4a..11bb98b9d 100644 --- a/opencontractserver/pipeline/utils.py +++ b/opencontractserver/pipeline/utils.py @@ -444,7 +444,7 @@ def run_post_processors( processor_paths: list[str], zip_bytes: bytes, export_data: OpenContractsExportDataJsonPythonType, - input_kwargs: dict[str, Any] = {}, + input_kwargs: dict[str, Any] | None = None, ) -> tuple[bytes, OpenContractsExportDataJsonPythonType]: """ Load and run post-processors in sequence. @@ -459,6 +459,7 @@ def run_post_processors( - Modified zip bytes - Modified export data dictionary """ + input_kwargs = input_kwargs or {} current_zip_bytes = zip_bytes current_export_data = export_data