62 lines
1.5 KiB
Protocol Buffer
62 lines
1.5 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package docreader;
|
|
|
|
option go_package = "github.com/Tencent/WeKnora/internal/docreader/proto";
|
|
|
|
service DocReader {
|
|
rpc Read(ReadRequest) returns (ReadResponse) {}
|
|
rpc ListEngines(ListEnginesRequest) returns (ListEnginesResponse) {}
|
|
}
|
|
|
|
message ReadConfig {
|
|
string parser_engine = 1;
|
|
map<string, string> parser_engine_overrides = 2;
|
|
// image_storage removed: image persistence is now handled entirely by the Go App.
|
|
// Field number 3 is reserved for backward compatibility.
|
|
reserved 3;
|
|
}
|
|
|
|
// Unified read request: set file_content for file mode, url for URL mode.
|
|
message ReadRequest {
|
|
bytes file_content = 1;
|
|
string file_name = 2;
|
|
string file_type = 3;
|
|
string url = 4;
|
|
string title = 5;
|
|
ReadConfig config = 6;
|
|
string request_id = 7;
|
|
}
|
|
|
|
message ImageRef {
|
|
string filename = 1;
|
|
string original_ref = 2;
|
|
string mime_type = 3;
|
|
string storage_key = 4; // download URL from shared storage
|
|
bytes image_data = 5; // inline bytes fallback
|
|
}
|
|
|
|
message ReadResponse {
|
|
string markdown_content = 1;
|
|
repeated ImageRef image_refs = 2;
|
|
string image_dir_path = 3;
|
|
map<string, string> metadata = 4;
|
|
string error = 5;
|
|
}
|
|
|
|
message ListEnginesRequest {
|
|
map<string, string> config_overrides = 1;
|
|
}
|
|
|
|
message ParserEngineInfo {
|
|
string name = 1;
|
|
string description = 2;
|
|
repeated string file_types = 3;
|
|
bool available = 4;
|
|
string unavailable_reason = 5;
|
|
}
|
|
|
|
message ListEnginesResponse {
|
|
repeated ParserEngineInfo engines = 1;
|
|
}
|