diff --git a/lib/completions/endpoints/aws_bedrock.rb b/lib/completions/endpoints/aws_bedrock.rb index 09a8d6d0..4fb3ae27 100644 --- a/lib/completions/endpoints/aws_bedrock.rb +++ b/lib/completions/endpoints/aws_bedrock.rb @@ -22,7 +22,7 @@ module DiscourseAi def model_uri api_url = - "https://bedrock-runtime.#{SiteSetting.ai_bedrock_region}.amazonaws.com/model/anthropic.#{model}/invoke" + "https://bedrock-runtime.#{SiteSetting.ai_bedrock_region}.amazonaws.com/model/#{model}/invoke" api_url = @streaming_mode ? (api_url + "-with-response-stream") : api_url diff --git a/spec/lib/completions/endpoints/aws_bedrock_spec.rb b/spec/lib/completions/endpoints/aws_bedrock_spec.rb index 4b655a91..f637b9ad 100644 --- a/spec/lib/completions/endpoints/aws_bedrock_spec.rb +++ b/spec/lib/completions/endpoints/aws_bedrock_spec.rb @@ -66,7 +66,7 @@ RSpec.describe DiscourseAi::Completions::Endpoints::AwsBedrock do WebMock .stub_request( :post, - "https://bedrock-runtime.#{SiteSetting.ai_bedrock_region}.amazonaws.com/model/anthropic.#{model_name}/invoke", + "https://bedrock-runtime.#{SiteSetting.ai_bedrock_region}.amazonaws.com/model/#{model_name}/invoke", ) .with(body: request_body) .to_return(status: 200, body: JSON.dump(response(response_text))) @@ -112,7 +112,7 @@ RSpec.describe DiscourseAi::Completions::Endpoints::AwsBedrock do WebMock .stub_request( :post, - "https://bedrock-runtime.#{SiteSetting.ai_bedrock_region}.amazonaws.com/model/anthropic.#{model_name}/invoke-with-response-stream", + "https://bedrock-runtime.#{SiteSetting.ai_bedrock_region}.amazonaws.com/model/#{model_name}/invoke-with-response-stream", ) .with(body: stream_request_body) .to_return(status: 200, body: chunks)