mbxai 0.6.23__tar.gz → 0.6.25__tar.gz

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.
Files changed (25) hide show
  1. {mbxai-0.6.23 → mbxai-0.6.25}/PKG-INFO +1 -1
  2. {mbxai-0.6.23 → mbxai-0.6.25}/pyproject.toml +1 -1
  3. {mbxai-0.6.23 → mbxai-0.6.25}/setup.py +1 -1
  4. {mbxai-0.6.23 → mbxai-0.6.25}/src/mbxai/__init__.py +1 -1
  5. {mbxai-0.6.23 → mbxai-0.6.25}/src/mbxai/mcp/server.py +1 -1
  6. {mbxai-0.6.23 → mbxai-0.6.25}/src/mbxai/tools/types.py +10 -35
  7. {mbxai-0.6.23 → mbxai-0.6.25}/uv.lock +1 -1
  8. {mbxai-0.6.23 → mbxai-0.6.25}/.gitignore +0 -0
  9. {mbxai-0.6.23 → mbxai-0.6.25}/LICENSE +0 -0
  10. {mbxai-0.6.23 → mbxai-0.6.25}/README.md +0 -0
  11. {mbxai-0.6.23 → mbxai-0.6.25}/src/mbxai/core.py +0 -0
  12. {mbxai-0.6.23 → mbxai-0.6.25}/src/mbxai/mcp/__init__.py +0 -0
  13. {mbxai-0.6.23 → mbxai-0.6.25}/src/mbxai/mcp/client.py +0 -0
  14. {mbxai-0.6.23 → mbxai-0.6.25}/src/mbxai/mcp/example.py +0 -0
  15. {mbxai-0.6.23 → mbxai-0.6.25}/src/mbxai/openrouter/__init__.py +0 -0
  16. {mbxai-0.6.23 → mbxai-0.6.25}/src/mbxai/openrouter/client.py +0 -0
  17. {mbxai-0.6.23 → mbxai-0.6.25}/src/mbxai/openrouter/config.py +0 -0
  18. {mbxai-0.6.23 → mbxai-0.6.25}/src/mbxai/openrouter/models.py +0 -0
  19. {mbxai-0.6.23 → mbxai-0.6.25}/src/mbxai/tools/__init__.py +0 -0
  20. {mbxai-0.6.23 → mbxai-0.6.25}/src/mbxai/tools/client.py +0 -0
  21. {mbxai-0.6.23 → mbxai-0.6.25}/src/mbxai/tools/example.py +0 -0
  22. {mbxai-0.6.23 → mbxai-0.6.25}/tests/test_core.py +0 -0
  23. {mbxai-0.6.23 → mbxai-0.6.25}/tests/test_mcp.py +0 -0
  24. {mbxai-0.6.23 → mbxai-0.6.25}/tests/test_openrouter.py +0 -0
  25. {mbxai-0.6.23 → mbxai-0.6.25}/tests/test_tools.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mbxai
3
- Version: 0.6.23
3
+ Version: 0.6.25
4
4
  Summary: MBX AI SDK
5
5
  Project-URL: Homepage, https://www.mibexx.de
6
6
  Project-URL: Documentation, https://www.mibexx.de
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "mbxai"
7
- version = "0.6.23"
7
+ version = "0.6.25"
8
8
  authors = [
9
9
  { name = "MBX AI" }
10
10
  ]
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="mbxai",
5
- version="0.6.23",
5
+ version="0.6.25",
6
6
  author="MBX AI",
7
7
  description="MBX AI SDK",
8
8
  long_description=open("README.md").read(),
@@ -2,4 +2,4 @@
2
2
  MBX AI package.
3
3
  """
4
4
 
5
- __version__ = "0.6.23"
5
+ __version__ = "0.6.25"
@@ -31,7 +31,7 @@ class MCPServer:
31
31
  self.app = FastAPI(
32
32
  title=self.name,
33
33
  description=self.description,
34
- version="0.6.23",
34
+ version="0.6.25",
35
35
  )
36
36
 
37
37
  # Initialize MCP server
@@ -20,9 +20,6 @@ def convert_to_strict_schema(schema: dict[str, Any], strict: bool = True, keep_i
20
20
  Returns:
21
21
  A schema in strict format
22
22
  """
23
- logger.info(f"Converting schema to strict format. Input schema: {json.dumps(schema, indent=2)}")
24
- logger.info(f"Strict mode: {strict}, Keep input wrapper: {keep_input_wrapper}")
25
-
26
23
  if not schema:
27
24
  return {"type": "object", "properties": {}, "required": []}
28
25
 
@@ -40,13 +37,11 @@ def convert_to_strict_schema(schema: dict[str, Any], strict: bool = True, keep_i
40
37
  # Handle input wrapper
41
38
  if "properties" in schema and "input" in schema["properties"]:
42
39
  input_schema = schema["properties"]["input"]
43
- logger.info(f"Found input wrapper. Input schema: {json.dumps(input_schema, indent=2)}")
44
40
 
45
41
  # If input has a $ref, resolve it
46
42
  if "$ref" in input_schema:
47
43
  ref = input_schema["$ref"].split("/")[-1]
48
44
  input_schema = schema.get("$defs", {}).get(ref, {})
49
- logger.info(f"Resolved $ref to: {json.dumps(input_schema, indent=2)}")
50
45
 
51
46
  if keep_input_wrapper:
52
47
  # Create the input property schema
@@ -63,24 +58,17 @@ def convert_to_strict_schema(schema: dict[str, Any], strict: bool = True, keep_i
63
58
  # Copy over input properties
64
59
  if "properties" in input_schema:
65
60
  for prop_name, prop in input_schema["properties"].items():
66
- # Create a new property object with required fields
61
+ # Create a new property object with only allowed fields
67
62
  new_prop = {
68
63
  "type": prop.get("type", "string"),
69
64
  "description": prop.get("description", f"The {prop_name} parameter")
70
65
  }
71
66
 
72
- # Copy over any additional fields that might be useful
73
- for key, value in prop.items():
74
- if key not in new_prop:
75
- new_prop[key] = value
76
-
77
67
  input_prop_schema["properties"][prop_name] = new_prop
78
- logger.info(f"Added property {prop_name}: {json.dumps(new_prop, indent=2)}")
79
68
 
80
69
  # Copy over required fields for input schema
81
70
  if "required" in input_schema:
82
71
  input_prop_schema["required"] = input_schema["required"]
83
- logger.info(f"Added required fields for input schema: {input_prop_schema['required']}")
84
72
 
85
73
  # Add the input property to the main schema
86
74
  strict_schema["properties"]["input"] = input_prop_schema
@@ -88,53 +76,37 @@ def convert_to_strict_schema(schema: dict[str, Any], strict: bool = True, keep_i
88
76
  # Copy over required fields for main schema
89
77
  if "required" in schema:
90
78
  strict_schema["required"] = schema["required"]
91
- logger.info(f"Added required fields for main schema: {strict_schema['required']}")
92
79
  else:
93
80
  # If not keeping input wrapper, use input schema directly
94
81
  if "properties" in input_schema:
95
82
  for prop_name, prop in input_schema["properties"].items():
96
- # Create a new property object with required fields
83
+ # Create a new property object with only allowed fields
97
84
  new_prop = {
98
85
  "type": prop.get("type", "string"),
99
86
  "description": prop.get("description", f"The {prop_name} parameter")
100
87
  }
101
88
 
102
- # Copy over any additional fields that might be useful
103
- for key, value in prop.items():
104
- if key not in new_prop:
105
- new_prop[key] = value
106
-
107
89
  strict_schema["properties"][prop_name] = new_prop
108
- logger.info(f"Added property {prop_name}: {json.dumps(new_prop, indent=2)}")
109
90
 
110
91
  # Copy over required fields
111
92
  if "required" in input_schema:
112
93
  strict_schema["required"] = input_schema["required"]
113
- logger.info(f"Added required fields: {strict_schema['required']}")
114
94
  else:
115
95
  # If no input wrapper, use the schema as is
116
96
  if "properties" in schema:
117
97
  for prop_name, prop in schema["properties"].items():
118
- # Create a new property object with required fields
98
+ # Create a new property object with only allowed fields
119
99
  new_prop = {
120
100
  "type": prop.get("type", "string"),
121
101
  "description": prop.get("description", f"The {prop_name} parameter")
122
102
  }
123
103
 
124
- # Copy over any additional fields that might be useful
125
- for key, value in prop.items():
126
- if key not in new_prop:
127
- new_prop[key] = value
128
-
129
104
  strict_schema["properties"][prop_name] = new_prop
130
- logger.info(f"Added property {prop_name}: {json.dumps(new_prop, indent=2)}")
131
105
 
132
106
  # Copy over required fields
133
107
  if "required" in schema:
134
108
  strict_schema["required"] = schema["required"]
135
- logger.info(f"Added required fields: {strict_schema['required']}")
136
109
 
137
- logger.info(f"Final strict schema: {json.dumps(strict_schema, indent=2)}")
138
110
  return strict_schema
139
111
 
140
112
  class ToolCall(BaseModel):
@@ -154,13 +126,16 @@ class Tool(BaseModel):
154
126
  """Convert the tool to an OpenAI function definition."""
155
127
  # Ensure schema is in strict format
156
128
  strict_schema = convert_to_strict_schema(self.schema)
157
- logger.info(f"Converted schema for {self.name}: {json.dumps(strict_schema, indent=2)}")
158
129
 
159
- return {
130
+ function_def = {
160
131
  "type": "function",
161
132
  "function": {
162
133
  "name": self.name,
163
134
  "description": self.description,
164
- "parameters": strict_schema
135
+ "parameters": strict_schema,
136
+ "strict": True
165
137
  }
166
- }
138
+ }
139
+
140
+ logger.info(f"Created function definition for {self.name}: {json.dumps(function_def, indent=2)}")
141
+ return function_def
@@ -446,7 +446,7 @@ wheels = [
446
446
 
447
447
  [[package]]
448
448
  name = "mbxai"
449
- version = "0.6.23"
449
+ version = "0.6.25"
450
450
  source = { editable = "." }
451
451
  dependencies = [
452
452
  { name = "fastapi" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes