Skip to content

Commit

Permalink
Remove console.log from googlevertexai-connection.ts (langchain-ai#3322)
Browse files Browse the repository at this point in the history
* Remove console.log from googlevertexai-connection.ts

Remove console.log from googlevertexai-connection.ts

Problem:
- In case of invalid address, an error is logged exposing authentication token  in logs.
- this log should be handled by langchain callback mechanism.

* fix yarn lint

---------

Co-authored-by: Raissa Albano Fujioka <[email protected]>
  • Loading branch information
raioalbano and Raissa Albano Fujioka authored Nov 19, 2023
1 parent 733b16d commit ca2bc81
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions langchain/src/util/googlevertexai-connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,12 @@ export abstract class GoogleConnection<
opts.responseType = "json";
}

try {
const callResponse = await this.caller.callWithOptions(
{ signal: options?.signal },
async () => this.client.request(opts)
);
const response: unknown = callResponse; // Done for typecast safety, I guess
return <ResponseType>response;
} catch (x) {
console.error(JSON.stringify(x, null, 1));
throw x;
}
const callResponse = await this.caller.callWithOptions(
{ signal: options?.signal },
async () => this.client.request(opts)
);
const response: unknown = callResponse; // Done for typecast safety, I guess
return <ResponseType>response;
}
}

Expand Down

0 comments on commit ca2bc81

Please sign in to comment.