mbxai 0.8.1__tar.gz → 0.8.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mbxai
3
- Version: 0.8.1
3
+ Version: 0.8.2
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.8.1"
7
+ version = "0.8.2"
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.8.1",
5
+ version="0.8.2",
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.8.1"
5
+ __version__ = "0.8.2"
@@ -3,7 +3,6 @@
3
3
  from typing import Any, TypeVar, Callable
4
4
  import httpx
5
5
  import logging
6
- import asyncio
7
6
  import json
8
7
  from pydantic import BaseModel, Field
9
8
 
@@ -48,15 +47,15 @@ class MCPClient(ToolClient):
48
47
  """Initialize the MCP client."""
49
48
  super().__init__(openrouter_client)
50
49
  self._mcp_servers: dict[str, str] = {}
51
- self._http_client = httpx.AsyncClient()
50
+ self._http_client = httpx.Client()
52
51
 
53
- async def __aenter__(self):
54
- """Enter the async context."""
52
+ def __enter__(self):
53
+ """Enter the context."""
55
54
  return self
56
55
 
57
- async def __aexit__(self, exc_type, exc_val, exc_tb):
58
- """Exit the async context."""
59
- await self._http_client.aclose()
56
+ def __exit__(self, exc_type, exc_val, exc_tb):
57
+ """Exit the context."""
58
+ self._http_client.close()
60
59
 
61
60
  def _create_tool_function(self, tool: MCPTool) -> Callable[..., Any]:
62
61
  """Create a function that invokes an MCP tool."""
@@ -96,12 +95,12 @@ class MCPClient(ToolClient):
96
95
 
97
96
  return tool_function
98
97
 
99
- async def register_mcp_server(self, name: str, base_url: str) -> None:
98
+ def register_mcp_server(self, name: str, base_url: str) -> None:
100
99
  """Register an MCP server and load its tools."""
101
100
  self._mcp_servers[name] = base_url.rstrip("/")
102
101
 
103
102
  # Fetch tools from the server
104
- response = await self._http_client.get(f"{base_url}/tools")
103
+ response = self._http_client.get(f"{base_url}/tools")
105
104
  response_data = response.json()
106
105
 
107
106
  # Extract tools array from response
@@ -31,7 +31,7 @@ class MCPServer:
31
31
  self.app = FastAPI(
32
32
  title=self.name,
33
33
  description=self.description,
34
- version="0.8.1",
34
+ version="0.8.2",
35
35
  )
36
36
 
37
37
  # Initialize MCP server
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