83 lines
2.7 KiB
Protocol Buffer
83 lines
2.7 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package brunix;
|
|
|
|
service AssistanceEngine {
|
|
// Respuesta completa — compatible con clientes existentes
|
|
rpc AskAgent (AgentRequest) returns (stream AgentResponse);
|
|
|
|
// Streaming real token a token desde Ollama
|
|
rpc AskAgentStream (AgentRequest) returns (stream AgentResponse);
|
|
|
|
// Evaluación RAGAS con Claude como juez
|
|
rpc EvaluateRAG (EvalRequest) returns (EvalResponse);
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// AskAgent / AskAgentStream — mismos mensajes, dos comportamientos
|
|
// ---------------------------------------------------------------------------
|
|
|
|
message AgentRequest {
|
|
// ── Core fields (v1) ──────────────────────────────────────────────────────
|
|
string query = 1;
|
|
string session_id = 2;
|
|
|
|
// ── Editor context fields (v2 — PRD-0002) ────────────────────────────────
|
|
// All three fields are optional. Clients that do not send them default to
|
|
// empty string. Existing clients remain fully compatible without changes.
|
|
|
|
// Full content of the active file open in the editor at query time.
|
|
// Gives the assistant awareness of the complete code the user is working on.
|
|
string editor_content = 3;
|
|
|
|
// Text currently selected in the editor, if any.
|
|
// Most precise signal of user intent — if non-empty, the question almost
|
|
// certainly refers to this specific code block.
|
|
string selected_text = 4;
|
|
|
|
// Free-form additional context (e.g. file path, language identifier,
|
|
// open diagnostic errors). Extensible without requiring future proto changes.
|
|
string extra_context = 5;
|
|
|
|
string user_info = 6;
|
|
}
|
|
|
|
message AgentResponse {
|
|
string text = 1;
|
|
string avap_code = 2;
|
|
bool is_final = 3;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// EvaluateRAG
|
|
// ---------------------------------------------------------------------------
|
|
|
|
message EvalRequest {
|
|
string category = 1;
|
|
int32 limit = 2;
|
|
string index = 3;
|
|
}
|
|
|
|
message EvalResponse {
|
|
string status = 1;
|
|
int32 questions_evaluated = 2;
|
|
float elapsed_seconds = 3;
|
|
string judge_model = 4;
|
|
string index = 5;
|
|
float faithfulness = 6;
|
|
float answer_relevancy = 7;
|
|
float context_recall = 8;
|
|
float context_precision = 9;
|
|
float global_score = 10;
|
|
string verdict = 11;
|
|
repeated QuestionDetail details = 12;
|
|
}
|
|
|
|
message QuestionDetail {
|
|
string id = 1;
|
|
string category = 2;
|
|
string question = 3;
|
|
string answer_preview = 4;
|
|
int32 n_chunks = 5;
|
|
}
|