mbxai 0.6.24__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.24 → mbxai-0.6.25}/PKG-INFO +1 -1
  2. {mbxai-0.6.24 → mbxai-0.6.25}/pyproject.toml +1 -1
  3. {mbxai-0.6.24 → mbxai-0.6.25}/setup.py +1 -1
  4. {mbxai-0.6.24 → mbxai-0.6.25}/src/mbxai/__init__.py +1 -1
  5. {mbxai-0.6.24 → mbxai-0.6.25}/src/mbxai/mcp/server.py +1 -1
  6. {mbxai-0.6.24 → mbxai-0.6.25}/src/mbxai/tools/types.py +7 -17
  7. {mbxai-0.6.24 → mbxai-0.6.25}/uv.lock +1 -1
  8. {mbxai-0.6.24 → mbxai-0.6.25}/.gitignore +0 -0
  9. {mbxai-0.6.24 → mbxai-0.6.25}/LICENSE +0 -0
  10. {mbxai-0.6.24 → mbxai-0.6.25}/README.md +0 -0
  11. {mbxai-0.6.24 → mbxai-0.6.25}/src/mbxai/core.py +0 -0
  12. {mbxai-0.6.24 → mbxai-0.6.25}/src/mbxai/mcp/__init__.py +0 -0
  13. {mbxai-0.6.24 → mbxai-0.6.25}/src/mbxai/mcp/client.py +0 -0
  14. {mbxai-0.6.24 → mbxai-0.6.25}/src/mbxai/mcp/example.py +0 -0
  15. {mbxai-0.6.24 → mbxai-0.6.25}/src/mbxai/openrouter/__init__.py +0 -0
  16. {mbxai-0.6.24 → mbxai-0.6.25}/src/mbxai/openrouter/client.py +0 -0
  17. {mbxai-0.6.24 → mbxai-0.6.25}/src/mbxai/openrouter/config.py +0 -0
  18. {mbxai-0.6.24 → mbxai-0.6.25}/src/mbxai/openrouter/models.py +0 -0
  19. {mbxai-0.6.24 → mbxai-0.6.25}/src/mbxai/tools/__init__.py +0 -0
  20. {mbxai-0.6.24 → mbxai-0.6.25}/src/mbxai/tools/client.py +0 -0
  21. {mbxai-0.6.24 → mbxai-0.6.25}/src/mbxai/tools/example.py +0 -0
  22. {mbxai-0.6.24 → mbxai-0.6.25}/tests/test_core.py +0 -0
  23. {mbxai-0.6.24 → mbxai-0.6.25}/tests/test_mcp.py +0 -0
  24. {mbxai-0.6.24 → mbxai-0.6.25}/tests/test_openrouter.py +0 -0
  25. {mbxai-0.6.24 → 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.24
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.24"
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.24",
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.24"
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.24",
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
@@ -70,12 +65,10 @@ def convert_to_strict_schema(schema: dict[str, Any], strict: bool = True, keep_i
70
65
  }
71
66
 
72
67
  input_prop_schema["properties"][prop_name] = new_prop
73
- logger.info(f"Added property {prop_name}: {json.dumps(new_prop, indent=2)}")
74
68
 
75
69
  # Copy over required fields for input schema
76
70
  if "required" in input_schema:
77
71
  input_prop_schema["required"] = input_schema["required"]
78
- logger.info(f"Added required fields for input schema: {input_prop_schema['required']}")
79
72
 
80
73
  # Add the input property to the main schema
81
74
  strict_schema["properties"]["input"] = input_prop_schema
@@ -83,7 +76,6 @@ def convert_to_strict_schema(schema: dict[str, Any], strict: bool = True, keep_i
83
76
  # Copy over required fields for main schema
84
77
  if "required" in schema:
85
78
  strict_schema["required"] = schema["required"]
86
- logger.info(f"Added required fields for main schema: {strict_schema['required']}")
87
79
  else:
88
80
  # If not keeping input wrapper, use input schema directly
89
81
  if "properties" in input_schema:
@@ -95,12 +87,10 @@ def convert_to_strict_schema(schema: dict[str, Any], strict: bool = True, keep_i
95
87
  }
96
88
 
97
89
  strict_schema["properties"][prop_name] = new_prop
98
- logger.info(f"Added property {prop_name}: {json.dumps(new_prop, indent=2)}")
99
90
 
100
91
  # Copy over required fields
101
92
  if "required" in input_schema:
102
93
  strict_schema["required"] = input_schema["required"]
103
- logger.info(f"Added required fields: {strict_schema['required']}")
104
94
  else:
105
95
  # If no input wrapper, use the schema as is
106
96
  if "properties" in schema:
@@ -112,14 +102,11 @@ def convert_to_strict_schema(schema: dict[str, Any], strict: bool = True, keep_i
112
102
  }
113
103
 
114
104
  strict_schema["properties"][prop_name] = new_prop
115
- logger.info(f"Added property {prop_name}: {json.dumps(new_prop, indent=2)}")
116
105
 
117
106
  # Copy over required fields
118
107
  if "required" in schema:
119
108
  strict_schema["required"] = schema["required"]
120
- logger.info(f"Added required fields: {strict_schema['required']}")
121
109
 
122
- logger.info(f"Final strict schema: {json.dumps(strict_schema, indent=2)}")
123
110
  return strict_schema
124
111
 
125
112
  class ToolCall(BaseModel):
@@ -139,13 +126,16 @@ class Tool(BaseModel):
139
126
  """Convert the tool to an OpenAI function definition."""
140
127
  # Ensure schema is in strict format
141
128
  strict_schema = convert_to_strict_schema(self.schema)
142
- logger.info(f"Converted schema for {self.name}: {json.dumps(strict_schema, indent=2)}")
143
129
 
144
- return {
130
+ function_def = {
145
131
  "type": "function",
146
132
  "function": {
147
133
  "name": self.name,
148
134
  "description": self.description,
149
- "parameters": strict_schema
135
+ "parameters": strict_schema,
136
+ "strict": True
150
137
  }
151
- }
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.24"
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