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: wikipedia_search.rb
    path of file: ./repos/boxcars/lib/boxcars/boxcar
    
    the code of the file until where you have to start completion: # frozen_string_litera
    
    def run(question)
      Boxcars.debug "Question: #{question}", :yellow
      uri = URI("https://en.wikipedia.org/w/api.php")
      params = { action: "query", list: "search", srsearch: question, format: "json" }
      uri.query = URI.encode_www_form(params)

      res = Net::HTTP.get_response(uri)
      raise "Error getting response from Wikipedia: #{res.body}" unless res.is_a?(Net::HTTPSuccess)

      response = JSON.parse res.body
      answer = response.dig("query", "search", 0, "snippet").to_s.gsub(/<[^>]*>/, "")
      pageid = response.dig("query", "search", 0, "pageid")
      answer = "#{answer}\nurl: https://en.wikipedia.org/?curid=#{pageid}" if pageid
      Boxcars.debug "Answer: #{answer}", :yellow, style: :bold
      answer
    end