From 86bb86a3cc72b784aef229187f602fa64be3eac1 Mon Sep 17 00:00:00 2001 From: Lancelot Owczarczak Date: Wed, 15 Nov 2023 12:03:25 +0100 Subject: [PATCH] :bug: Fix generate token usage type (#100) * :bug: Fix generate token usage type * :beers: Remove tutu --- lib/generate.ts | 6 +++++- package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/generate.ts b/lib/generate.ts index b5e51b0..563c85d 100644 --- a/lib/generate.ts +++ b/lib/generate.ts @@ -220,7 +220,11 @@ export class Generation extends Readable implements Promise { return new Promise((resolve, reject) => { this.on("error", reject); this.on("infos", (data) => { - resolve(data); + resolve({ + result: data.result, + tokenUsage: data.token_usage, + ressources: data.ressources, + }); }); }); } diff --git a/package.json b/package.json index fe537b2..90481af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyfire-js", - "version": "0.2.12", + "version": "0.2.13", "main": "index.js", "types": "index.d.ts", "author": "Lancelot Owczarczak ",