Repository: huggingface/transformers
Issue category: Feature Request

Issue:
Boolean as tool input
### Feature request

It would be great if `boolean` was authorized as input to a `Tool`

### Motivation

I am willing to use my own tools with transformers CodeAgent ; using the method `tool`
I have a proper function `func` with typing and doc-strings as required. One of the input of the function is a `bool`.
When I try to run `tool(func)` I get: `Exception: Input 'perte_de_salaire': type 'boolean' is not an authorized value, should be one of ['string', 'integer', 'number', 'image', 'audio', 'any']`.

The Exception is rather clear, but why wouldn't a type as basic as `boolean` not be allowed? Especially since any is authorized. This is clearly a limitation to using the library.

### Your contribution

I seems like a few lines of code to change in tools.py (https://github.com/huggingface/transformers/blob/main/src/transformers/agents/tools.py)


Hints:
cc @aymeric-roucher 
Please assign this to me

Patch:
diff --git a/src/transformers/agents/tools.py b/src/transformers/agents/tools.py
index cfb1e4cf95ced9..a425ffc8f106b2 100644
--- a/src/transformers/agents/tools.py
+++ b/src/transformers/agents/tools.py
@@ -138,7 +138,7 @@ def validate_arguments(self):
             "inputs": Dict,
             "output_type": str,
         }
-        authorized_types = ["string", "integer", "number", "image", "audio", "any"]
+        authorized_types = ["string", "integer", "number", "image", "audio", "any", "boolean"]
 
         for attr, expected_type in required_attributes.items():
             attr_value = getattr(self, attr, None)


Test patch: