Skip to content

Commit

Permalink
chore: allows an environmental override of the default AWS region and…
Browse files Browse the repository at this point in the history
… using it for bedrock
  • Loading branch information
AlexsJones committed Mar 22, 2024
1 parent 3c1c055 commit 75b1b78
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/ai/amazonbedrock.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"os"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
Expand Down Expand Up @@ -76,6 +77,9 @@ func GetModelOrDefault(model string) string {
// GetModelOrDefault check config region
func GetRegionOrDefault(region string) string {

if os.Getenv("AWS_DEFAULT_REGION") != "" {
region = os.Getenv("AWS_DEFAULT_REGION")
}
// Check if the provided model is in the list
for _, m := range BEDROCKER_SUPPORTED_REGION {
if m == region {
Expand Down

0 comments on commit 75b1b78

Please sign in to comment.