mbxai 0.6.20__tar.gz → 0.6.22__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.
- {mbxai-0.6.20 → mbxai-0.6.22}/PKG-INFO +1 -1
- {mbxai-0.6.20 → mbxai-0.6.22}/pyproject.toml +1 -1
- {mbxai-0.6.20 → mbxai-0.6.22}/setup.py +1 -1
- {mbxai-0.6.20 → mbxai-0.6.22}/src/mbxai/__init__.py +1 -1
- {mbxai-0.6.20 → mbxai-0.6.22}/src/mbxai/mcp/client.py +1 -0
- {mbxai-0.6.20 → mbxai-0.6.22}/src/mbxai/mcp/server.py +1 -1
- {mbxai-0.6.20 → mbxai-0.6.22}/src/mbxai/tools/types.py +2 -7
- {mbxai-0.6.20 → mbxai-0.6.22}/uv.lock +1 -1
- {mbxai-0.6.20 → mbxai-0.6.22}/.gitignore +0 -0
- {mbxai-0.6.20 → mbxai-0.6.22}/LICENSE +0 -0
- {mbxai-0.6.20 → mbxai-0.6.22}/README.md +0 -0
- {mbxai-0.6.20 → mbxai-0.6.22}/src/mbxai/core.py +0 -0
- {mbxai-0.6.20 → mbxai-0.6.22}/src/mbxai/mcp/__init__.py +0 -0
- {mbxai-0.6.20 → mbxai-0.6.22}/src/mbxai/mcp/example.py +0 -0
- {mbxai-0.6.20 → mbxai-0.6.22}/src/mbxai/openrouter/__init__.py +0 -0
- {mbxai-0.6.20 → mbxai-0.6.22}/src/mbxai/openrouter/client.py +0 -0
- {mbxai-0.6.20 → mbxai-0.6.22}/src/mbxai/openrouter/config.py +0 -0
- {mbxai-0.6.20 → mbxai-0.6.22}/src/mbxai/openrouter/models.py +0 -0
- {mbxai-0.6.20 → mbxai-0.6.22}/src/mbxai/tools/__init__.py +0 -0
- {mbxai-0.6.20 → mbxai-0.6.22}/src/mbxai/tools/client.py +0 -0
- {mbxai-0.6.20 → mbxai-0.6.22}/src/mbxai/tools/example.py +0 -0
- {mbxai-0.6.20 → mbxai-0.6.22}/tests/test_core.py +0 -0
- {mbxai-0.6.20 → mbxai-0.6.22}/tests/test_mcp.py +0 -0
- {mbxai-0.6.20 → mbxai-0.6.22}/tests/test_openrouter.py +0 -0
- {mbxai-0.6.20 → mbxai-0.6.22}/tests/test_tools.py +0 -0
@@ -20,6 +20,7 @@ class MCPTool(Tool):
|
|
20
20
|
input_schema: dict[str, Any]
|
21
21
|
internal_url: str
|
22
22
|
strict: bool = True
|
23
|
+
function: Callable[..., Any] | None = None # Make function optional during initialization
|
23
24
|
|
24
25
|
def to_openai_function(self) -> dict[str, Any]:
|
25
26
|
"""Convert the tool to an OpenAI function definition."""
|
@@ -61,17 +61,12 @@ def convert_to_strict_schema(schema: dict[str, Any], strict: bool = True) -> dic
|
|
61
61
|
# Copy over input properties
|
62
62
|
if "properties" in input_schema:
|
63
63
|
for prop_name, prop in input_schema["properties"].items():
|
64
|
-
# Create a new property object with
|
64
|
+
# Create a new property object with only allowed fields
|
65
65
|
new_prop = {
|
66
66
|
"type": prop.get("type", "string"),
|
67
67
|
"description": prop.get("description", f"The {prop_name} parameter")
|
68
68
|
}
|
69
69
|
|
70
|
-
# Copy over any additional fields that might be useful
|
71
|
-
for key, value in prop.items():
|
72
|
-
if key not in new_prop:
|
73
|
-
new_prop[key] = value
|
74
|
-
|
75
70
|
input_prop_schema["properties"][prop_name] = new_prop
|
76
71
|
logger.info(f"Added property {prop_name}: {json.dumps(new_prop, indent=2)}")
|
77
72
|
|
@@ -101,7 +96,7 @@ class Tool(BaseModel):
|
|
101
96
|
"""A tool that can be used by the model."""
|
102
97
|
name: str
|
103
98
|
description: str
|
104
|
-
function: Callable[..., Any]
|
99
|
+
function: Callable[..., Any] | None = None # Make function optional
|
105
100
|
schema: dict[str, Any]
|
106
101
|
|
107
102
|
def to_openai_function(self) -> dict[str, Any]:
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|