syntax = "proto3";

message ChatMessageRequest {
    uint64 thread_id = 1;
    string message = 2;
    string sender_id = 3;
    string recipient_id = 4;
    string session_id = 5;
}

message ChatMessageResponse {
    uint64 id = 1;
}

message ChatMessage {
    uint64 id = 1;
    uint64 thread_id = 2;
    string message = 3;
    string sender_id = 4;
    string recipient_id = 5;
    string session_id = 6;
    string timestamp = 7;
}

message ChatClient {
    string recipient_id = 1;
    string session_id = 2;
}

service ChatService {
    rpc SendMessage(ChatMessageRequest) returns (ChatMessageResponse);
    rpc ReceiveMessages(ChatClient) returns (stream ChatMessage);
}


// Command to generate python files:
// python -m grpc_tools.protoc -I protos --python_out=. --pyi_out=. --grpc_python_out=. protos/chatservice.proto
