fere-sdk 0.1.0.dev8__tar.gz → 0.1.0.dev9__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: fere-sdk
3
- Version: 0.1.0.dev8
3
+ Version: 0.1.0.dev9
4
4
  Summary: Python SDK for the FereAI Gateway API
5
5
  Author-email: Fere AI <info@fere.ai>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "fere-sdk"
3
- version = "0.1.0.dev8"
3
+ version = "0.1.0.dev9"
4
4
  description = "Python SDK for the FereAI Gateway API"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -3,6 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import json
6
+ import logging
6
7
  from collections.abc import AsyncIterator
7
8
  from typing import Any
8
9
 
@@ -22,6 +23,8 @@ from .models import (
22
23
  WithdrawRequest,
23
24
  )
24
25
 
26
+ logger = logging.getLogger(__name__)
27
+
25
28
  DEFAULT_BASE_URL = "https://api.fereai.xyz"
26
29
 
27
30
 
@@ -169,7 +172,8 @@ class FereAPI:
169
172
  try:
170
173
  data = json.loads(raw)
171
174
  except (json.JSONDecodeError, ValueError):
172
- data = {"raw": raw}
175
+ logger.debug("Unparseable SSE data: %r", raw)
176
+ continue
173
177
  yield ChatEvent(event=event_type, data=data)
174
178
 
175
179
  async def get_threads(self, skip: int = 0, limit: int = 10) -> list[dict]:
@@ -371,7 +375,8 @@ class FereAPI:
371
375
  try:
372
376
  data = json.loads(raw)
373
377
  except (json.JSONDecodeError, ValueError):
374
- data = {"raw": raw}
378
+ logger.debug("Unparseable SSE data: %r", raw)
379
+ continue
375
380
  yield ChatEvent(event=event_type, data=data)
376
381
 
377
382
  # ----------------------------------------------------------
File without changes
File without changes