syntax = "proto3";

package olympicsagent.v1;


service OlympicsAgent {
    rpc Ask (OlympicsQuery) returns (CityLocation);
    rpc AskStream (OlympicsDurationQuery) returns (stream StreamingResult);
}

message CityLocation {
    // The city where the Olympics were held
    string city = 1;
    // The country where the Olympics were held
    string country = 2;
}

message OlympicsQuery {
    // The year of the Olympics
    // Constraint:
    //   greater than or equal to 1896
    int32 year = 1;
}

message StreamingResult {
    // The answer to the query
    string answer = 1;
}

message OlympicsDurationQuery {
    // The start year of the Olympics
    // Constraint:
    //   greater than or equal to 1896
    int32 start = 1;
    // The end year of the Olympics
    // Constraint:
    //   greater than or equal to 1896
    int32 end = 2;
}

