Skip to content

Commit

Permalink
Lint error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
johnyrahul committed Feb 14, 2025
1 parent fd26354 commit 442a937
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 27 deletions.
34 changes: 16 additions & 18 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Jest Tests",
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
"args": [
"--runInBand"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Jest Tests",
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
"args": ["--runInBand"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}
17 changes: 8 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/
require('dotenv').config()
require("dotenv").config();
const axios = require("axios");
const winston = require("winston");
const fs = require("fs");
Expand Down Expand Up @@ -54,7 +54,6 @@ class LLMWhispererClient {
apiTimeout = 120,
loggingLevel = "",
} = {}) {

const level =
loggingLevel || process.env.LLMWHISPERER_LOGGING_LEVEL || "debug";

Expand Down Expand Up @@ -536,7 +535,7 @@ class LLMWhispererClientV2 {
message["extraction"] = {};
message["status_code"] = -1;
message["message"] = "Whisper client operation timed out";
return message
return message;
}
const whisperStatus = await this.whisperStatus(whisperHash);
this.logger.debug(`whisperStatus: ${JSON.stringify(whisperStatus)}`);
Expand All @@ -545,15 +544,17 @@ class LLMWhispererClientV2 {
message["extraction"] = {};
message["status_code"] = whisperStatus.statusCode;
message["message"] = "Whisper client operation failed";
return message
return message;
}
if (whisperStatus.status === "accepted") {
this.logger.debug("Status: accepted...");
} else if (whisperStatus.status === "processing") {
this.logger.debug("Status: processing...");
} else if (whisperStatus.status === "error") {
this.logger.debug("Status: error");
this.logger.error('Whisper-hash: ${whisperHash} | STATUS: failed with ${whisperStatus.message}')
this.logger.error(
"Whisper-hash: ${whisperHash} | STATUS: failed with ${whisperStatus.message}",
);
message["extraction"] = {};
message["status_code"] = -1;
message["status"] = "error";
Expand Down Expand Up @@ -607,8 +608,7 @@ class LLMWhispererClientV2 {
this.logger.debug(`params: ${JSON.stringify(params)}`);
delete this.headers["Content-Length"];
this.logger.debug(`headers: ${JSON.stringify(this.headers)}`);



try {
const response = await axios.get(url, {
headers: this.headers,
Expand All @@ -619,8 +619,7 @@ class LLMWhispererClientV2 {
message.statusCode = response.status;
return message;
} catch (error) {

this.logger.debug("Hel00000000002")
this.logger.debug("Hel00000000002");
this.logger.debug(`error: ${JSON.stringify(error)}`);
const err = error.response
? error.response.data
Expand Down

0 comments on commit 442a937

Please sign in to comment.