mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
31 lines
758 B
Protocol Buffer
31 lines
758 B
Protocol Buffer
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;
|
|
}
|