diff --git a/CHANGELOG.md b/CHANGELOG.md index 0461178e..65a52c88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ In previous releases, the name "Hypermode" was used for all three._ - Enable GraphQL endpoints to be defined in the manifest [#464](https://github.com/hypermodeinc/modus/pull/464) - Publish SDKs and templates via release workflows [#465](https://github.com/hypermodeinc/modus/pull/465) - Fix AssemblyScript build failure when no Git repo is present [#475](https://github.com/hypermodeinc/modus/pull/475) +- Disable AWS Bedrock support temporarily [#479](https://github.com/hypermodeinc/modus/pull/479) ## 2024-10-02 - Version 0.12.7 diff --git a/runtime/models/bedrock.go b/runtime/models/bedrock.go index bf138ac0..a0ec0991 100644 --- a/runtime/models/bedrock.go +++ b/runtime/models/bedrock.go @@ -9,44 +9,44 @@ package models -import ( - "context" - "fmt" +// import ( +// "context" +// "fmt" - "github.com/hypermodeinc/modus/lib/manifest" - hyp_aws "github.com/hypermodeinc/modus/runtime/aws" - "github.com/hypermodeinc/modus/runtime/db" - "github.com/hypermodeinc/modus/runtime/utils" +// "github.com/hypermodeinc/modus/lib/manifest" +// hyp_aws "github.com/hypermodeinc/modus/runtime/aws" +// "github.com/hypermodeinc/modus/runtime/db" +// "github.com/hypermodeinc/modus/runtime/utils" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/service/bedrockruntime" -) +// "github.com/aws/aws-sdk-go-v2/aws" +// "github.com/aws/aws-sdk-go-v2/service/bedrockruntime" +// ) -func invokeAwsBedrockModel(ctx context.Context, model *manifest.ModelInfo, input string) (output string, err error) { +// func invokeAwsBedrockModel(ctx context.Context, model *manifest.ModelInfo, input string) (output string, err error) { - span, ctx := utils.NewSentrySpanForCurrentFunc(ctx) - defer span.Finish() +// span, ctx := utils.NewSentrySpanForCurrentFunc(ctx) +// defer span.Finish() - // NOTE: Bedrock support is experimental, and not advertised to users. - // It currently uses the same AWS credentials as the Runtime. - // In the future, we will support user-provided credentials for Bedrock. +// // NOTE: Bedrock support is experimental, and not advertised to users. +// // It currently uses the same AWS credentials as the Runtime. +// // In the future, we will support user-provided credentials for Bedrock. - cfg := hyp_aws.GetAwsConfig() // TODO, connect to AWS using the user-provided credentials - client := bedrockruntime.NewFromConfig(cfg) +// cfg := hyp_aws.GetAwsConfig() // TODO, connect to AWS using the user-provided credentials +// client := bedrockruntime.NewFromConfig(cfg) - modelId := fmt.Sprintf("%s.%s", model.Provider, model.SourceModel) +// modelId := fmt.Sprintf("%s.%s", model.Provider, model.SourceModel) - startTime := utils.GetTime() - result, err := client.InvokeModel(ctx, &bedrockruntime.InvokeModelInput{ - ModelId: &modelId, - ContentType: aws.String("application/json"), - Body: []byte(input), - }) - endTime := utils.GetTime() +// startTime := utils.GetTime() +// result, err := client.InvokeModel(ctx, &bedrockruntime.InvokeModelInput{ +// ModelId: &modelId, +// ContentType: aws.String("application/json"), +// Body: []byte(input), +// }) +// endTime := utils.GetTime() - output = string(result.Body) +// output = string(result.Body) - db.WriteInferenceHistory(ctx, model, input, output, startTime, endTime) +// db.WriteInferenceHistory(ctx, model, input, output, startTime, endTime) - return output, err -} +// return output, err +// } diff --git a/runtime/models/models.go b/runtime/models/models.go index f176341c..ba577cfb 100644 --- a/runtime/models/models.go +++ b/runtime/models/models.go @@ -52,10 +52,11 @@ func InvokeModel(ctx context.Context, modelName string, input string) (string, e return "", err } + // NOTE: Bedrock support is temporarily disabled // TODO: use the provider pattern instead of branching - if model.Connection == "aws-bedrock" { - return invokeAwsBedrockModel(ctx, model, input) - } + // if model.Connection == "aws-bedrock" { + // return invokeAwsBedrockModel(ctx, model, input) + // } return PostToModelEndpoint[string](ctx, model, input) }