|
1 | 1 | package ai.docling.serve.api; |
2 | 2 |
|
3 | | -import ai.docling.serve.api.chunk.request.HierarchicalChunkDocumentRequest; |
4 | | -import ai.docling.serve.api.chunk.request.HybridChunkDocumentRequest; |
5 | | -import ai.docling.serve.api.chunk.response.ChunkDocumentResponse; |
6 | | -import ai.docling.serve.api.convert.request.ConvertDocumentRequest; |
7 | | -import ai.docling.serve.api.convert.response.ConvertDocumentResponse; |
8 | | -import ai.docling.serve.api.health.HealthCheckResponse; |
9 | | - |
10 | 3 | /** |
11 | 4 | * Docling Serve API interface. |
12 | 5 | */ |
13 | | -public interface DoclingServeApi { |
14 | | - |
15 | | - /** |
16 | | - * Executes a health check for the API and retrieves the health status of the service. |
17 | | - * |
18 | | - * @return a {@link HealthCheckResponse} object containing the health status of the API. |
19 | | - */ |
20 | | - HealthCheckResponse health(); |
21 | | - |
22 | | - /** |
23 | | - * Converts the provided document source(s) into a processed document based on the specified options. |
24 | | - * |
25 | | - * @param request the {@link ConvertDocumentRequest} containing the source(s), conversion options, and optional target. |
26 | | - * @return a {@link ConvertDocumentResponse} containing the processed document data, processing details, and any errors. |
27 | | - */ |
28 | | - ConvertDocumentResponse convertSource(ConvertDocumentRequest request); |
29 | | - |
30 | | - /** |
31 | | - * Converts and chunks the provided document source(s) into a processed document based on the specified options |
32 | | - * and using a hierarchical chunker for splitting the document into smaller chunks. |
33 | | - */ |
34 | | - ChunkDocumentResponse chunkSourceWithHierarchicalChunker(HierarchicalChunkDocumentRequest request); |
35 | | - |
36 | | - /** |
37 | | - * Converts and chunks the provided document source(s) into a processed document based on the specified options |
38 | | - * and using a hybrid chunker for splitting the document into smaller chunks. |
39 | | - */ |
40 | | - ChunkDocumentResponse chunkSourceWithHybridChunker(HybridChunkDocumentRequest request); |
41 | | - |
| 6 | +public interface DoclingServeApi |
| 7 | + extends DoclingServeHealthApi, DoclingServeConvertApi, DoclingServeChunkApi, DoclingServeClearApi, DoclingServeTaskApi { |
42 | 8 | /** |
43 | 9 | * Creates and returns a builder instance capable of constructing a duplicate or modified |
44 | 10 | * version of the current API instance. The builder provides a customizable way to adjust |
@@ -98,6 +64,30 @@ default B logResponses() { |
98 | 64 | */ |
99 | 65 | B logResponses(boolean logResponses); |
100 | 66 |
|
| 67 | + /** |
| 68 | + * Configures whether the API client should format JSON requests and responses in a "pretty" format. |
| 69 | + * Pretty formatting organizes the response data to improve readability, |
| 70 | + * typically by adding spacing and line breaks. |
| 71 | + * |
| 72 | + * This setting does not affect the functional content of the response but can |
| 73 | + * assist with debugging or human-readable output for development purposes. |
| 74 | + * |
| 75 | + * @param prettyPrint {@code true} to enable pretty-printing of JSON requests and responses; |
| 76 | + * {@code false} to use compact formatting. |
| 77 | + * @return {@code this} builder instance for fluent API usage. |
| 78 | + */ |
| 79 | + B prettyPrint(boolean prettyPrint); |
| 80 | + |
| 81 | + /** |
| 82 | + * Configures the API client to format JSON requests and responses in a "pretty" format. |
| 83 | + * Pretty formatting improves readability by including spacing and line breaks. |
| 84 | + * |
| 85 | + * @return {@code this} builder instance for fluent API usage. |
| 86 | + */ |
| 87 | + default B prettyPrint() { |
| 88 | + return prettyPrint(true); |
| 89 | + } |
| 90 | + |
101 | 91 | /** |
102 | 92 | * Builds and returns an instance of the specified type, representing the completed configuration |
103 | 93 | * of the builder. The returned instance is typically an implementation of the Docling API. |
|
0 commit comments