WIP on persisting chat history on daemon
This commit is contained in:
@@ -2,13 +2,37 @@ syntax = "proto3";
|
||||
package ai_daemon;
|
||||
|
||||
service AiDaemon {
|
||||
rpc Prompt (PromptRequest) returns (PromptResponse);
|
||||
rpc Prompt(PromptRequest) returns (PromptResponse);
|
||||
rpc Chat(ChatRequest) returns (ChatResponse);
|
||||
rpc ChatHistory(ChatHistoryRequest) returns (ChatHistoryResponse);
|
||||
}
|
||||
|
||||
message ChatResponse {
|
||||
int64 id = 1;
|
||||
int64 chat_id = 2;
|
||||
string text = 10;
|
||||
bool is_user = 20;
|
||||
}
|
||||
|
||||
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 ChatResponse history = 10;
|
||||
}
|
||||
|
||||
message PromptRequest {
|
||||
string prompt = 1;
|
||||
string prompt = 1;
|
||||
}
|
||||
|
||||
message PromptResponse {
|
||||
string response = 1;
|
||||
string response = 1;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
pub mod ai {
|
||||
tonic::include_proto!("ai_daemon");
|
||||
|
||||
pub const FILE_DESCRIPTOR_SET: &[u8] = tonic::include_file_descriptor_set!("ai_service_descriptor");
|
||||
}
|
||||
pub const FILE_DESCRIPTOR_SET: &[u8] =
|
||||
tonic::include_file_descriptor_set!("ai_service_descriptor");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user