<commit_before>package main

import (
	"encoding/json"
	"net/http"

	"github.com/gorilla/mux"
)

type CallbackResponse struct {
	UUID    string `json:"uuid"`
	Message string `json:"message"`
	Error   string `json:"error"`
}

func ReceiveCallback(w http.ResponseWriter, r *http.Request) {
	var res CallbackResponse

	vars := mux.Vars(r)
	uuid := vars["uuid"]

	// Stuff will happen

	res = CallbackResponse{
		Message: "Callback received",
		UUID:    uuid,
	}

	json.NewEncoder(w).Encode(res)

}<commit_msg>TwiML!!!<commit_after>package main

import (
	"encoding/json"
	"net/http"

	"bitbucket.org/ckvist/twilio/twiml"
	"github.com/gorilla/mux"
)

type CallbackResponse struct {
	UUID    string `json:"uuid"`
	Message string `json:"message"`
	Error   string `json:"error"`
}

func ReceiveCallback(w http.ResponseWriter, r *http.Request) {
	var res CallbackResponse

	vars := mux.Vars(r)
	uuid := vars["uuid"]

	// Stuff will happen

	res = CallbackResponse{
		Message: "Callback received",
		UUID:    uuid,
	}

	json.NewEncoder(w).Encode(res)

}

func GenerateTwiML(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	uuid := vars["uuid"]

	if _, exists := NIP.Stoppers[uuid]; !exists {
		http.Error(w, "No active notifications for this UUID", http.StatusNotFound)
		return
	}

	resp := twiml.NewResponse()

	intro := twiml.Say{
		Voice: "woman",
		Text:  "This is Chicken Little with a message for you.",
	}

	gather := twiml.Gather{
		Action:    "http://me/uuid/digits",
		Timeout:   15,
		NumDigits: 1,
	}

	theMessage := twiml.Say{
		Voice: "man",
		Text:  NIP.Messages[uuid],
	}

	pressAny := twiml.Say{
		Voice: "woman",
		Text:  "Press any key to acknowledge receipt of this message",
	}

	resp.Action(intro)
	resp.Gather(gather, theMessage, pressAny)
	resp.Send(w)
}
{'fraction_non_alphanumeric': 0.1450980392156863, 'fraction_numerical': 0.0016806722689075631, 'mean_word_length': 3.9201101928374658, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3334151', 'n_tokens_mistral': 699, 'n_tokens_neox': 660, 'n_words': 154}