You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: generator.rb
    path of file: ./repos/kbsecret/lib/kbsecret
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require "securerandom"

module KBSecret
  # Generates secret values (passwords, environment keys, etc) for storage by {KBS
    
    def initialize(profile = :default)
      @format = Config.generator(profile)[:format].to_sym
      @length = Config.generator(profile)[:length].to_i

      raise Exceptions::GeneratorLengthError, @length unless @length.positive?
      raise Exceptions::GeneratorFormatError, @format unless GENERATOR_TYPES.include?(@format)
    end