Class: OpenAI::Providers::Bedrock::ProfileCredentialsProvider 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(profile, region:) ⇒ ProfileCredentialsProvider

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



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

def initialize(profile, region:)
  @profile = profile
  @region = region
  @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.



217
218
219
220
221
222
223
224
# File 'lib/openai/providers/bedrock.rb', line 217

def credentials
  provider = @mutex.synchronize { @provider ||= resolve }
  Bedrock.validate_credentials!(provider.credentials)
rescue OpenAI::Errors::Error
  raise
rescue StandardError => e
  raise OpenAI::Errors::Error.new(CREDENTIAL_RESOLUTION_MESSAGE), cause: e
end