Class: OpenAI::Providers::Bedrock::ProfileCredentialsProvider Private
- Inherits:
-
Object
- Object
- OpenAI::Providers::Bedrock::ProfileCredentialsProvider
- 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
- #credentials ⇒ Object private
-
#initialize(profile, region:) ⇒ ProfileCredentialsProvider
constructor
private
A new instance of ProfileCredentialsProvider.
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
#credentials ⇒ Object
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 |