Class: OpenAI::Providers::Bedrock::DefaultCredentialsProvider 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

#initializeDefaultCredentialsProvider

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 DefaultCredentialsProvider.



206
207
208
209
# File 'lib/openai/providers/bedrock.rb', line 206

def initialize
  @mutex = Mutex.new
  @provider = nil
end

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.



211
212
213
214
215
# File 'lib/openai/providers/bedrock.rb', line 211

def credentials
  provider = @mutex.synchronize { @provider ||= Aws::CredentialProviderChain.new.resolve }
  raise OpenAI::Errors::Error, MISSING_CREDENTIALS_MESSAGE unless provider
  Bedrock.validate_credentials!(provider.credentials)
end