Method: AssemblyAI::AsyncClient#initialize

Defined in:
lib/assemblyai.rb

#initialize(api_key:, environment: Environment::DEFAULT, max_retries: nil, timeout_in_seconds: nil, user_agent: nil) ⇒ AsyncClient

Parameters:

  • api_key (String)
  • environment (Environment) (defaults to: Environment::DEFAULT)
  • max_retries (Long) (defaults to: nil)

    The number of times to retry a failed request, defaults to 2.

  • timeout_in_seconds (Long) (defaults to: nil)
  • user_agent (AssemblyAI::UserAgent) (defaults to: nil)


43
44
45
46
47
48
49
50
# File 'lib/assemblyai.rb', line 43

def initialize(api_key:, environment: Environment::DEFAULT, max_retries: nil, timeout_in_seconds: nil, user_agent: nil)
  @async_request_client = AsyncRequestClient.new(environment: environment, max_retries: max_retries,
                                                 timeout_in_seconds: timeout_in_seconds, api_key: api_key, user_agent: user_agent)
  @files = AsyncFilesClient.new(request_client: @async_request_client)
  @transcripts = AsyncTranscriptsClient.new(request_client: @async_request_client)
  @realtime = AsyncRealtimeClient.new(request_client: @async_request_client)
  @lemur = AsyncLemurClient.new(request_client: @async_request_client)
end