-
Notifications
You must be signed in to change notification settings - Fork 5
feat(client): implement docling-serve-grpc service #329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
ff53468
1e22466
5c2f378
d1b989a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,3 +15,4 @@ build | |
| bin/ | ||
| !**/src/main/**/bin/ | ||
| !**/src/test/**/bin/ | ||
| /.ai/mcp/mcp.json | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| import com.google.protobuf.gradle.id | ||
|
|
||
| plugins { | ||
| id("docling-java-shared") | ||
| id("docling-lombok") | ||
| id("docling-release") | ||
| id("com.google.protobuf") version "0.9.4" | ||
| } | ||
|
|
||
| description = "Docling Serve gRPC API" | ||
|
|
||
| val grpcVersion = "1.72.0" | ||
| val protocVersion = "4.29.3" | ||
| val javaxAnnotationVersion = "1.3.2" | ||
|
|
||
| dependencies { | ||
| api(project(":docling-serve-api")) | ||
| api("io.grpc:grpc-stub:$grpcVersion") | ||
| api("io.grpc:grpc-protobuf:$grpcVersion") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably want to define the grpc dependencies in |
||
| api("com.google.protobuf:protobuf-java:$protocVersion") | ||
| api(libs.slf4j.api) | ||
| compileOnly("javax.annotation:javax.annotation-api:$javaxAnnotationVersion") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. Old habits, some of the older grpc stuck with javax.annotation until semi-recently. I think you're right. |
||
| api(platform(libs.jackson.bom)) | ||
| api(libs.jackson.databind) | ||
|
|
||
| testImplementation("org.mockito:mockito-core:5.17.0") | ||
| testImplementation("org.mockito:mockito-junit-jupiter:5.17.0") | ||
| testImplementation("io.grpc:grpc-testing:$grpcVersion") | ||
| testImplementation("io.grpc:grpc-inprocess:$grpcVersion") | ||
| testRuntimeOnly(libs.slf4j.simple) | ||
|
|
||
| // Integration test dependencies | ||
| testImplementation(platform(libs.testcontainers.bom)) | ||
| testImplementation(libs.testcontainers.junit.jupiter) | ||
| testImplementation(project(":docling-testcontainers")) | ||
| testImplementation(project(":docling-serve-client")) | ||
| testImplementation(platform(libs.jackson2.bom)) | ||
| testImplementation(libs.jackson2.databind) | ||
| } | ||
|
|
||
| protobuf { | ||
| protoc { | ||
| artifact = "com.google.protobuf:protoc:$protocVersion" | ||
| } | ||
|
|
||
| plugins { | ||
| id("grpc") { | ||
| artifact = "io.grpc:protoc-gen-grpc-java:$grpcVersion" | ||
| } | ||
| } | ||
|
|
||
| generateProtoTasks { | ||
| all().forEach { task -> | ||
| task.plugins { | ||
| id("grpc") | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package ai.docling.serve.grpc.v1; | ||
|
|
||
| import ai.docling.serve.api.chunk.request.HierarchicalChunkDocumentRequest; | ||
| import ai.docling.serve.api.chunk.request.HybridChunkDocumentRequest; | ||
| import ai.docling.serve.api.convert.request.ConvertDocumentRequest; | ||
| import ai.docling.serve.api.task.response.TaskStatusPollResponse; | ||
|
|
||
| interface AsyncTaskSubmitter { | ||
| TaskStatusPollResponse submitConvertSource(ConvertDocumentRequest request); | ||
|
|
||
| TaskStatusPollResponse submitChunkHierarchicalSource(HierarchicalChunkDocumentRequest request); | ||
|
|
||
| TaskStatusPollResponse submitChunkHybridSource(HybridChunkDocumentRequest request); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd probably want to pull all the versions of things (& the
com.google.protobufplugin version) out tolibs.versions.tomlto be consistent with the rest of the project.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem