syntax = "proto3";

package protocols.grpc.compose;

import "protocols/grpc/common/common.proto";
import "google/protobuf/struct.proto";

// Compose Brick 相關訊息
message Document {
  string doc_id = 1;
  string title = 2;
  string snippet = 3;
  float score = 4;
  google.protobuf.Struct metadata = 5;
}

message ComposeRequest {
  repeated Document input_documents = 1;
  string target_format = 2;    // 例: "json", "html", "markdown"
  string client_id = 3;      // 識別呼叫系統/應用來源
  string session_id = 4;     // 識別連續對話會話
  string request_id = 5;     // 唯一請求ID，用於追蹤和除錯
  string source_language = 6; // 輸入文件原始語言，如未提供可視為 target_language 相同
}

message ComposeResponse {
  google.protobuf.Struct output = 1;   // 格式化資料物件
  protocols.grpc.common.ErrorDetail error = 2;
}

service ComposeService {
  rpc GetServiceInfo(protocols.grpc.common.ServiceInfoRequest) returns (protocols.grpc.common.ServiceInfoResponse);
  rpc Unary(ComposeRequest) returns (ComposeResponse);
  rpc OutputStreaming(ComposeRequest) returns (stream ComposeResponse);
}
