everydaycats commited on
Commit
bf51995
·
verified ·
1 Parent(s): 9a86204

Update aiEngine.js

Browse files
Files changed (1) hide show
  1. aiEngine.js +5 -5
aiEngine.js CHANGED
@@ -44,7 +44,7 @@ export const AIEngine = {
44
  // Return both text and usage metadata
45
  return {
46
  text: response.text,
47
- usage: response.usageMetadata.total_token_count
48
  };
49
 
50
  } catch (error) {
@@ -101,7 +101,7 @@ export const AIEngine = {
101
  // Return both text and usage metadata
102
  return {
103
  text: response.text,
104
- usage: response.usageMetadata.total_token_count
105
  };
106
 
107
  } catch (error) {
@@ -137,7 +137,7 @@ export const AIEngine = {
137
  // Attach usage to the JSON object
138
  return {
139
  ...parsed,
140
- usage: response.usageMetadata.total_token_count
141
  };
142
 
143
  } catch (e) {
@@ -173,7 +173,7 @@ export const AIEngine = {
173
  // Attach usage to the JSON object
174
  return {
175
  ...parsed,
176
- usage: response.usageMetadata.total_token_count
177
  };
178
 
179
  } catch (e) {
@@ -236,7 +236,7 @@ export const AIEngine = {
236
  console.log(aggregatedResponse.usageMetadata.total_token_count);
237
  return {
238
  image: finalDataUrl,
239
- usage: aggregatedResponse.usageMetadata.total_token_count
240
  };
241
 
242
  } catch (error) {
 
44
  // Return both text and usage metadata
45
  return {
46
  text: response.text,
47
+ usage: response.usageMetadata
48
  };
49
 
50
  } catch (error) {
 
101
  // Return both text and usage metadata
102
  return {
103
  text: response.text,
104
+ usage: response.usageMetadata
105
  };
106
 
107
  } catch (error) {
 
137
  // Attach usage to the JSON object
138
  return {
139
  ...parsed,
140
+ usage: response.usageMetadata
141
  };
142
 
143
  } catch (e) {
 
173
  // Attach usage to the JSON object
174
  return {
175
  ...parsed,
176
+ usage: response.usageMetadata
177
  };
178
 
179
  } catch (e) {
 
236
  console.log(aggregatedResponse.usageMetadata.total_token_count);
237
  return {
238
  image: finalDataUrl,
239
+ usage: aggregatedResponse.usageMetadata
240
  };
241
 
242
  } catch (error) {