Skip to content

Commit

Permalink
Merge branch 'release/v0.8.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Luphia1984 committed Oct 21, 2024
2 parents 2c7677e + 93b1aa7 commit 40f2c77
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aich",
"version": "0.8.2",
"version": "0.8.3",
"description": "Artificial Intelligence Computing Hub",
"author": "",
"private": true,
Expand All @@ -12,7 +12,7 @@
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "PORT=80 nest start",
"prod": "npm run build && node dist/src/main.js",
"production": "PORT=80 nest start",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
Expand Down
15 changes: 12 additions & 3 deletions src/api/invoices/invoice.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,19 @@ export class InvoiceService {
return;
}

const invoiceFromInvoice = JSON.parse(result.response.text());
try {
const invoiceFromInvoice = JSON.parse(result.response.text());

const invoice: IInvoice = cleanInvoice(invoiceFromInvoice);
this.cache.put(hashedKey, PROGRESS_STATUS.SUCCESS, invoice);
} catch (error) {
this.logger.error(
`Invoice ID: ${hashedKey} LLM Error in generateContent in invoice.service due to parsing gemini output failed or gemini not return correct json: ${error}`,
);
this.cache.put(hashedKey, PROGRESS_STATUS.LLM_ERROR, null);
return;
}

const invoice: IInvoice = cleanInvoice(invoiceFromInvoice);
this.cache.put(hashedKey, PROGRESS_STATUS.SUCCESS, invoice);
return;
}

Expand Down

0 comments on commit 40f2c77

Please sign in to comment.