mbxai 0.6.15__py3-none-any.whl → 0.6.16__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.
mbxai/tools/types.py CHANGED
@@ -54,21 +54,42 @@ class Tool(BaseModel):
54
54
  input_schema = schema.get("$defs", {}).get(ref, {})
55
55
  schema = input_schema
56
56
 
57
- # Ensure required fields are present
58
- if "type" not in schema:
59
- schema["type"] = "object"
60
-
61
- if "properties" not in schema:
62
- schema["properties"] = {}
63
-
64
- if "required" not in schema:
65
- schema["required"] = []
57
+ # Create a new schema object to ensure we have all required fields
58
+ strict_schema = {
59
+ "type": "object",
60
+ "properties": {},
61
+ "required": []
62
+ }
63
+
64
+ # Copy over properties, ensuring each has type and description
65
+ if "properties" in schema:
66
+ for prop_name, prop in schema["properties"].items():
67
+ # Create a new property object with required fields
68
+ new_prop = {
69
+ "type": prop.get("type", "string"),
70
+ "description": prop.get("description", f"The {prop_name} parameter")
71
+ }
72
+
73
+ # Copy over any additional fields that might be useful
74
+ for key, value in prop.items():
75
+ if key not in new_prop:
76
+ new_prop[key] = value
77
+
78
+ strict_schema["properties"][prop_name] = new_prop
79
+
80
+ # Copy over required fields
81
+ if "required" in schema:
82
+ strict_schema["required"] = schema["required"]
83
+
84
+ # Ensure all required fields are actually in properties
85
+ strict_schema["required"] = [
86
+ req for req in strict_schema["required"]
87
+ if req in strict_schema["properties"]
88
+ ]
66
89
 
67
- # Ensure all properties have type and description
68
- for prop_name, prop in schema["properties"].items():
69
- if "type" not in prop:
70
- prop["type"] = "string" # Default to string if type not specified
71
- if "description" not in prop:
72
- prop["description"] = f"The {prop_name} parameter"
90
+ # Add any additional fields from the original schema
91
+ for key, value in schema.items():
92
+ if key not in strict_schema:
93
+ strict_schema[key] = value
73
94
 
74
- return schema
95
+ return strict_schema
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mbxai
3
- Version: 0.6.15
3
+ Version: 0.6.16
4
4
  Summary: MBX AI SDK
5
5
  Project-URL: Homepage, https://www.mibexx.de
6
6
  Project-URL: Documentation, https://www.mibexx.de
@@ -11,8 +11,8 @@ mbxai/openrouter/models.py,sha256=b3IjjtZAjeGOf2rLsdnCD1HacjTnS8jmv_ZXorc-KJQ,26
11
11
  mbxai/tools/__init__.py,sha256=QUFaXhDm-UKcuAtT1rbKzhBkvyRBVokcQIOf9cxIuwc,160
12
12
  mbxai/tools/client.py,sha256=qOf8MiQ8_flPUNiMioOyjeEaV8rN1EBWb98T8qTC3D4,17582
13
13
  mbxai/tools/example.py,sha256=1HgKK39zzUuwFbnp3f0ThyWVfA_8P28PZcTwaUw5K78,2232
14
- mbxai/tools/types.py,sha256=Fcr0ivzz2Lt_XatKvG9lCWnlj0OVdRsfZ9YYcQUZebU,2401
15
- mbxai-0.6.15.dist-info/METADATA,sha256=Oo-b9zXrMAWxuesfFqXW2JpieyVfyCO9Wh12v0YA5kI,4108
16
- mbxai-0.6.15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
17
- mbxai-0.6.15.dist-info/licenses/LICENSE,sha256=hEyhc4FxwYo3NQ40yNgZ7STqwVk-1_XcTXOnAPbGJAw,1069
18
- mbxai-0.6.15.dist-info/RECORD,,
14
+ mbxai/tools/types.py,sha256=pFSV59rebWASnIQb27wVg1kFYbCGZmPlOjrLNfNuvrc,3245
15
+ mbxai-0.6.16.dist-info/METADATA,sha256=d9Bpi8hqAYZZRz301NfXWU7A-50ZWSZqMTfbxvcMUbw,4108
16
+ mbxai-0.6.16.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
17
+ mbxai-0.6.16.dist-info/licenses/LICENSE,sha256=hEyhc4FxwYo3NQ40yNgZ7STqwVk-1_XcTXOnAPbGJAw,1069
18
+ mbxai-0.6.16.dist-info/RECORD,,
File without changes