mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 03:01:56 +00:00
fix(ai): move AWS_BEDROCK_SKIP_AUTH inside Node.js environment check
The process.env access was outside the typeof process check, which would throw in browser environments. Moved inside the Node.js/Bun block for consistency with other env var access. Also added changelog entry for #1320 and improved docs clarity.
This commit is contained in:
parent
df527fb988
commit
a40bf5fbd5
3 changed files with 16 additions and 13 deletions
|
|
@ -90,18 +90,18 @@ export const streamBedrock: StreamFunction<"bedrock-converse-stream", BedrockOpt
|
|||
profile: options.profile,
|
||||
};
|
||||
|
||||
// Support proxies that don't need authentication
|
||||
if (process.env.AWS_BEDROCK_SKIP_AUTH === "1") {
|
||||
config.credentials = {
|
||||
accessKeyId: "dummy-access-key",
|
||||
secretAccessKey: "dummy-secret-key",
|
||||
};
|
||||
}
|
||||
|
||||
// in Node.js/Bun environment only
|
||||
if (typeof process !== "undefined" && (process.versions?.node || process.versions?.bun)) {
|
||||
config.region = config.region || process.env.AWS_REGION || process.env.AWS_DEFAULT_REGION;
|
||||
|
||||
// Support proxies that don't need authentication
|
||||
if (process.env.AWS_BEDROCK_SKIP_AUTH === "1") {
|
||||
config.credentials = {
|
||||
accessKeyId: "dummy-access-key",
|
||||
secretAccessKey: "dummy-secret-key",
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
process.env.HTTP_PROXY ||
|
||||
process.env.HTTPS_PROXY ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue