mbxai 0.8.3__py3-none-any.whl → 1.0.1__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 +1 -1
- mbxai/mcp/server.py +1 -1
- mbxai/openrouter/client.py +22 -4
- {mbxai-0.8.3.dist-info → mbxai-1.0.1.dist-info}/METADATA +1 -1
- {mbxai-0.8.3.dist-info → mbxai-1.0.1.dist-info}/RECORD +7 -7
- {mbxai-0.8.3.dist-info → mbxai-1.0.1.dist-info}/WHEEL +0 -0
- {mbxai-0.8.3.dist-info → mbxai-1.0.1.dist-info}/licenses/LICENSE +0 -0
mbxai/__init__.py
CHANGED
mbxai/mcp/server.py
CHANGED
mbxai/openrouter/client.py
CHANGED
@@ -213,14 +213,21 @@ class OpenRouterClient:
|
|
213
213
|
|
214
214
|
response = self._client.chat.completions.create(**request)
|
215
215
|
|
216
|
-
|
216
|
+
if response is None:
|
217
|
+
logger.error("Received None response from OpenRouter API")
|
218
|
+
raise OpenRouterAPIError("Received None response from OpenRouter API")
|
217
219
|
|
220
|
+
logger.info(f"Response type: {type(response)}")
|
221
|
+
logger.info(f"Response attributes: {dir(response)}")
|
218
222
|
logger.info(f"Received response from OpenRouter: {len(response.choices)} choices")
|
219
223
|
|
220
224
|
return response
|
221
225
|
|
222
226
|
except Exception as e:
|
223
227
|
logger.error(f"Error in chat completion: {str(e)}")
|
228
|
+
logger.error(f"Request details: model={model or self.model}, stream={stream}, kwargs={kwargs}")
|
229
|
+
logger.error(f"Message structure: {[{'role': msg.get('role'), 'content_length': len(str(msg.get('content', '')))} for msg in messages]}")
|
230
|
+
|
224
231
|
if hasattr(e, 'response') and e.response is not None:
|
225
232
|
logger.error(f"Response status: {e.response.status_code}")
|
226
233
|
logger.error(f"Response headers: {e.response.headers}")
|
@@ -244,8 +251,9 @@ class OpenRouterClient:
|
|
244
251
|
"""Get a chat completion from OpenRouter."""
|
245
252
|
try:
|
246
253
|
# Log the request details
|
247
|
-
logger.info(f"Sending
|
254
|
+
logger.info(f"Sending parse request to OpenRouter with model: {model or self.model}")
|
248
255
|
logger.info(f"Message count: {len(messages)}")
|
256
|
+
logger.info(f"Response format: {response_format}")
|
249
257
|
|
250
258
|
# Calculate total message size for logging
|
251
259
|
total_size = sum(len(str(msg)) for msg in messages)
|
@@ -259,12 +267,22 @@ class OpenRouterClient:
|
|
259
267
|
}
|
260
268
|
|
261
269
|
response = self._client.beta.chat.completions.parse(**request)
|
270
|
+
|
271
|
+
if response is None:
|
272
|
+
logger.error("Received None response from OpenRouter API")
|
273
|
+
raise OpenRouterAPIError("Received None response from OpenRouter API")
|
274
|
+
|
275
|
+
logger.info(f"Response type: {type(response)}")
|
276
|
+
logger.info(f"Response attributes: {dir(response)}")
|
262
277
|
logger.info(f"Received response from OpenRouter: {len(response.choices)} choices")
|
263
278
|
|
264
279
|
return response
|
265
280
|
|
266
281
|
except Exception as e:
|
267
|
-
logger.error(f"Error in
|
282
|
+
logger.error(f"Error in parse completion: {str(e)}")
|
283
|
+
logger.error(f"Request details: model={model or self.model}, response_format={response_format}, kwargs={kwargs}")
|
284
|
+
logger.error(f"Message structure: {[{'role': msg.get('role'), 'content_length': len(str(msg.get('content', '')))} for msg in messages]}")
|
285
|
+
|
268
286
|
if hasattr(e, 'response') and e.response is not None:
|
269
287
|
logger.error(f"Response status: {e.response.status_code}")
|
270
288
|
logger.error(f"Response headers: {e.response.headers}")
|
@@ -274,7 +292,7 @@ class OpenRouterClient:
|
|
274
292
|
logger.error(f"Response content preview: {content[:1000]}...")
|
275
293
|
except:
|
276
294
|
logger.error("Could not read response content")
|
277
|
-
self._handle_api_error("
|
295
|
+
self._handle_api_error("parse completion", e)
|
278
296
|
|
279
297
|
@classmethod
|
280
298
|
def register_model(cls, name: str, value: str) -> None:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
mbxai/__init__.py,sha256=
|
1
|
+
mbxai/__init__.py,sha256=Eu7kLG_RMxtumjtnpzySXQtpUHIPHMeyqjreCcNvq8k,47
|
2
2
|
mbxai/core.py,sha256=WMvmU9TTa7M_m-qWsUew4xH8Ul6xseCZ2iBCXJTW-Bs,196
|
3
3
|
mbxai/examples/openrouter_example.py,sha256=-grXHKMmFLoh-yUIEMc31n8Gg1S7uSazBWCIOWxgbyQ,1317
|
4
4
|
mbxai/examples/parse_example.py,sha256=eCKMJoOl6qwo8sDP6Trc6ncgjPlgTqi5tPE2kB5_P0k,3821
|
@@ -9,16 +9,16 @@ mbxai/examples/mcp/mcp_server_example.py,sha256=BK2kaKncyeZ9KHvrBBPGZwNATVNgTFkQ
|
|
9
9
|
mbxai/mcp/__init__.py,sha256=_ek9iYdYqW5saKetj4qDci11jxesQDiHPJRpHMKkxgU,175
|
10
10
|
mbxai/mcp/client.py,sha256=BuKmKTupzbiLMFghseeYE6Ih6xCesJ8mIMHaXHiNwlo,5206
|
11
11
|
mbxai/mcp/example.py,sha256=oaol7AvvZnX86JWNz64KvPjab5gg1VjVN3G8eFSzuaE,2350
|
12
|
-
mbxai/mcp/server.py,sha256=
|
12
|
+
mbxai/mcp/server.py,sha256=QdEUXzMb8Ih_P5C5ebh_LckyjlxwmTtQ8V5M7yXgjr4,3462
|
13
13
|
mbxai/openrouter/__init__.py,sha256=Ito9Qp_B6q-RLGAQcYyTJVWwR2YAZvNqE-HIYXxhtD8,298
|
14
|
-
mbxai/openrouter/client.py,sha256=
|
14
|
+
mbxai/openrouter/client.py,sha256=QSWR7zvdo0IyJygxYqb3nN2H-NacbrU2nD9Y4N3RPhc,12278
|
15
15
|
mbxai/openrouter/config.py,sha256=Ia93s-auim9Sq71eunVDbn9ET5xX2zusXpV4JBdHAzs,3251
|
16
16
|
mbxai/openrouter/models.py,sha256=b3IjjtZAjeGOf2rLsdnCD1HacjTnS8jmv_ZXorc-KJQ,2604
|
17
17
|
mbxai/tools/__init__.py,sha256=ogxrHvgJ7OR62Lmd5x9Eh5d2C0jqWyQis7Zy3yKpZ78,218
|
18
18
|
mbxai/tools/client.py,sha256=h_1fxVDBq57f_OXNsj-TBp6-r367sv6Z5nk1qLFcLO8,14951
|
19
19
|
mbxai/tools/example.py,sha256=1HgKK39zzUuwFbnp3f0ThyWVfA_8P28PZcTwaUw5K78,2232
|
20
20
|
mbxai/tools/types.py,sha256=yUMvRlWiFy2KnEQLCerh4XioVKMKa2wHtb3fCDybg34,5878
|
21
|
-
mbxai-0.
|
22
|
-
mbxai-0.
|
23
|
-
mbxai-0.
|
24
|
-
mbxai-0.
|
21
|
+
mbxai-1.0.1.dist-info/METADATA,sha256=YUTTWuIAEonV0JLG4_5Bzg1Nd0peZ8juwL1AkEJlL4c,4147
|
22
|
+
mbxai-1.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
23
|
+
mbxai-1.0.1.dist-info/licenses/LICENSE,sha256=hEyhc4FxwYo3NQ40yNgZ7STqwVk-1_XcTXOnAPbGJAw,1069
|
24
|
+
mbxai-1.0.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|