Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
module:
- docling-serve-api
- docling-serve-client
- docling-serve-grpc
- docling-testcontainers
- docling-version-tests
name: jvm-build-test-${{ matrix.module }}-java${{ matrix.java }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ build
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/
/.ai/mcp/mcp.json
59 changes: 59 additions & 0 deletions docling-serve/docling-serve-grpc/build.gradle.kts
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"
Copy link
Contributor

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.protobuf plugin version) out to libs.versions.toml to be consistent with the rest of the project.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem


dependencies {
api(project(":docling-serve-api"))
api("io.grpc:grpc-stub:$grpcVersion")
api("io.grpc:grpc-protobuf:$grpcVersion")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably want to define the grpc dependencies in libs.versions.toml to remain consistent with the rest of the project.

api("com.google.protobuf:protobuf-java:$protocVersion")
api(libs.slf4j.api)
compileOnly("javax.annotation:javax.annotation-api:$javaxAnnotationVersion")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be jakarta.annotation:jakarta.annotation-api?

Copy link
Author

Choose a reason for hiding this comment

The 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);
}
Loading