Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions lib/ruby_llm/providers/bedrock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@
end
end

def parse_error(response) # rubocop:disable Metrics/MethodLength
return if response.body.empty?

body = try_parse_json(response.body)
case body
when Hash
body['message']
when Array
body.map do |part|
part['message']

Check warning on line 45 in lib/ruby_llm/providers/bedrock.rb

View check run for this annotation

Codecov / codecov/patch

lib/ruby_llm/providers/bedrock.rb#L45

Added line #L45 was not covered by tests
end.join('. ')
else
body
end
end

def sign_request(url, method: :post, payload: nil)
signer = create_signer
request = build_request(url, method:, payload:)
Expand Down