API Docs Help

Page Internal

AI Pedant Document Service API (proto file)

This document describes the gRPC API defined in the document_service.proto file for document-related internal communication functionalities.

Dependencies

  • google/protobuf/empty.proto: Used for empty response messages.

  • common.proto: Defines shared message types used across other services.

Services

The PageInternalService offers gRPC methods for managing document pages and line items.

Functions:

  1. SubmitPages: Submits multiple pages.

  2. SubmitLineItems: Submits line items.

Messages

SubmitOnePage:

  • uuid: Unique identifier of the page.

  • status: Status of the page.

  • width: Width of the page.

  • height: Height of the page.

  • data: Data of the page.

SubmitPagesRequest:

  • type: Type of document.

  • pages: List of pages to be submitted.

SubmitLineItemsRequest:

  • uuid: Unique identifier.

  • table_list: List of tables.

TableList:

  • cells: List of cells in the table.

Cell:

  • box: Bounding box coordinates.

  • text: Text content of the cell.

  • start_row: Start row index.

  • end_row: End row index.

  • start_column: Start column index.

  • end_column: End column index.

  • column_type: Type of column.

Proto Definition (Markdown format)

syntax = "proto3"; package ai.pedant.srv.document; option java_package = "ai.pedant.srv.document"; option go_package = "pedant.ai/pedant-document-service/grpc-gateway"; import "google/protobuf/empty.proto"; import "common.proto"; service PageInternalService { rpc SubmitPages(SubmitPagesRequest) returns (google.protobuf.Empty); rpc SubmitLineItems(SubmitLineItemsRequest) returns (google.protobuf.Empty); } enum PageStatus { created = 0; scanning = 1; extracted = 2; predicted = 3; done = 4; } message SubmitOnePage { string uuid = 1; PageStatus status = 2; float width = 3; float height = 4; string data = 5; } message SubmitPagesRequest { DocumentType type = 3; repeated SubmitOnePage pages = 1; } message SubmitLineItemsRequest { string uuid = 1; repeated TableList table_list = 2; } message TableList { repeated Cell cells = 1; } message Cell { repeated float box = 1; string text = 2; float start_row = 3; float end_row = 4; float start_column = 5; float end_column = 6; string column_type = 7; }
Last modified: 20 October 2024