@animaapp/anima-sdk-react 0.2.1 → 0.2.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@animaapp/anima-sdk-react",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "type": "module",
5
5
  "description": "Anima's JavaScript utilities library",
6
6
  "author": "Anima App, Inc.",
@@ -40,4 +40,4 @@
40
40
  "vite-tsconfig-paths": "^5.1.4",
41
41
  "vitest": "^3.0.5"
42
42
  }
43
- }
43
+ }
@@ -219,7 +219,12 @@ export const useAnimaCodegen = ({
219
219
  }
220
220
  });
221
221
 
222
- es.addEventListener("done", () => {
222
+ es.addEventListener("done", (event) => {
223
+ const message = JSON.parse(
224
+ event.data
225
+ ) as StreamMessageByType<"done">;
226
+ result.tokenUsage = message.payload.tokenUsage;
227
+
223
228
  updateStatus((draft) => {
224
229
  draft.status = "success";
225
230
  draft.result = result as AnimaSDKResult;