You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- The networking client assumed the `error` field in a failed response was always a `Map<String, dynamic>`.
7
+
- When an API-compatible backend returned a payload like `{ "error": "Not Found", ... }`, the SDK threw a Dart type error instead of a `RequestFailedException`.
8
+
9
+
Changes:
10
+
- Added `requestFailedExceptionFromMap(...)` in [lib/src/core/networking/client.dart](./lib/src/core/networking/client.dart) to normalize error payload parsing.
11
+
- Updated request error handling in `get`, `postAndGetResponse`, `post`, `imageEditForm`, `imageVariationForm`, `fileUpload`, and `delete` to use the shared helper instead of directly casting `error` to a map.
12
+
- Added a regression test covering string-based error payloads in [test/regressions_test.dart](./test/regressions_test.dart).
- The stream client swallowed JSON decode failures while accumulating response data.
18
+
- Non-JSON error bodies in streamed failures could be ignored instead of being surfaced as a proper exception.
19
+
20
+
Changes:
21
+
- Updated `postStream(...)` in [lib/src/core/networking/client.dart](./lib/src/core/networking/client.dart) to stop swallowing terminal error responses.
22
+
- Added `requestFailedExceptionFromRawBody(...)` to convert non-JSON raw response bodies into a `RequestFailedException`.
23
+
- Added logic to emit a stream error when the server returns an error status with a non-empty raw body and no valid stream events were emitted.
24
+
- Added regression tests for raw non-JSON stream failures in [test/regressions_test.dart](./test/regressions_test.dart).
25
+
26
+
## #172 - OpenAIChatCompletionChoiceMessageContentItemModel.imageUrl Not working properly
27
+
28
+
Problem:
29
+
- The chat content model stored `imageUrl` as a map, but `toMap()` wrapped it again.
30
+
- That produced a nested `image_url` payload shape that did not match the API contract.
31
+
32
+
Changes:
33
+
- Fixed `OpenAIChatCompletionChoiceMessageContentItemModel.toMap()` in [lib/src/core/models/chat/sub_models/choices/sub_models/sub_models/content.dart](./lib/src/core/models/chat/sub_models/choices/sub_models/sub_models/content.dart) so it writes the existing `imageUrl` object directly.
34
+
- Added a regression test verifying the correct serialized `image_url` shape in [test/regressions_test.dart](./test/regressions_test.dart).
35
+
36
+
## #185 - Audio | Create Speech | return file bytes (Uint8List) for work on web and improve speed
37
+
38
+
Problem:
39
+
- The issue requested a byte-returning API for speech generation instead of always writing a file.
40
+
41
+
Changes:
42
+
- Confirmed the SDK already exposes `createSpeechBytes(...)` in [lib/src/instance/audio/audio.dart](./lib/src/instance/audio/audio.dart).
43
+
- Documented `createSpeechBytes(...)` in [README.md](./README.md) so the in-memory byte API is visible in the public usage docs.
0 commit comments