quantalogic 0.30.4__py3-none-any.whl → 0.30.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -83,28 +83,33 @@ class ToolManager(BaseModel):
83
83
  tool = self.tools[tool_name]
84
84
  converted = {}
85
85
 
86
- for arg in tool.arguments:
87
- if arg.name in kwargs:
88
- try:
89
- if arg.arg_type == "int":
90
- converted[arg.name] = int(kwargs[arg.name])
91
- elif arg.arg_type == "float":
92
- converted[arg.name] = float(kwargs[arg.name])
93
- elif arg.arg_type == "boolean":
94
- val = str(kwargs[arg.name]).lower()
95
- converted[arg.name] = val in ("true", "1", "yes", "y")
96
- else: # string
97
- converted[arg.name] = str(kwargs[arg.name])
98
- except (ValueError, TypeError) as e:
99
- if arg.required:
100
- raise ValueError(
101
- f"Failed to convert required argument '{arg.name}' to {arg.arg_type}: {str(e)}"
102
- )
103
- logger.warning(
104
- f"Failed to convert optional argument '{arg.name}' to {arg.arg_type}: {str(e)}"
86
+ for arg_name, arg_value in kwargs.items():
87
+ # Find the corresponding argument definition
88
+ arg = next((a for a in tool.arguments if a.name == arg_name), None)
89
+
90
+ if arg is None:
91
+ logger.warning(f"Argument '{arg_name}' not found in tool definition")
92
+ converted[arg_name] = arg_value
93
+ continue
94
+
95
+ try:
96
+ if arg.arg_type == "int":
97
+ converted[arg_name] = int(arg_value)
98
+ elif arg.arg_type == "float":
99
+ converted[arg_name] = float(arg_value)
100
+ elif arg.arg_type == "boolean":
101
+ val = str(arg_value).lower()
102
+ converted[arg_name] = val in ("true", "1", "yes", "y")
103
+ else: # string
104
+ converted[arg_name] = str(arg_value)
105
+ except (ValueError, TypeError) as e:
106
+ if arg.required:
107
+ raise ValueError(
108
+ f"Failed to convert required argument '{arg_name}' to {arg.arg_type}: {str(e)}"
105
109
  )
106
- converted[arg.name] = kwargs[arg.name] # keep original value
107
- elif arg.required and arg.default is None:
108
- raise ValueError(f"Missing required argument: {arg.name}")
109
-
110
+ logger.warning(f"Failed to convert optional argument '{arg_name}': {str(e)}")
111
+ converted[arg_name] = arg_value
112
+
113
+
114
+
110
115
  return converted
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: quantalogic
3
- Version: 0.30.4
3
+ Version: 0.30.6
4
4
  Summary: QuantaLogic ReAct Agents
5
5
  Author: Raphaël MANSUY
6
6
  Author-email: raphael.mansuy@gmail.com
@@ -25,7 +25,7 @@ quantalogic/server/static/js/quantalogic.js,sha256=x7TrlZGR1Y0WLK2DWl1xY847BhEWM
25
25
  quantalogic/server/templates/index.html,sha256=nDnXJoQEm1vXbhXtgaYk0G5VXj0wwzE6KrqEDhHFpj4,7773
26
26
  quantalogic/task_file_reader.py,sha256=AMIJoeVY9Hhu0dBJ-C5EyaOFsXLkhn2oBhVs-WTnnLk,1460
27
27
  quantalogic/task_runner.py,sha256=FtxfZs2dxdsSZoiW92K3dpfegFe0dyKx9ZP5CCyEAzo,9965
28
- quantalogic/tool_manager.py,sha256=ADFiKNdrRlvjJ5KPzaHy_agH34YYEsNAoFcmiy_mG3o,4280
28
+ quantalogic/tool_manager.py,sha256=G-vXDKgU1todhM1I1GHUrOfdBqnHDZvRIcExwaU7RcY,4293
29
29
  quantalogic/tools/__init__.py,sha256=pTirT5UBynuTkAzFYebu7ttGAMP3_A0idFvDp6lGZJQ,2146
30
30
  quantalogic/tools/agent_tool.py,sha256=MXCXxWHRch7VK4UWhtRP1jeI8Np9Ne2CUGo8vm1oZiM,3064
31
31
  quantalogic/tools/dalle_e.py,sha256=nur2kl6DKjaWWaHcmF_y9vS5bvty2fW8hQfdgf5KWfs,10948
@@ -85,8 +85,8 @@ quantalogic/version_check.py,sha256=cttR1lR3OienGLl7NrK1Te1fhDkqSjCci7HC1vFUTSY,
85
85
  quantalogic/welcome_message.py,sha256=IXMhem8h7srzNUwvw8G_lmEkHU8PFfote021E_BXmVk,3039
86
86
  quantalogic/xml_parser.py,sha256=uMLQNHTRCg116FwcjRoquZmSwVtE4LEH-6V2E3RD-dA,11466
87
87
  quantalogic/xml_tool_parser.py,sha256=Vz4LEgDbelJynD1siLOVkJ3gLlfHsUk65_gCwbYJyGc,3784
88
- quantalogic-0.30.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
89
- quantalogic-0.30.4.dist-info/METADATA,sha256=wRaHjvrZb_ekKujlzgFMCfM57UMGkoQ6BeonsSZnHZo,21722
90
- quantalogic-0.30.4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
91
- quantalogic-0.30.4.dist-info/entry_points.txt,sha256=h74O_Q3qBRCrDR99qvwB4BpBGzASPUIjCfxHq6Qnups,183
92
- quantalogic-0.30.4.dist-info/RECORD,,
88
+ quantalogic-0.30.6.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
89
+ quantalogic-0.30.6.dist-info/METADATA,sha256=Hfc9KLBE3r0KUwXfpEb25KCN3zWI-Fb9D6gRnt5xDHU,21722
90
+ quantalogic-0.30.6.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
91
+ quantalogic-0.30.6.dist-info/entry_points.txt,sha256=h74O_Q3qBRCrDR99qvwB4BpBGzASPUIjCfxHq6Qnups,183
92
+ quantalogic-0.30.6.dist-info/RECORD,,