<commit_before>require "net/http"
require "uri"

module Chirp

  CHIRP_API_HOST = "http://localhost:3000"

  def experiment(slug, &block)
    # Make API request for a serving for the experiment defined in the slug.
    uri = URI.parse("#{ CHIRP_API_HOST }/api/v1/experiments/#{ slug }/serving")

    response = Net::HTTP.get_response(uri)

    variant = JSON.parse(response.body)

    experiment = Chirp::Experiment.new(:variant => variant)

    # Yield the served variant.
    yield experiment
  end
end
<commit_msg>Debugging.<commit_after>require "net/http"
require "uri"

module Chirp

  def self.included(base)
    puts "Including chirp into #{ base }..."
  end

  CHIRP_API_HOST = "http://localhost:3000"

  def experiment(slug, &block)
    # Make API request for a serving for the experiment defined in the slug.
    uri = URI.parse("#{ CHIRP_API_HOST }/api/v1/experiments/#{ slug }/serving")

    response = Net::HTTP.get_response(uri)

    variant = JSON.parse(response.body)

    experiment = Chirp::Experiment.new(:variant => variant)

    # Yield the served variant.
    yield experiment
  end
end

{'fraction_non_alphanumeric': 0.11902614968440037, 'fraction_numerical': 0.009017132551848512, 'mean_word_length': 3.567901234567901, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2674954', 'n_tokens_mistral': 381, 'n_tokens_neox': 357, 'n_words': 98}