syntax = "proto3";

package spam;

option go_package = "./proto;spam";

service Spam {
	rpc Classify(ClassifyRequest) returns (ClassifyResponse) {}
}

// Check whether an email is likely to be spam based on its attributes
message ClassifyRequest {
	// The body of the email
	string email_body = 1;
	// The email address it is being sent to
	string to = 2;
	// The email address it has been sent from
	string from = 3;
	// The subject of the email
	string subject = 4;
}

message ClassifyResponse {
	// Is it spam? Returns true if its score is > 5
	bool is_spam = 1;
	// The score evaluated for this email. A higher number means it is more likely to be spam
	double score = 2;
	// The rules that have contributed to this score
	repeated string details = 3;
}
