From 13780dfc3e847d9ef9f527d703c1a80ced6f2270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Wed, 7 Jan 2026 15:12:41 +0100 Subject: [PATCH 1/5] Update warning about generated classes in prompt registry Clarified the warning about model and client classes generated from OpenAPI specifications, emphasizing stability and maintenance. --- docs-java/ai-core/prompt-registry.mdx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs-java/ai-core/prompt-registry.mdx b/docs-java/ai-core/prompt-registry.mdx index ddbc58839..c4d22ce85 100644 --- a/docs-java/ai-core/prompt-registry.mdx +++ b/docs-java/ai-core/prompt-registry.mdx @@ -16,9 +16,11 @@ keywords: This guide provides examples on how to manage the life cycle of your prompts, from design to runtime in [Prompt Registry](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/prompt-registry). :::warning -All classes under any of the `...model` packages are generated from an OpenAPI specification. -This means that these model classes are not guaranteed to be stable and may change with future releases. -They are safe to use, but may require updates even in minor releases. +All classes in the `...model` and `...client` packages are generated from an OpenAPI specification. +These classes are therefore not guaranteed to be stable and may change in future releases. +They can be used safely, but even minor releases may require code updates. +Maintenance and support are limited to ensuring consistency with the service specification. +No additional convenience API layer is provided. ::: ## Prerequisites From c29e333e5ce4bd23187e97a69efcec3526e1ec59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Wed, 7 Jan 2026 15:14:15 +0100 Subject: [PATCH 2/5] Update warning about model and client packages Clarified stability and maintenance of generated classes. --- docs-java/ai-core/document-grounding.mdx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs-java/ai-core/document-grounding.mdx b/docs-java/ai-core/document-grounding.mdx index d94806413..98c52d33e 100644 --- a/docs-java/ai-core/document-grounding.mdx +++ b/docs-java/ai-core/document-grounding.mdx @@ -17,9 +17,11 @@ This guide provides examples on how to manage data in [SAP Document Grounding](h It's divided into two main sections: Data Ingestion and Data Retrieval. :::warning -All classes under any of the `...model` packages are generated from an OpenAPI specification. -This means that these model classes are not guaranteed to be stable and may change with future releases. -They are safe to use, but may require updates even in minor releases. +All classes in the `...model` and `...client` packages are generated from an OpenAPI specification. +These classes are therefore not guaranteed to be stable and may change in future releases. +They can be used safely, but even minor releases may require code updates. +Maintenance and support are limited to ensuring consistency with the service specification. +No additional convenience API layer is provided. ::: ## Prerequisites From c576534045c29d0343a253b9b18d40690dfb4e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Wed, 7 Jan 2026 15:24:00 +0100 Subject: [PATCH 3/5] Enhance document-grounding.mdx with Vector API examples Added examples for document creation and search using the Vector API. --- docs-java/ai-core/document-grounding.mdx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs-java/ai-core/document-grounding.mdx b/docs-java/ai-core/document-grounding.mdx index 98c52d33e..73ef12b52 100644 --- a/docs-java/ai-core/document-grounding.mdx +++ b/docs-java/ai-core/document-grounding.mdx @@ -80,6 +80,8 @@ PipelineStatus status = api.getPipelineStatus(resourceGroupId, pipeline.getPipel ### Vector API +Document creation: + ```java var api = new GroundingClient().vector(); var resourceGroupId = "default"; @@ -98,6 +100,22 @@ var request = DocumentCreateRequest.create() DocumentsListResponse response = api.createDocuments(resourceGroupId, collectionId, request); ``` +Document search: + +```java +String resourceGroup; +TextSearchRequest textSearch; +var api = new GroundingClient().vector(); +var result = api.search(resourceGroup, textSearch); + +String joinedContent = result.getResults().stream() + .flatMap(r -> r.getResults().stream()) + .flatMap(r -> r.getDocuments().stream()) + .flatMap(d -> d.getChunks().stream()) + .map(VectorChunk::getContent) + .collect(Collectors.joining()); +``` + Refer to the [GroundingController](https://github.com/SAP/ai-sdk-java/tree/main/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java) in our Spring Boot application for a complete example. ## Data Retrieval From b515e4dedc9bfca5b937d8e057fef0bfcc51a7d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Wed, 7 Jan 2026 15:28:22 +0100 Subject: [PATCH 4/5] Add Vector API examples for collection and document creation Added examples for collection and document creation using the Vector API. --- docs-java/ai-core/document-grounding.mdx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs-java/ai-core/document-grounding.mdx b/docs-java/ai-core/document-grounding.mdx index 73ef12b52..4edef30ec 100644 --- a/docs-java/ai-core/document-grounding.mdx +++ b/docs-java/ai-core/document-grounding.mdx @@ -80,6 +80,21 @@ PipelineStatus status = api.getPipelineStatus(resourceGroupId, pipeline.getPipel ### Vector API +Collection creation: + +``` +String resourceGroupId; +CollectionRequest collectionRequest; + +var api = new GroundingClient().vector(); + +OpenApiResponse documents = api.createCollection(resourceGroupId, collectionRequest); +Map> headers = documents.getHeaders(); + +String locationHeader = headers.get("Location").get(0); +String collectionId = locationHeader.replaceAll("^.*?/([a-f0-9-]+)/.*?$", "$1"); +``` + Document creation: ```java @@ -105,6 +120,7 @@ Document search: ```java String resourceGroup; TextSearchRequest textSearch; + var api = new GroundingClient().vector(); var result = api.search(resourceGroup, textSearch); From 0e95f7e1319a53590eee3093f520703ca76d73b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Wed, 7 Jan 2026 15:35:30 +0100 Subject: [PATCH 5/5] Apply suggestions from code review --- docs-java/ai-core/document-grounding.mdx | 3 +-- docs-java/ai-core/prompt-registry.mdx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs-java/ai-core/document-grounding.mdx b/docs-java/ai-core/document-grounding.mdx index 4edef30ec..f706f66df 100644 --- a/docs-java/ai-core/document-grounding.mdx +++ b/docs-java/ai-core/document-grounding.mdx @@ -18,8 +18,7 @@ It's divided into two main sections: Data Ingestion and Data Retrieval. :::warning All classes in the `...model` and `...client` packages are generated from an OpenAPI specification. -These classes are therefore not guaranteed to be stable and may change in future releases. -They can be used safely, but even minor releases may require code updates. +These classes can be used, but no API stability guarantees are provided, even for minor releases. Maintenance and support are limited to ensuring consistency with the service specification. No additional convenience API layer is provided. ::: diff --git a/docs-java/ai-core/prompt-registry.mdx b/docs-java/ai-core/prompt-registry.mdx index c4d22ce85..7a5039766 100644 --- a/docs-java/ai-core/prompt-registry.mdx +++ b/docs-java/ai-core/prompt-registry.mdx @@ -17,8 +17,7 @@ This guide provides examples on how to manage the life cycle of your prompts, fr :::warning All classes in the `...model` and `...client` packages are generated from an OpenAPI specification. -These classes are therefore not guaranteed to be stable and may change in future releases. -They can be used safely, but even minor releases may require code updates. +These classes can be used, but no API stability guarantees are provided, even for minor releases. Maintenance and support are limited to ensuring consistency with the service specification. No additional convenience API layer is provided. :::