🩹 look for bedrock credentials in homedir

This commit is contained in:
Nate Sesti 2024-04-19 10:12:08 -07:00
parent 84fe459fe9
commit 37b21f4876

View file

@ -1,4 +1,5 @@
import * as fs from "fs";
import os from "os";
import { join as joinPath } from "path";
import { promisify } from "util";
import { BaseLLM } from "..";
@ -143,7 +144,7 @@ class Bedrock extends BaseLLM {
try {
const data = await readFile(
joinPath(process.env.HOME!, ".aws", "credentials"),
joinPath(process.env.HOME ?? os.homedir(), ".aws", "credentials"),
"utf8",
);
const credentials = this._parseCredentialsFile(data);