Files
WeKnora/docreader/proto/docreader.proto
T
wizardchen 4192cfd072 refactor: simplify image handling in _resolve_images function
- Removed the image storage handling from the `_resolve_images` function, which now only decodes images and returns them as inline bytes.
- Updated the function's docstring to clarify that image persistence is managed by the Go App, and the return value for `image_dir_path` is always empty.
- Adjusted related gRPC and protobuf files to remove the `ConvertToPDF` method and its associated types, streamlining the API.
- Enhanced security measures in the frontend by implementing a placeholder for provider images and ensuring proper hydration of protected file images.

These changes improve the clarity and efficiency of image processing and API interactions within the application.
2026-03-03 22:23:23 +08:00

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;
}