mbxai 2.1.2__tar.gz → 2.1.3__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 (47) hide show
  1. {mbxai-2.1.2 → mbxai-2.1.3}/PKG-INFO +1 -1
  2. {mbxai-2.1.2 → mbxai-2.1.3}/pyproject.toml +1 -1
  3. {mbxai-2.1.2 → mbxai-2.1.3}/setup.py +1 -1
  4. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/__init__.py +1 -1
  5. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/agent/client.py +35 -3
  6. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/mcp/server.py +1 -1
  7. {mbxai-2.1.2 → mbxai-2.1.3}/.gitignore +0 -0
  8. {mbxai-2.1.2 → mbxai-2.1.3}/LICENSE +0 -0
  9. {mbxai-2.1.2 → mbxai-2.1.3}/README.md +0 -0
  10. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/agent/__init__.py +0 -0
  11. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/agent/models.py +0 -0
  12. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/core.py +0 -0
  13. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/agent_example.py +0 -0
  14. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/agent_iterations_example.py +0 -0
  15. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/agent_logging_example.py +0 -0
  16. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/agent_tool_registration_example.py +0 -0
  17. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/agent_validation_example.py +0 -0
  18. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/auto_schema_example.py +0 -0
  19. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/conversation_history_test.py +0 -0
  20. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/dialog_agent_example.py +0 -0
  21. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/mcp/mcp_client_example.py +0 -0
  22. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/mcp/mcp_server_example.py +0 -0
  23. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/openrouter_example.py +0 -0
  24. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/optional_prompt_example.py +0 -0
  25. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/parse_example.py +0 -0
  26. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/parse_tool_example.py +0 -0
  27. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/request.json +0 -0
  28. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/response.json +0 -0
  29. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/send_request.py +0 -0
  30. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/simple_agent_test.py +0 -0
  31. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/tool_client_example.py +0 -0
  32. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/examples/unified_interface_example.py +0 -0
  33. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/mcp/__init__.py +0 -0
  34. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/mcp/client.py +0 -0
  35. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/mcp/example.py +0 -0
  36. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/openrouter/__init__.py +0 -0
  37. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/openrouter/client.py +0 -0
  38. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/openrouter/config.py +0 -0
  39. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/openrouter/models.py +0 -0
  40. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/openrouter/schema.py +0 -0
  41. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/tools/__init__.py +0 -0
  42. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/tools/client.py +0 -0
  43. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/tools/example.py +0 -0
  44. {mbxai-2.1.2 → mbxai-2.1.3}/src/mbxai/tools/types.py +0 -0
  45. {mbxai-2.1.2 → mbxai-2.1.3}/tests/test_mcp_tool_registration.py +0 -0
  46. {mbxai-2.1.2 → mbxai-2.1.3}/tests/test_real_mcp_schema.py +0 -0
  47. {mbxai-2.1.2 → mbxai-2.1.3}/tests/test_schema_conversion.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mbxai
3
- Version: 2.1.2
3
+ Version: 2.1.3
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 = "2.1.2"
7
+ version = "2.1.3"
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="2.1.2",
5
+ version="2.1.3",
6
6
  author="MBX AI",
7
7
  description="MBX AI SDK",
8
8
  long_description=open("README.md").read(),
@@ -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.1.2"
10
+ __version__ = "2.1.3"
11
11
 
12
12
  __all__ = [
13
13
  "AgentClient",
@@ -134,6 +134,35 @@ class AgentClient:
134
134
  logger.debug(f"🔗 AI call with {len(messages)} messages (no history)")
135
135
  return self._ai_client.parse(full_messages, response_format)
136
136
 
137
+ def _validate_answers(self, answers: Any) -> bool:
138
+ """
139
+ Validate that answers parameter is a proper AnswerList with content.
140
+
141
+ Args:
142
+ answers: The answers parameter to validate
143
+
144
+ Returns:
145
+ True if answers is valid and has content, False otherwise
146
+ """
147
+ # Check if answers is the correct type
148
+ if not isinstance(answers, AnswerList):
149
+ logger.warning(f"Invalid answers type: {type(answers)}. Expected AnswerList, treating as no answers.")
150
+ return False
151
+
152
+ # Check if answers has content
153
+ if not hasattr(answers, 'answers') or not answers.answers:
154
+ logger.info(f"Empty answers list provided, proceeding without answers processing.")
155
+ return False
156
+
157
+ # Check if answers list contains valid Answer objects
158
+ for answer in answers.answers:
159
+ if not hasattr(answer, 'key') or not hasattr(answer, 'answer'):
160
+ logger.warning(f"Invalid answer object in list: {answer}. Treating as no answers.")
161
+ return False
162
+
163
+ logger.debug(f"Validated {len(answers.answers)} answers")
164
+ return True
165
+
137
166
  def _extract_token_usage(self, response: Any) -> TokenUsage:
138
167
  """Extract token usage information from an AI response."""
139
168
  try:
@@ -188,7 +217,7 @@ class AgentClient:
188
217
  final_response_structure: Type[BaseModel] = None,
189
218
  ask_questions: bool = True,
190
219
  agent_id: str = None,
191
- answers: AnswerList = None
220
+ answers: AnswerList | None = None
192
221
  ) -> AgentResponse:
193
222
  """
194
223
  Process a prompt through the agent's thinking process.
@@ -252,8 +281,11 @@ class AgentClient:
252
281
 
253
282
  # Handle answers provided (skip question generation and process directly)
254
283
  if answers is not None:
255
- logger.info(f"📝 Agent {agent_id}: Processing with provided answers, skipping question generation")
256
- return self._process_answers_directly(agent_id, prompt, final_response_structure, answers, token_summary, history_for_ai)
284
+ if self._validate_answers(answers):
285
+ logger.info(f"📝 Agent {agent_id}: Processing with provided answers, skipping question generation")
286
+ return self._process_answers_directly(agent_id, prompt, final_response_structure, answers, token_summary, history_for_ai)
287
+ else:
288
+ logger.info(f"📝 Agent {agent_id}: Invalid or empty answers provided, proceeding with normal flow")
257
289
 
258
290
  # Step 1: Generate questions (if ask_questions is True)
259
291
  if ask_questions:
@@ -31,7 +31,7 @@ class MCPServer:
31
31
  self.app = FastAPI(
32
32
  title=self.name,
33
33
  description=self.description,
34
- version="2.1.2",
34
+ version="2.1.3",
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
File without changes
File without changes
File without changes