FIX: We don't need to prepend anthropic. to bedrock models (#308)
This commit is contained in:
parent
3064d4c288
commit
8a01751991
|
@ -22,7 +22,7 @@ module DiscourseAi
|
||||||
|
|
||||||
def model_uri
|
def model_uri
|
||||||
api_url =
|
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
|
api_url = @streaming_mode ? (api_url + "-with-response-stream") : api_url
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ RSpec.describe DiscourseAi::Completions::Endpoints::AwsBedrock do
|
||||||
WebMock
|
WebMock
|
||||||
.stub_request(
|
.stub_request(
|
||||||
:post,
|
: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)
|
.with(body: request_body)
|
||||||
.to_return(status: 200, body: JSON.dump(response(response_text)))
|
.to_return(status: 200, body: JSON.dump(response(response_text)))
|
||||||
|
@ -112,7 +112,7 @@ RSpec.describe DiscourseAi::Completions::Endpoints::AwsBedrock do
|
||||||
WebMock
|
WebMock
|
||||||
.stub_request(
|
.stub_request(
|
||||||
:post,
|
: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)
|
.with(body: stream_request_body)
|
||||||
.to_return(status: 200, body: chunks)
|
.to_return(status: 200, body: chunks)
|
||||||
|
|
Loading…
Reference in New Issue