Class: OpenAI::Providers::Bedrock::CustomCredentialsProvider Private

Inherits:
Object
  • Object
show all
Defined in:
lib/openai/providers/bedrock.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(provider) ⇒ CustomCredentialsProvider

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of CustomCredentialsProvider.



183
# File 'lib/openai/providers/bedrock.rb', line 183

def initialize(provider) = @provider = provider

Instance Method Details

#credentialsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



185
186
187
188
189
190
191
192
193
# File 'lib/openai/providers/bedrock.rb', line 185

def credentials
  value = @provider.respond_to?(:call) ? @provider.call : @provider.credentials
  value = value.credentials if !value.respond_to?(:access_key_id) && value.respond_to?(:credentials)
  Bedrock.validate_credentials!(value)
rescue OpenAI::Errors::Error
  raise
rescue StandardError => e
  raise OpenAI::Errors::Error.new(CREDENTIAL_RESOLUTION_MESSAGE), cause: e
end