diff --git a/core/llm/llms/Bedrock.ts b/core/llm/llms/Bedrock.ts index 138a7f536..1a6a883a8 100644 --- a/core/llm/llms/Bedrock.ts +++ b/core/llm/llms/Bedrock.ts @@ -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);