From 37b21f4876baa471552869d5ecdd11dea55f1bb0 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Fri, 19 Apr 2024 10:12:08 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20look=20for=20bedrock=20credentia?= =?UTF-8?q?ls=20in=20homedir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/llm/llms/Bedrock.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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);