mbxai 2.0.3__py3-none-any.whl → 2.0.4__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/__init__.py CHANGED
@@ -7,7 +7,7 @@ from .openrouter import OpenRouterClient
7
7
  from .tools import ToolClient
8
8
  from .mcp import MCPClient
9
9
 
10
- __version__ = "2.0.3"
10
+ __version__ = "2.0.4"
11
11
 
12
12
  __all__ = [
13
13
  "AgentClient",
mbxai/agent/client.py CHANGED
@@ -190,6 +190,12 @@ Understand this prompt and what the user wants to achieve by it:
190
190
  Think about useful steps and which information are required for it. First ask for required information and details to improve that process, when that is useful for the given case. When it's not useful, return an empty list of questions.
191
191
  Use available tools to gather information or perform actions that would improve your response.
192
192
  Analyze the prompt carefully and determine if additional information would significantly improve the quality of the response. Only ask questions that are truly necessary and would materially impact the outcome.
193
+
194
+ IMPORTANT: For each question, provide a technical key identifier that:
195
+ - Uses only alphanumeric characters and underscores
196
+ - Starts with a letter
197
+ - Is descriptive but concise (e.g., "user_name", "email_address", "preferred_genre", "budget_range")
198
+ - Contains no spaces, hyphens, or special characters like ?, !, @, etc.
193
199
  """
194
200
 
195
201
  messages = [{"role": "user", "content": questions_prompt}]
mbxai/agent/models.py CHANGED
@@ -3,15 +3,37 @@ Pydantic models for the agent client.
3
3
  """
4
4
 
5
5
  from typing import Any, Optional
6
- from pydantic import BaseModel, Field
6
+ from pydantic import BaseModel, Field, field_validator
7
7
  import uuid
8
+ import re
8
9
 
9
10
 
10
11
  class Question(BaseModel):
11
12
  """A question for the user to provide more information."""
12
13
  question: str = Field(description="The question to ask the user")
13
- key: str = Field(description="A unique and short technical key identifier to identify this question don't use spaces or special characters")
14
+ key: str = Field(description="A unique and short technical key identifier using only alphanumeric characters and underscores (e.g., user_name, email_address, age)")
14
15
  required: bool = Field(default=True, description="Whether this question is required")
16
+
17
+ @field_validator('key')
18
+ @classmethod
19
+ def validate_key(cls, v: str) -> str:
20
+ """Ensure the key contains only alphanumeric characters and underscores."""
21
+ if not re.match(r'^[a-zA-Z][a-zA-Z0-9_]*$', v):
22
+ # Convert invalid key to valid format
23
+ # Remove special characters and replace spaces with underscores
24
+ cleaned = re.sub(r'[^a-zA-Z0-9_]', '_', v)
25
+ # Ensure it starts with a letter
26
+ if not cleaned or not cleaned[0].isalpha():
27
+ cleaned = 'key_' + cleaned
28
+ # Remove consecutive underscores
29
+ cleaned = re.sub(r'_+', '_', cleaned)
30
+ # Remove trailing underscores
31
+ cleaned = cleaned.rstrip('_')
32
+ # Ensure it's not empty
33
+ if not cleaned:
34
+ cleaned = 'key'
35
+ return cleaned
36
+ return v
15
37
 
16
38
 
17
39
  class Result(BaseModel):
mbxai/mcp/server.py CHANGED
@@ -31,7 +31,7 @@ class MCPServer:
31
31
  self.app = FastAPI(
32
32
  title=self.name,
33
33
  description=self.description,
34
- version="2.0.3",
34
+ version="2.0.4",
35
35
  )
36
36
 
37
37
  # Initialize MCP server
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mbxai
3
- Version: 2.0.3
3
+ Version: 2.0.4
4
4
  Summary: MBX AI SDK
5
5
  Project-URL: Homepage, https://www.mibexx.de
6
6
  Project-URL: Documentation, https://www.mibexx.de
@@ -1,8 +1,8 @@
1
- mbxai/__init__.py,sha256=MdEVRprKcXX-BOYFC6PqE2VHCJoZwSIxMvdu8hSTqyM,407
1
+ mbxai/__init__.py,sha256=tQvBc7DtUU3Y8uBqWgt8a89YWskLrhWMzhuEpFHbtEs,407
2
2
  mbxai/core.py,sha256=WMvmU9TTa7M_m-qWsUew4xH8Ul6xseCZ2iBCXJTW-Bs,196
3
3
  mbxai/agent/__init__.py,sha256=5j3mW2NZtAU1s2w8n833axWBQsxW8U0qKwoQ9JtQZ4k,289
4
- mbxai/agent/client.py,sha256=wMgFu_sSkMDx9THemsNmvGZZ3dViJkvOS0p0XrcvKn8,18047
5
- mbxai/agent/models.py,sha256=Mo-bfH6eLVmzws60SYgSqbvnEBkb51T9eG-Fj2HBR18,2217
4
+ mbxai/agent/client.py,sha256=Gpu3B8NeBSuZeSx-pjvhvCv-yntzvbwFaYpVVwHASFc,18367
5
+ mbxai/agent/models.py,sha256=0IYhO2jO40ydpFwuZewZa11Pbd5NXqdofCKmMKGmKc8,3144
6
6
  mbxai/examples/agent_example.py,sha256=uECWy8QX1IhJMVcdw6EJy6sLcvO8vKgEF_YHJOhZO6Y,5947
7
7
  mbxai/examples/agent_iterations_example.py,sha256=xMqZhBWS67EkRkArjOAY2fCgLkQ32Qn9E4CSfEKW4MU,7905
8
8
  mbxai/examples/agent_tool_registration_example.py,sha256=oWm0-d4mdba-VQ3HobiCIR0IHtEDCtJenb8Lnm9QqCw,9108
@@ -21,7 +21,7 @@ mbxai/examples/mcp/mcp_server_example.py,sha256=nFfg22Jnc6HMW_ezLO3So1xwDdx2_rIt
21
21
  mbxai/mcp/__init__.py,sha256=_ek9iYdYqW5saKetj4qDci11jxesQDiHPJRpHMKkxgU,175
22
22
  mbxai/mcp/client.py,sha256=QRzId6o4_WRWVv3rtm8cfZZGaoY_UlaOO-oqNjY-tmw,5219
23
23
  mbxai/mcp/example.py,sha256=oaol7AvvZnX86JWNz64KvPjab5gg1VjVN3G8eFSzuaE,2350
24
- mbxai/mcp/server.py,sha256=eZZQXo4xJSzDbhOVWyUHi9BJi3weldlxjvQptel7J3A,3332
24
+ mbxai/mcp/server.py,sha256=dDU425A2ufXsjMbYuOH-KZVjCRUyNR716DRREGRfGwc,3332
25
25
  mbxai/openrouter/__init__.py,sha256=Ito9Qp_B6q-RLGAQcYyTJVWwR2YAZvNqE-HIYXxhtD8,298
26
26
  mbxai/openrouter/client.py,sha256=3LD6WDJ8wjo_nefH5d1NJCsrWPvBc_KBf2NsItUoSt8,18302
27
27
  mbxai/openrouter/config.py,sha256=Ia93s-auim9Sq71eunVDbn9ET5xX2zusXpV4JBdHAzs,3251
@@ -31,7 +31,7 @@ mbxai/tools/__init__.py,sha256=ogxrHvgJ7OR62Lmd5x9Eh5d2C0jqWyQis7Zy3yKpZ78,218
31
31
  mbxai/tools/client.py,sha256=2wFPD-UN3Y2DSyrnqxt2vvFgTYHzUl14_y0r6fhAWmM,17198
32
32
  mbxai/tools/example.py,sha256=1HgKK39zzUuwFbnp3f0ThyWVfA_8P28PZcTwaUw5K78,2232
33
33
  mbxai/tools/types.py,sha256=OFfM7scDGTm4FOcJA2ecj-fxL1MEBkqPsT3hqCL1Jto,9505
34
- mbxai-2.0.3.dist-info/METADATA,sha256=9Azd_uWgRny0XZ9EY21rO9GiJJNzVp8aUQ-xn6QBN2w,10018
35
- mbxai-2.0.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
36
- mbxai-2.0.3.dist-info/licenses/LICENSE,sha256=hEyhc4FxwYo3NQ40yNgZ7STqwVk-1_XcTXOnAPbGJAw,1069
37
- mbxai-2.0.3.dist-info/RECORD,,
34
+ mbxai-2.0.4.dist-info/METADATA,sha256=0EqHKwLFaFtmBBXTZRWFEsxQJJmu2TS_32UpSVQm7J8,10018
35
+ mbxai-2.0.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
36
+ mbxai-2.0.4.dist-info/licenses/LICENSE,sha256=hEyhc4FxwYo3NQ40yNgZ7STqwVk-1_XcTXOnAPbGJAw,1069
37
+ mbxai-2.0.4.dist-info/RECORD,,
File without changes