44 lines
859 B
Protocol Buffer
44 lines
859 B
Protocol Buffer
syntax = "proto3";
|
|
package ai_daemon;
|
|
|
|
service AiService {
|
|
rpc Chat(ChatRequest) returns (ChatResponse);
|
|
rpc ChatHistory(ChatHistoryRequest) returns (ChatHistoryResponse);
|
|
rpc DaemonStatus(DaemonStatusRequest) returns (DaemonStatusResponse);
|
|
}
|
|
|
|
message ChatMessage {
|
|
int64 id = 1;
|
|
int64 chat_id = 2;
|
|
string text = 10;
|
|
bool is_user = 20;
|
|
}
|
|
|
|
message ChatResponse {
|
|
int64 chat_id = 2;
|
|
repeated ChatMessage messages = 10;
|
|
}
|
|
|
|
message ChatRequest {
|
|
optional int64 chat_id = 1;
|
|
optional string text = 10;
|
|
}
|
|
|
|
message ChatHistoryRequest {
|
|
// If not set last chat is returned
|
|
optional int64 chat_id = 1;
|
|
}
|
|
|
|
message ChatHistoryResponse {
|
|
int64 chat_id = 1;
|
|
repeated ChatMessage history = 10;
|
|
}
|
|
|
|
message DaemonStatusRequest {}
|
|
|
|
message DaemonStatusResponse {
|
|
bool is_ok = 1;
|
|
optional string message = 10;
|
|
optional string error = 20;
|
|
}
|