mbxai 2.0.3__tar.gz → 2.0.4__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-2.0.3 → mbxai-2.0.4}/PKG-INFO +1 -1
- {mbxai-2.0.3 → mbxai-2.0.4}/pyproject.toml +2 -2
- {mbxai-2.0.3 → mbxai-2.0.4}/setup.py +1 -1
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/__init__.py +1 -1
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/agent/client.py +6 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/agent/models.py +24 -2
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/mcp/server.py +1 -1
- {mbxai-2.0.3 → mbxai-2.0.4}/.gitignore +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/LICENSE +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/README.md +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/agent/__init__.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/core.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/examples/agent_example.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/examples/agent_iterations_example.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/examples/agent_tool_registration_example.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/examples/agent_validation_example.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/examples/auto_schema_example.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/examples/mcp/mcp_client_example.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/examples/mcp/mcp_server_example.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/examples/openrouter_example.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/examples/parse_example.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/examples/parse_tool_example.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/examples/request.json +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/examples/response.json +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/examples/send_request.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/examples/simple_agent_test.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/examples/tool_client_example.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/mcp/__init__.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/mcp/client.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/mcp/example.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/openrouter/__init__.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/openrouter/client.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/openrouter/config.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/openrouter/models.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/openrouter/schema.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/tools/__init__.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/tools/client.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/tools/example.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/src/mbxai/tools/types.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/tests/test_mcp_tool_registration.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/tests/test_real_mcp_schema.py +0 -0
- {mbxai-2.0.3 → mbxai-2.0.4}/tests/test_schema_conversion.py +0 -0
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "mbxai"
|
7
|
-
version = "2.0.
|
7
|
+
version = "2.0.4"
|
8
8
|
authors = [
|
9
9
|
{ name = "MBX AI" }
|
10
10
|
]
|
@@ -82,6 +82,6 @@ strict_equality = true
|
|
82
82
|
|
83
83
|
[dependency-groups]
|
84
84
|
dev = [
|
85
|
-
"build>=2.0.
|
85
|
+
"build>=2.0.4.post1",
|
86
86
|
"twine>=6.1.0",
|
87
87
|
]
|
@@ -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}]
|
@@ -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
|
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):
|
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
|
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
|
File without changes
|