-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat (provider/amazon-bedrock): add support for session tokens (#2755)
Co-authored-by: jdavis <45986634+shoopapa@users.noreply.github.com> Co-authored-by: Joe Davis <joedavis29@gmail.com>
- Loading branch information
1 parent
fd7d944
commit d67fa9c
Showing
7 changed files
with
86 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@ai-sdk/amazon-bedrock': patch | ||
'@ai-sdk/provider-utils': patch | ||
--- | ||
|
||
feat (provider/amazon-bedrock): add support for session tokens |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Loads an optional `string` setting from the environment or a parameter. | ||
* | ||
* @param settingValue - The setting value. | ||
* @param environmentVariableName - The environment variable name. | ||
* @returns The setting value. | ||
*/ | ||
export function loadOptionalSetting({ | ||
settingValue, | ||
environmentVariableName, | ||
}: { | ||
settingValue: string | undefined; | ||
environmentVariableName: string; | ||
}): string | undefined { | ||
if (typeof settingValue === 'string') { | ||
return settingValue; | ||
} | ||
|
||
if (settingValue != null || typeof process === 'undefined') { | ||
return undefined; | ||
} | ||
|
||
settingValue = process.env[environmentVariableName]; | ||
|
||
if (settingValue == null || typeof settingValue !== 'string') { | ||
return undefined; | ||
} | ||
|
||
return settingValue; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters