Skip to content

Commit ba04133

Browse files
committed
Merge branch 'main' into feat/orchestration/embedding-conv
# Conflicts: # sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OrchestrationService.java
2 parents f16f752 + 8aed9af commit ba04133

File tree

67 files changed

+9436
-710
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+9436
-710
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "Cache Maven Dependencies"
2+
permissions:
3+
contents: read
4+
5+
on:
6+
workflow_dispatch:
7+
schedule:
8+
- cron: '57 4 * * Sun'
9+
10+
env:
11+
MAVEN_CACHE_REF: refs/heads/main
12+
MAVEN_CACHE_KEY: maven-dependencies
13+
MAVEN_CACHE_DIR: ~/.m2
14+
15+
jobs:
16+
update-cache:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: "Checkout"
20+
uses: actions/checkout@v5
21+
with:
22+
ref: ${{ env.MAVEN_CACHE_REF }}
23+
24+
- name: "Setup Java"
25+
uses: actions/setup-java@v5
26+
with:
27+
distribution: "sapmachine"
28+
java-version: 17
29+
30+
- name: "Download Dependencies"
31+
run: mvn -B dependency:go-offline
32+
33+
- name: "Delete Existing Caches"
34+
run: |
35+
CACHE_IDS=$(gh cache list --key "${{ env.MAVEN_CACHE_KEY }}" --ref "${{ env.MAVEN_CACHE_REF }}" --json id | jq -r '.[] | .id')
36+
for CACHE_ID in $CACHE_IDS; do
37+
echo "Deleting cache with ID: $CACHE_ID"
38+
gh cache delete "${CACHE_ID}"
39+
done
40+
env:
41+
GH_TOKEN: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
42+
43+
- name: "Cache Dependencies"
44+
uses: actions/cache/save@v4
45+
with:
46+
path: ${{ env.MAVEN_CACHE_DIR }}
47+
key: ${{ env.MAVEN_CACHE_KEY }}

.github/workflows/continuous-integration.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ env:
1010
MVN_MULTI_THREADED_ARGS: --batch-mode --no-transfer-progress --fail-at-end --show-version --threads 1C
1111
MVN_SKIP_CI_PLUGINS: -DskipFormatting -Denforcer.skip -Djacoco.skip -Dmdep.analyze.skip
1212
JAVA_VERSION: 17
13+
# keep the following two variables in sync with our 'cache-maven-dependencies.yaml' workflow
14+
MAVEN_CACHE_KEY: maven-dependencies
15+
MAVEN_CACHE_DIR: ~/.m2
1316

1417
jobs:
1518

@@ -33,6 +36,13 @@ jobs:
3336
java-version: ${{ env.JAVA_VERSION }}
3437
cache: 'maven'
3538

39+
- name: "Restore Dependencies"
40+
id: restore-dependencies
41+
uses: actions/cache/restore@v4
42+
with:
43+
key: ${{ env.MAVEN_CACHE_KEY }}
44+
path: ${{ env.MAVEN_CACHE_DIR }}
45+
3646
- name: "REUSE Compliance Check"
3747
uses: fsfe/reuse-action@v5
3848

.github/workflows/fosstars-report.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,16 @@ jobs:
4141
MVN_ARGS="${{ env.MVN_MULTI_THREADED_ARGS }} clean install -DskipTests -DskipFormatting"
4242
mvn $MVN_ARGS
4343
44+
- name: "Create settings.xml"
45+
run: |
46+
echo '${{ secrets.OSS_INDEX_SETTINGS_XML }}' > settings.xml
47+
4448
- name: "CVE Scan"
4549
env:
4650
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
47-
run: |
48-
mvn -T1 --no-transfer-progress --batch-mode org.owasp:dependency-check-maven:check org.owasp:dependency-check-maven:aggregate
51+
run: >
52+
mvn -T1 --no-transfer-progress -s settings.xml
53+
--batch-mode org.owasp:dependency-check-maven:check org.owasp:dependency-check-maven:aggregate
4954
5055
- name: "Archive CVE Report"
5156
uses: actions/upload-artifact@v4

.github/workflows/spec-update.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ on:
2727
env:
2828
MVN_MULTI_THREADED_ARGS: --batch-mode --no-transfer-progress --fail-at-end --show-version --threads 1C
2929
JAVA_VERSION: 17
30+
# keep the following two variables in sync with our 'cache-maven-dependencies.yaml' workflow
31+
MAVEN_CACHE_KEY: maven-dependencies
32+
MAVEN_CACHE_DIR: ~/.m2
3033

3134
jobs:
3235
generate:
@@ -59,6 +62,13 @@ jobs:
5962
java-version: ${{ env.JAVA_VERSION }}
6063
cache: 'maven'
6164

65+
- name: "Restore Dependencies"
66+
id: restore-dependencies
67+
uses: actions/cache/restore@v4
68+
with:
69+
key: ${{ env.MAVEN_CACHE_KEY }}
70+
path: ${{ env.MAVEN_CACHE_DIR }}
71+
6272
- name: "Checkout or Create Branch"
6373
id: branch
6474
# Checkout branch if it exists, otherwise create it

README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,26 @@ The SDK simplifies the setup and interaction with SAP AI Core, allowing you to f
3030

3131
## General Requirements
3232

33-
To use the SDK in a Java application, it is necessary to understand the technical prerequisites and required versions for common dependencies.
33+
#### Development Environment
3434

35-
- Java 17 or higher.
36-
- Access to an **SAP AI Core Service** instance.
35+
These are required on the developer side to build and run applications with the SDK:
3736

38-
Please refer to [this documentation on **how to connect the SDK to AI Core**](https://sap.github.io/ai-sdk/docs/java/guides/connecting-to-ai-core).
37+
* **Java JDK**: 17 or higher (21 LTS recommended).
38+
* **SAP Cloud SDK**: 5.6.0 or later (latest recommended, added as a Maven dependency).
3939

40-
The following table lists the required versions, based on the latest release:
40+
#### SAP AI Core Service instance
4141

42-
| Dependency | Minimum Version | Recommended Version |
43-
|------------------------|-----------------|---------------------|
44-
| JDK | 17 (LTS) | 21 (LTS) |
45-
| SAP Cloud SDK | 5.6.0 | latest |
46-
| (optional) CAP Java | 3.0.0 | latest |
47-
| (optional) Spring Boot | 3.0 | latest |
48-
| (optional) Spring AI | 1.0.0 | latest |
42+
To make of use the services supported by the SDK, you need to have access to an SAP AI Core Service instance. Checkout [how to connect](link).
4943

50-
See [an example `pom.xml` in our Spring Boot application](sample-code/spring-app/pom.xml).
44+
#### Optional Integrations
45+
46+
The SDK can be combined with popular Java frameworks. These are not required for core functionality, but version compatibility is listed for reference:
47+
48+
* **Spring AI** ≥ 1.0.0
49+
* **Spring Boot** ≥ 3.0
50+
* **CAP Java** ≥ 3.0.0
51+
52+
👉 See an [example `pom.xml`](link) in our sample Spring Boot application.
5153

5254
> [!WARNING]
5355
> All classes under any of the `...model` packages are generated from an OpenAPI specification and marked as `@Beta`.

core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/PipelinesApi.java

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
import com.sap.ai.sdk.grounding.model.GetPipelineStatus;
1010
import com.sap.ai.sdk.grounding.model.GetPipelines;
1111
import com.sap.ai.sdk.grounding.model.ManualPipelineTrigger;
12+
import com.sap.ai.sdk.grounding.model.PatchPipeline;
1213
import com.sap.ai.sdk.grounding.model.PipelineDocumentResponse;
1314
import com.sap.ai.sdk.grounding.model.PipelineId;
15+
import com.sap.ai.sdk.grounding.model.SearchPipeline;
16+
import com.sap.ai.sdk.grounding.model.SearchPipelinesResponse;
1417
import com.sap.cloud.sdk.cloudplatform.connectivity.Destination;
1518
import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient;
1619
import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService;
@@ -1004,6 +1007,188 @@ public GetPipelineStatus getPipelineStatus(
10041007
localVarReturnType);
10051008
}
10061009

1010+
/**
1011+
* Patch pipeline
1012+
*
1013+
* <p>Patch a pipeline by pipeline id
1014+
*
1015+
* <p><b>204</b> - No Content
1016+
*
1017+
* <p><b>400</b> - The specification of the resource was incorrect
1018+
*
1019+
* @param aiResourceGroup Resource Group ID
1020+
* @param pipelineId The ID of the pipeline to patch.
1021+
* @param patchPipeline The value for the parameter patchPipeline
1022+
* @return An OpenApiResponse containing the status code of the HttpResponse.
1023+
* @throws OpenApiRequestException if an error occurs while attempting to invoke the API
1024+
*/
1025+
@Nonnull
1026+
public OpenApiResponse patchPipelineById(
1027+
@Nonnull final String aiResourceGroup,
1028+
@Nonnull final String pipelineId,
1029+
@Nonnull final PatchPipeline patchPipeline)
1030+
throws OpenApiRequestException {
1031+
final Object localVarPostBody = patchPipeline;
1032+
1033+
// verify the required parameter 'aiResourceGroup' is set
1034+
if (aiResourceGroup == null) {
1035+
throw new OpenApiRequestException(
1036+
"Missing the required parameter 'aiResourceGroup' when calling patchPipelineById");
1037+
}
1038+
1039+
// verify the required parameter 'pipelineId' is set
1040+
if (pipelineId == null) {
1041+
throw new OpenApiRequestException(
1042+
"Missing the required parameter 'pipelineId' when calling patchPipelineById");
1043+
}
1044+
1045+
// verify the required parameter 'patchPipeline' is set
1046+
if (patchPipeline == null) {
1047+
throw new OpenApiRequestException(
1048+
"Missing the required parameter 'patchPipeline' when calling pipelineV1PipelineEndpointsPatchPipelineById");
1049+
}
1050+
1051+
// create path and map variables
1052+
final Map<String, Object> localVarPathParams = new HashMap<String, Object>();
1053+
localVarPathParams.put("pipelineId", pipelineId);
1054+
final String localVarPath =
1055+
UriComponentsBuilder.fromPath("/pipelines/{pipelineId}")
1056+
.buildAndExpand(localVarPathParams)
1057+
.toUriString();
1058+
1059+
final MultiValueMap<String, String> localVarQueryParams =
1060+
new LinkedMultiValueMap<String, String>();
1061+
final HttpHeaders localVarHeaderParams = new HttpHeaders();
1062+
final MultiValueMap<String, Object> localVarFormParams =
1063+
new LinkedMultiValueMap<String, Object>();
1064+
1065+
if (aiResourceGroup != null)
1066+
localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup));
1067+
1068+
final String[] localVarAccepts = {"application/json"};
1069+
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
1070+
final String[] localVarContentTypes = {"application/json"};
1071+
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
1072+
1073+
final String[] localVarAuthNames = new String[] {};
1074+
1075+
final ParameterizedTypeReference<Void> localVarReturnType =
1076+
new ParameterizedTypeReference<Void>() {};
1077+
apiClient.invokeAPI(
1078+
localVarPath,
1079+
HttpMethod.PATCH,
1080+
localVarQueryParams,
1081+
localVarPostBody,
1082+
localVarHeaderParams,
1083+
localVarFormParams,
1084+
localVarAccept,
1085+
localVarContentType,
1086+
localVarAuthNames,
1087+
localVarReturnType);
1088+
return new OpenApiResponse(apiClient);
1089+
}
1090+
1091+
/**
1092+
* Pipeline Search by Metadata
1093+
*
1094+
* <p>Search for pipelines based on metadata
1095+
*
1096+
* <p><b>200</b> - Returns pipelines for the tenant that matches the metadata
1097+
*
1098+
* <p><b>400</b> - The specification of the resource was incorrect
1099+
*
1100+
* @param aiResourceGroup (required) Resource Group ID
1101+
* @param searchPipeline (required) The value for the parameter searchPipeline
1102+
* @param $top (optional) Number of results to display
1103+
* @param $skip (optional) Number of results to be skipped from the ordered list of results
1104+
* @param $count (optional) When the $count field is set to false, the response contains a count
1105+
* of the items present in the response. When the $count field is set to true, the response
1106+
* contains a count of all the items present on the server, and not just the ones in the
1107+
* response. When the $count field is not passed, it is false by default.
1108+
* @return SearchPipelinesResponse
1109+
* @throws OpenApiRequestException if an error occurs while attempting to invoke the API
1110+
*/
1111+
@Nonnull
1112+
public SearchPipelinesResponse searchPipelinesByMetadata(
1113+
@Nonnull final String aiResourceGroup,
1114+
@Nonnull final SearchPipeline searchPipeline,
1115+
@Nullable final Integer $top,
1116+
@Nullable final Integer $skip,
1117+
@Nullable final Boolean $count)
1118+
throws OpenApiRequestException {
1119+
final Object localVarPostBody = searchPipeline;
1120+
1121+
// verify the required parameter 'aiResourceGroup' is set
1122+
if (aiResourceGroup == null) {
1123+
throw new OpenApiRequestException(
1124+
"Missing the required parameter 'aiResourceGroup' when calling searchPipelinesByMetadata");
1125+
}
1126+
1127+
// verify the required parameter 'searchPipeline' is set
1128+
if (searchPipeline == null) {
1129+
throw new OpenApiRequestException(
1130+
"Missing the required parameter 'searchPipeline' when calling pipelineV1PipelineEndpointsSearchPipeline");
1131+
}
1132+
1133+
final String localVarPath =
1134+
UriComponentsBuilder.fromPath("/pipelines/search").build().toUriString();
1135+
1136+
final MultiValueMap<String, String> localVarQueryParams =
1137+
new LinkedMultiValueMap<String, String>();
1138+
final HttpHeaders localVarHeaderParams = new HttpHeaders();
1139+
final MultiValueMap<String, Object> localVarFormParams =
1140+
new LinkedMultiValueMap<String, Object>();
1141+
1142+
localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$top", $top));
1143+
localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$skip", $skip));
1144+
localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$count", $count));
1145+
1146+
if (aiResourceGroup != null)
1147+
localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup));
1148+
1149+
final String[] localVarAccepts = {"application/json"};
1150+
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
1151+
final String[] localVarContentTypes = {"application/json"};
1152+
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
1153+
1154+
final String[] localVarAuthNames = new String[] {};
1155+
1156+
final ParameterizedTypeReference<SearchPipelinesResponse> localVarReturnType =
1157+
new ParameterizedTypeReference<SearchPipelinesResponse>() {};
1158+
return apiClient.invokeAPI(
1159+
localVarPath,
1160+
HttpMethod.POST,
1161+
localVarQueryParams,
1162+
localVarPostBody,
1163+
localVarHeaderParams,
1164+
localVarFormParams,
1165+
localVarAccept,
1166+
localVarContentType,
1167+
localVarAuthNames,
1168+
localVarReturnType);
1169+
}
1170+
1171+
/**
1172+
* Pipeline Search by Metadata
1173+
*
1174+
* <p>Search for pipelines based on metadata
1175+
*
1176+
* <p><b>200</b> - Returns pipelines for the tenant that matches the metadata
1177+
*
1178+
* <p><b>400</b> - The specification of the resource was incorrect
1179+
*
1180+
* @param aiResourceGroup Resource Group ID
1181+
* @param searchPipeline The value for the parameter searchPipeline
1182+
* @return SearchPipelinesResponse
1183+
* @throws OpenApiRequestException if an error occurs while attempting to invoke the API
1184+
*/
1185+
@Nonnull
1186+
public SearchPipelinesResponse searchPipelinesByMetadata(
1187+
@Nonnull final String aiResourceGroup, @Nonnull final SearchPipeline searchPipeline)
1188+
throws OpenApiRequestException {
1189+
return searchPipelinesByMetadata(aiResourceGroup, searchPipeline, null, null, null);
1190+
}
1191+
10071192
/**
10081193
* Pipeline Trigger
10091194
*

0 commit comments

Comments
 (0)