Commit d285f99
committed
fix(ai): Only include unexpected prediction element in error message.
If the `responseJson` from the Predict request has an image, the entire
image base64 will be included in the error message. This can make the error
message >400kB (!!), which could cause performance issues in apps.
I ran into this when testing #9216,
since the `safetyAttributes` would be included in a response and trigger
this error, but the `predictions` array in `responseJson` would have images.
I noticed that when the sample app rendered the `error.message`, it
began running into serious performance issues.1 parent 2058432 commit d285f99
File tree
2 files changed
+6
-3
lines changed- .changeset
- packages/ai/src/requests
2 files changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
303 | | - | |
304 | | - | |
| 302 | + | |
305 | 303 | | |
306 | 304 | | |
307 | 305 | | |
| |||
0 commit comments