From 22b7d68b1a5aacb1e3917b895689577f38c97a0f Mon Sep 17 00:00:00 2001 From: SAP Cloud SDK Bot Date: Mon, 7 Jul 2025 09:06:00 +0000 Subject: [PATCH 01/10] Update grounding based on main --- .../ai/sdk/grounding/client/PipelinesApi.java | 686 +++++++++- .../ai/sdk/grounding/client/RetrievalApi.java | 57 +- .../ai/sdk/grounding/client/VectorApi.java | 118 +- .../sap/ai/sdk/grounding/model/ApiError.java | 4 +- .../ai/sdk/grounding/model/BaseDocument.java | 4 +- .../grounding/model/BasePipelineResponse.java | 270 ++++ .../com/sap/ai/sdk/grounding/model/Chunk.java | 4 +- .../ai/sdk/grounding/model/Collection.java | 6 +- .../model/CollectionCreatedResponse.java | 4 +- .../model/CollectionDeletedResponse.java | 4 +- .../model/CollectionPendingResponse.java | 15 +- .../grounding/model/CollectionRequest.java | 6 +- .../model/CollectionsListResponse.java | 82 +- ...guration.java => CommonConfiguration.java} | 107 +- .../sdk/grounding/model/CreatePipeline.java | 31 + .../sdk/grounding/model/DataRepositories.java | 82 +- .../sdk/grounding/model/DataRepository.java | 4 +- ... DataRepositoryPerFilterSearchResult.java} | 93 +- ...t.java => DataRepositorySearchResult.java} | 67 +- ....java => DataRepositorySearchResults.java} | 67 +- .../grounding/model/DataRepositoryType.java | 6 +- .../model/DataRepositoryWithDocuments.java | 19 +- .../grounding/model/DetailsErrorResponse.java | 4 +- .../{RetrievalDocument.java => Document.java} | 120 +- .../model/DocumentCreateRequest.java | 4 +- .../ai/sdk/grounding/model/DocumentInput.java | 4 +- .../model/DocumentKeyValueListPair.java | 4 +- .../sdk/grounding/model/DocumentOutput.java | 4 +- .../sdk/grounding/model/DocumentResponse.java | 4 +- .../sdk/grounding/model/DocumentStatus.java | 72 + .../model/DocumentUpdateRequest.java | 4 +- .../model/DocumentWithoutChunks.java | 4 +- .../sap/ai/sdk/grounding/model/Documents.java | 82 +- .../sdk/grounding/model/DocumentsChunk.java | 4 +- .../model/DocumentsListResponse.java | 4 +- .../model/DocumentsStatusResponse.java | 228 ++++ ...DocumentsStatusResponseResourcesInner.java | 217 +++ .../sdk/grounding/model/EmbeddingConfig.java | 4 +- .../ai/sdk/grounding/model/GetPipeline.java | 31 + .../model/GetPipelineExecutionById.java | 284 ++++ .../model/GetPipelineExecutions.java | 226 ++++ .../grounding/model/GetPipelineStatus.java | 207 +++ .../{Pipelines.java => GetPipelines.java} | 134 +- .../grounding/model/HTTPValidationError.java | 188 +++ .../ai/sdk/grounding/model/InlineObject.java | 4 +- .../sdk/grounding/model/KeyValueListPair.java | 4 +- ...on.java => MSSharePointConfiguration.java} | 102 +- .../MSSharePointConfigurationGetResponse.java | 232 ++++ .../MSSharePointPipelineCreateRequest.java | 339 +++++ .../MSSharePointPipelineGetResponse.java | 391 ++++++ .../{PipelineStatus.java => MetaData.java} | 87 +- .../model/PerFilterSearchResult.java | 4 +- ...r.java => PerFilterSearchResultError.java} | 67 +- .../model/PerFilterSearchResultWithError.java | 228 ++++ .../sap/ai/sdk/grounding/model/Pipeline.java | 244 ---- .../model/PipelineDocumentResponse.java | 329 +++++ .../model/PipelineExecutionData.java | 208 +++ .../model/PipelineExecutionStatus.java | 72 + .../ai/sdk/grounding/model/PipelineId.java | 4 +- .../grounding/model/PipelinePostRequst.java | 236 ---- .../ai/sdk/grounding/model/ResultsInner.java | 4 +- .../ai/sdk/grounding/model/ResultsInner1.java | 66 +- .../model/RetrievalSearchConfiguration.java | 224 ++++ .../model/RetrievalSearchFilter.java | 13 +- .../model/S3PipelineCreateRequest.java | 328 +++++ .../model/S3PipelineGetResponse.java | 378 ++++++ .../model/SFTPPipelineCreateRequest.java | 331 +++++ .../model/SFTPPipelineGetResponse.java | 378 ++++++ .../grounding/model/SearchConfiguration.java | 8 +- .../model/SearchDocumentKeyValueListPair.java | 4 +- .../ai/sdk/grounding/model/SearchFilter.java | 4 +- ...ievalSearchInput.java => SearchInput.java} | 93 +- .../ai/sdk/grounding/model/SearchResults.java | 4 +- .../model/SearchSelectOptionEnum.java | 4 +- ...nSharePoint.java => SharePointConfig.java} | 81 +- ....java => SharePointConfigGetResponse.java} | 81 +- ...harePointSite.java => SharePointSite.java} | 107 +- ...te.java => SharePointSiteGetResponse.java} | 118 +- .../grounding/model/TextOnlyBaseChunk.java | 4 +- .../grounding/model/TextSearchRequest.java | 4 +- .../sdk/grounding/model/ValidationError.java | 308 +++++ ...etCollectionCreationStatus200Response.java | 4 +- ...etCollectionDeletionStatus200Response.java | 4 +- .../src/main/resources/spec/grounding.yaml | 1194 ++++++++++++----- 84 files changed, 8034 insertions(+), 1830 deletions(-) create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/BasePipelineResponse.java rename core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/{PipelineConfiguration.java => CommonConfiguration.java} (55%) create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CreatePipeline.java rename core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/{RetievalPerFilterSearchResult.java => DataRepositoryPerFilterSearchResult.java} (54%) rename core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/{RetievalDataRepositorySearchResult.java => DataRepositorySearchResult.java} (62%) rename core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/{RetievalSearchResults.java => DataRepositorySearchResults.java} (62%) rename core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/{RetrievalDocument.java => Document.java} (58%) create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentStatus.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsStatusResponse.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsStatusResponseResourcesInner.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipeline.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipelineExecutionById.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipelineExecutions.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipelineStatus.java rename core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/{Pipelines.java => GetPipelines.java} (58%) create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/HTTPValidationError.java rename core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/{PipelinePostRequstConfiguration.java => MSSharePointConfiguration.java} (53%) create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/MSSharePointConfigurationGetResponse.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/MSSharePointPipelineCreateRequest.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/MSSharePointPipelineGetResponse.java rename core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/{PipelineStatus.java => MetaData.java} (54%) rename core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/{RetievalPerFilterSearchResultWithError.java => PerFilterSearchResultError.java} (59%) create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResultWithError.java delete mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipeline.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineDocumentResponse.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineExecutionData.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineExecutionStatus.java delete mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchConfiguration.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/S3PipelineCreateRequest.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/S3PipelineGetResponse.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SFTPPipelineCreateRequest.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SFTPPipelineGetResponse.java rename core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/{RetrievalSearchInput.java => SearchInput.java} (60%) rename core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/{PipelineConfigurationSharePoint.java => SharePointConfig.java} (57%) rename core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/{PipelinePostRequstConfigurationSharePoint.java => SharePointConfigGetResponse.java} (53%) rename core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/{PipelinePostRequstConfigurationSharePointSite.java => SharePointSite.java} (53%) rename core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/{PipelineConfigurationSharePointSite.java => SharePointSiteGetResponse.java} (53%) create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ValidationError.java diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/PipelinesApi.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/PipelinesApi.java index add8a4865..54eb6a9af 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/PipelinesApi.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/PipelinesApi.java @@ -1,11 +1,15 @@ package com.sap.ai.sdk.grounding.client; import com.google.common.annotations.Beta; -import com.sap.ai.sdk.grounding.model.Pipeline; +import com.sap.ai.sdk.grounding.model.CreatePipeline; +import com.sap.ai.sdk.grounding.model.DocumentsStatusResponse; +import com.sap.ai.sdk.grounding.model.GetPipeline; +import com.sap.ai.sdk.grounding.model.GetPipelineExecutionById; +import com.sap.ai.sdk.grounding.model.GetPipelineExecutions; +import com.sap.ai.sdk.grounding.model.GetPipelineStatus; +import com.sap.ai.sdk.grounding.model.GetPipelines; +import com.sap.ai.sdk.grounding.model.PipelineDocumentResponse; import com.sap.ai.sdk.grounding.model.PipelineId; -import com.sap.ai.sdk.grounding.model.PipelinePostRequst; -import com.sap.ai.sdk.grounding.model.PipelineStatus; -import com.sap.ai.sdk.grounding.model.Pipelines; import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService; @@ -25,13 +29,17 @@ import org.springframework.web.util.UriComponentsBuilder; /** - * Document Grounding Pipeline API in version 0.1.0. + * Grounding in version 0.1.0. * - *

SAP AI Core - API Specification AI Data Management api's + *

Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, + * using vector databases. It provides specialized data retrieval through these databases, grounding + * the retrieval process with your own external and context-relevant data. Grounding combines + * generative AI capabilities with the ability to use real-time, precise data to improve + * decision-making and business operations for specific AI-driven business solutions. */ public class PipelinesApi extends AbstractOpenApiService { /** - * Instantiates this API class to invoke operations on the Document Grounding Pipeline API. + * Instantiates this API class to invoke operations on the Grounding. * * @param httpDestination The destination that API should be used with */ @@ -40,8 +48,8 @@ public PipelinesApi(@Nonnull final Destination httpDestination) { } /** - * Instantiates this API class to invoke operations on the Document Grounding Pipeline API based - * on a given {@link ApiClient}. + * Instantiates this API class to invoke operations on the Grounding based on a given {@link + * ApiClient}. * * @param apiClient ApiClient to invoke the API on */ @@ -51,22 +59,24 @@ public PipelinesApi(@Nonnull final ApiClient apiClient) { } /** - * Create a pipeline + * Pipeline Creation + * + *

Create a pipeline * *

201 - Returns pipelineId on successful creation. * *

400 - The specification of the resource was incorrect * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param pipelinePostRequst The value for the parameter pipelinePostRequst + * @param aiResourceGroup Resource Group ID + * @param createPipeline The value for the parameter createPipeline * @return PipelineId * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull public PipelineId createPipeline( - @Nonnull final String aiResourceGroup, @Nonnull final PipelinePostRequst pipelinePostRequst) + @Nonnull final String aiResourceGroup, @Nonnull final CreatePipeline createPipeline) throws OpenApiRequestException { - final Object localVarPostBody = pipelinePostRequst; + final Object localVarPostBody = createPipeline; // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { @@ -74,10 +84,10 @@ public PipelineId createPipeline( "Missing the required parameter 'aiResourceGroup' when calling createPipeline"); } - // verify the required parameter 'pipelinePostRequst' is set - if (pipelinePostRequst == null) { + // verify the required parameter 'createPipeline' is set + if (createPipeline == null) { throw new OpenApiRequestException( - "Missing the required parameter 'pipelinePostRequst' when calling pipelineV1PipelineEndpointsCreatePipeline"); + "Missing the required parameter 'createPipeline' when calling pipelineV1PipelineEndpointsCreatePipeline"); } final String localVarPath = UriComponentsBuilder.fromPath("/pipelines").build().toUriString(); @@ -114,13 +124,15 @@ public PipelineId createPipeline( } /** - * Delete a pipeline by pipeline id + * Delete pipeline + * + *

Delete a pipeline by pipeline id * *

204 - No Content * *

400 - The specification of the resource was incorrect * - * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param aiResourceGroup Resource Group ID * @param pipelineId The ID of the pipeline to delete. * @return An OpenApiResponse containing the status code of the HttpResponse. * @throws OpenApiRequestException if an error occurs while attempting to invoke the API @@ -184,24 +196,26 @@ public OpenApiResponse deletePipelineById( } /** - * Get all pipelines + * Get Pipelines + * + *

Get all pipelines * *

200 - Returns all pipelines for the tenant. * *

400 - The specification of the resource was incorrect * - * @param aiResourceGroup (required) The value for the parameter aiResourceGroup + * @param aiResourceGroup (required) Resource Group ID * @param $top (optional) Number of results to display * @param $skip (optional) Number of results to be skipped from the ordered list of results * @param $count (optional) When the $count field is set to false, the response contains a count * of the items present in the response. When the $count field is set to true, the response * contains a count of all the items present on the server, and not just the ones in the * response. When the $count field is not passed, it is false by default. - * @return Pipelines + * @return GetPipelines * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public Pipelines getAllPipelines( + public GetPipelines getAllPipelines( @Nonnull final String aiResourceGroup, @Nullable final Integer $top, @Nullable final Integer $skip, @@ -237,8 +251,8 @@ public Pipelines getAllPipelines( final String[] localVarAuthNames = new String[] {}; - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; return apiClient.invokeAPI( localVarPath, HttpMethod.GET, @@ -253,36 +267,40 @@ public Pipelines getAllPipelines( } /** - * Get all pipelines + * Get Pipelines + * + *

Get all pipelines * *

200 - Returns all pipelines for the tenant. * *

400 - The specification of the resource was incorrect * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @return Pipelines + * @param aiResourceGroup Resource Group ID + * @return GetPipelines * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public Pipelines getAllPipelines(@Nonnull final String aiResourceGroup) + public GetPipelines getAllPipelines(@Nonnull final String aiResourceGroup) throws OpenApiRequestException { return getAllPipelines(aiResourceGroup, null, null, null); } /** - * Get details of a pipeline by pipeline id + * Get details of a Pipeline + * + *

Get details of a pipeline by pipeline id * *

200 - Returns the pipeline for an pipelineId * *

400 - The specification of the resource was incorrect * - * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param aiResourceGroup Resource Group ID * @param pipelineId The ID of the pipeline to get. - * @return Pipeline + * @return GetPipeline * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public Pipeline getPipelineById( + public GetPipeline getPipelineDetailsById( @Nonnull final String aiResourceGroup, @Nonnull final String pipelineId) throws OpenApiRequestException { final Object localVarPostBody = null; @@ -290,13 +308,13 @@ public Pipeline getPipelineById( // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getPipelineById"); + "Missing the required parameter 'aiResourceGroup' when calling getPipelineDetailsById"); } // verify the required parameter 'pipelineId' is set if (pipelineId == null) { throw new OpenApiRequestException( - "Missing the required parameter 'pipelineId' when calling getPipelineById"); + "Missing the required parameter 'pipelineId' when calling getPipelineDetailsById"); } // create path and map variables @@ -323,8 +341,87 @@ public Pipeline getPipelineById( final String[] localVarAuthNames = new String[] {}; - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get Document by ID for a Pipeline + * + *

Retrieve details of a specific document associated with a pipeline. + * + *

200 - Returns a response to document id. + * + * @param aiResourceGroup Resource Group ID + * @param pipelineId The ID of the pipeline to get. + * @param documentId The ID of the document to get. + * @return PipelineDocumentResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public PipelineDocumentResponse getDocumentByIdForPipeline( + @Nonnull final String aiResourceGroup, + @Nonnull final String pipelineId, + @Nonnull final String documentId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getDocumentByIdForPipeline"); + } + + // verify the required parameter 'pipelineId' is set + if (pipelineId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'pipelineId' when calling getDocumentByIdForPipeline"); + } + + // verify the required parameter 'documentId' is set + if (documentId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'documentId' when calling getDocumentByIdForPipeline"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("pipelineId", pipelineId); + localVarPathParams.put("documentId", documentId); + final String localVarPath = + UriComponentsBuilder.fromPath("/pipelines/{pipelineId}/documents/{documentId}") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; return apiClient.invokeAPI( localVarPath, HttpMethod.GET, @@ -339,19 +436,518 @@ public Pipeline getPipelineById( } /** - * Get pipeline status by pipeline id + * Get Documents for a Pipeline + * + *

Retrieve all documents associated with a specific pipeline. Optionally, filter the results + * using query parameters. + * + *

200 - Returns all documents for a pipeline. + * + * @param aiResourceGroup (required) Resource Group ID + * @param pipelineId (required) The ID of the pipeline to get. + * @param $top (optional) Number of results to display + * @param $skip (optional) Number of results to be skipped from the ordered list of results + * @param $count (optional) When the $count field is set to false, the response contains a count + * of the items present in the response. When the $count field is set to true, the response + * contains a count of all the items present on the server, and not just the ones in the + * response. When the $count field is not passed, it is false by default. + * @return DocumentsStatusResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public DocumentsStatusResponse getAllDocumentsForPipeline( + @Nonnull final String aiResourceGroup, + @Nonnull final String pipelineId, + @Nullable final Integer $top, + @Nullable final Integer $skip, + @Nullable final Boolean $count) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getAllDocumentsForPipeline"); + } + + // verify the required parameter 'pipelineId' is set + if (pipelineId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'pipelineId' when calling getAllDocumentsForPipeline"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("pipelineId", pipelineId); + final String localVarPath = + UriComponentsBuilder.fromPath("/pipelines/{pipelineId}/documents") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$top", $top)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$skip", $skip)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$count", $count)); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get Documents for a Pipeline + * + *

Retrieve all documents associated with a specific pipeline. Optionally, filter the results + * using query parameters. + * + *

200 - Returns all documents for a pipeline. + * + * @param aiResourceGroup Resource Group ID + * @param pipelineId The ID of the pipeline to get. + * @return DocumentsStatusResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public DocumentsStatusResponse getAllDocumentsForPipeline( + @Nonnull final String aiResourceGroup, @Nonnull final String pipelineId) + throws OpenApiRequestException { + return getAllDocumentsForPipeline(aiResourceGroup, pipelineId, null, null, null); + } + + /** + * Get Pipeline Execution by ID + * + *

Retrieve details of a specific pipeline execution by its execution ID. + * + *

200 - Returns a response to execution id + * + * @param aiResourceGroup Resource Group ID + * @param pipelineId The ID of the pipeline + * @param executionId The ID of the execution + * @return GetPipelineExecutionById + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public GetPipelineExecutionById getExecutionDetailsByIdForPipelineExecution( + @Nonnull final String aiResourceGroup, + @Nonnull final String pipelineId, + @Nonnull final String executionId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getExecutionDetailsByIdForPipelineExecution"); + } + + // verify the required parameter 'pipelineId' is set + if (pipelineId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'pipelineId' when calling getExecutionDetailsByIdForPipelineExecution"); + } + + // verify the required parameter 'executionId' is set + if (executionId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'executionId' when calling getExecutionDetailsByIdForPipelineExecution"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("pipelineId", pipelineId); + localVarPathParams.put("executionId", executionId); + final String localVarPath = + UriComponentsBuilder.fromPath("/pipelines/{pipelineId}/executions/{executionId}") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get Document by ID for a Pipeline Execution + * + *

Retrieve details of a specific document associated with a pipeline execution. + * + *

200 - Returns a response to execution id and document id. + * + * @param aiResourceGroup Resource Group ID + * @param pipelineId The ID of the pipeline + * @param executionId The ID of the execution + * @param documentId The ID of the document to get. + * @return PipelineDocumentResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public PipelineDocumentResponse getDocumentByIdForPipelineExecution( + @Nonnull final String aiResourceGroup, + @Nonnull final String pipelineId, + @Nonnull final String executionId, + @Nonnull final String documentId) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getDocumentByIdForPipelineExecution"); + } + + // verify the required parameter 'pipelineId' is set + if (pipelineId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'pipelineId' when calling getDocumentByIdForPipelineExecution"); + } + + // verify the required parameter 'executionId' is set + if (executionId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'executionId' when calling getDocumentByIdForPipelineExecution"); + } + + // verify the required parameter 'documentId' is set + if (documentId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'documentId' when calling getDocumentByIdForPipelineExecution"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("pipelineId", pipelineId); + localVarPathParams.put("executionId", executionId); + localVarPathParams.put("documentId", documentId); + final String localVarPath = + UriComponentsBuilder.fromPath( + "/pipelines/{pipelineId}/executions/{executionId}/documents/{documentId}") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get Documents for a Pipeline Execution + * + *

Retrieve all documents associated with a specific pipeline execution. Optionally, filter the + * results using query parameters. + * + *

200 - Returns a response to execution id + * + * @param aiResourceGroup (required) Resource Group ID + * @param pipelineId (required) The ID of the pipeline + * @param executionId (required) The ID of the execution + * @param $top (optional) Number of results to display + * @param $skip (optional) Number of results to be skipped from the ordered list of results + * @param $count (optional) When the $count field is set to false, the response contains a count + * of the items present in the response. When the $count field is set to true, the response + * contains a count of all the items present on the server, and not just the ones in the + * response. When the $count field is not passed, it is false by default. + * @return DocumentsStatusResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public DocumentsStatusResponse getDocumentsForPipelineExecution( + @Nonnull final String aiResourceGroup, + @Nonnull final String pipelineId, + @Nonnull final String executionId, + @Nullable final Integer $top, + @Nullable final Integer $skip, + @Nullable final Boolean $count) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getDocumentsForPipelineExecution"); + } + + // verify the required parameter 'pipelineId' is set + if (pipelineId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'pipelineId' when calling getDocumentsForPipelineExecution"); + } + + // verify the required parameter 'executionId' is set + if (executionId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'executionId' when calling getDocumentsForPipelineExecution"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("pipelineId", pipelineId); + localVarPathParams.put("executionId", executionId); + final String localVarPath = + UriComponentsBuilder.fromPath("/pipelines/{pipelineId}/executions/{executionId}/documents") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$top", $top)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$skip", $skip)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$count", $count)); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get Documents for a Pipeline Execution + * + *

Retrieve all documents associated with a specific pipeline execution. Optionally, filter the + * results using query parameters. + * + *

200 - Returns a response to execution id + * + * @param aiResourceGroup Resource Group ID + * @param pipelineId The ID of the pipeline + * @param executionId The ID of the execution + * @return DocumentsStatusResponse + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public DocumentsStatusResponse getDocumentsForPipelineExecution( + @Nonnull final String aiResourceGroup, + @Nonnull final String pipelineId, + @Nonnull final String executionId) + throws OpenApiRequestException { + return getDocumentsForPipelineExecution( + aiResourceGroup, pipelineId, executionId, null, null, null); + } + + /** + * Get Pipeline Executions + * + *

Retrieve all executions for a specific pipeline. Optionally, filter to get only the last + * execution. + * + *

200 - Returns all executions + * + * @param aiResourceGroup (required) Resource Group ID + * @param pipelineId (required) The ID of the pipeline + * @param lastExecution (optional) Filter to get the last execution + * @param $top (optional) Number of results to display + * @param $skip (optional) Number of results to be skipped from the ordered list of results + * @param $count (optional) When the $count field is set to false, the response contains a count + * of the items present in the response. When the $count field is set to true, the response + * contains a count of all the items present on the server, and not just the ones in the + * response. When the $count field is not passed, it is false by default. + * @return GetPipelineExecutions + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public GetPipelineExecutions getAllExecutionsForPipeline( + @Nonnull final String aiResourceGroup, + @Nonnull final String pipelineId, + @Nullable final Boolean lastExecution, + @Nullable final Integer $top, + @Nullable final Integer $skip, + @Nullable final Boolean $count) + throws OpenApiRequestException { + final Object localVarPostBody = null; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling getAllExecutionsForPipeline"); + } + + // verify the required parameter 'pipelineId' is set + if (pipelineId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'pipelineId' when calling getAllExecutionsForPipeline"); + } + + // create path and map variables + final Map localVarPathParams = new HashMap(); + localVarPathParams.put("pipelineId", pipelineId); + final String localVarPath = + UriComponentsBuilder.fromPath("/pipelines/{pipelineId}/executions") + .buildAndExpand(localVarPathParams) + .toUriString(); + + final MultiValueMap localVarQueryParams = + new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarFormParams = + new LinkedMultiValueMap(); + + localVarQueryParams.putAll( + apiClient.parameterToMultiValueMap(null, "lastExecution", lastExecution)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$top", $top)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$skip", $skip)); + localVarQueryParams.putAll(apiClient.parameterToMultiValueMap(null, "$count", $count)); + + if (aiResourceGroup != null) + localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); + + final String[] localVarAccepts = {"application/json"}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + return apiClient.invokeAPI( + localVarPath, + HttpMethod.GET, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + } + + /** + * Get Pipeline Executions + * + *

Retrieve all executions for a specific pipeline. Optionally, filter to get only the last + * execution. + * + *

200 - Returns all executions + * + * @param aiResourceGroup Resource Group ID + * @param pipelineId The ID of the pipeline + * @return GetPipelineExecutions + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public GetPipelineExecutions getAllExecutionsForPipeline( + @Nonnull final String aiResourceGroup, @Nonnull final String pipelineId) + throws OpenApiRequestException { + return getAllExecutionsForPipeline(aiResourceGroup, pipelineId, null, null, null, null); + } + + /** + * Get status of Pipeline + * + *

Get pipeline status by pipeline id * *

200 - Returns the pipeline status for an pipelineId. * *

400 - The specification of the resource was incorrect * - * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param aiResourceGroup Resource Group ID * @param pipelineId The ID of the pipeline to get status. - * @return PipelineStatus + * @return GetPipelineStatus * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public PipelineStatus getPipelineStatus( + public GetPipelineStatus getPipelineStatusById( @Nonnull final String aiResourceGroup, @Nonnull final String pipelineId) throws OpenApiRequestException { final Object localVarPostBody = null; @@ -359,13 +955,13 @@ public PipelineStatus getPipelineStatus( // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getPipelineStatus"); + "Missing the required parameter 'aiResourceGroup' when calling getPipelineStatusById"); } // verify the required parameter 'pipelineId' is set if (pipelineId == null) { throw new OpenApiRequestException( - "Missing the required parameter 'pipelineId' when calling getPipelineStatus"); + "Missing the required parameter 'pipelineId' when calling getPipelineStatusById"); } // create path and map variables @@ -392,8 +988,8 @@ public PipelineStatus getPipelineStatus( final String[] localVarAuthNames = new String[] {}; - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; return apiClient.invokeAPI( localVarPath, HttpMethod.GET, diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/RetrievalApi.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/RetrievalApi.java index 9eb45f896..27a9795c1 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/RetrievalApi.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/RetrievalApi.java @@ -3,8 +3,8 @@ import com.google.common.annotations.Beta; import com.sap.ai.sdk.grounding.model.DataRepositories; import com.sap.ai.sdk.grounding.model.DataRepository; -import com.sap.ai.sdk.grounding.model.RetievalSearchResults; -import com.sap.ai.sdk.grounding.model.RetrievalSearchInput; +import com.sap.ai.sdk.grounding.model.SearchInput; +import com.sap.ai.sdk.grounding.model.SearchResults; import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService; @@ -24,13 +24,17 @@ import org.springframework.web.util.UriComponentsBuilder; /** - * Document Grounding Pipeline API in version 0.1.0. + * Grounding in version 0.1.0. * - *

SAP AI Core - API Specification AI Data Management api's + *

Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, + * using vector databases. It provides specialized data retrieval through these databases, grounding + * the retrieval process with your own external and context-relevant data. Grounding combines + * generative AI capabilities with the ability to use real-time, precise data to improve + * decision-making and business operations for specific AI-driven business solutions. */ public class RetrievalApi extends AbstractOpenApiService { /** - * Instantiates this API class to invoke operations on the Document Grounding Pipeline API. + * Instantiates this API class to invoke operations on the Grounding. * * @param httpDestination The destination that API should be used with */ @@ -39,8 +43,8 @@ public RetrievalApi(@Nonnull final Destination httpDestination) { } /** - * Instantiates this API class to invoke operations on the Document Grounding Pipeline API based - * on a given {@link ApiClient}. + * Instantiates this API class to invoke operations on the Grounding based on a given {@link + * ApiClient}. * * @param apiClient ApiClient to invoke the API on */ @@ -52,13 +56,13 @@ public RetrievalApi(@Nonnull final ApiClient apiClient) { /** * List all DataRepository objects. * - *

List all DataRepository objects. + *

List all Data Repositories * *

200 - Successful Response * *

400 - The specification of the resource was incorrect * - * @param aiResourceGroup (required) The value for the parameter aiResourceGroup + * @param aiResourceGroup (required) Resource Group ID * @param $top (optional) Number of results to display * @param $skip (optional) Number of results to be skipped from the ordered list of results * @param $count (optional) When the $count field is set to false, the response contains a count @@ -124,13 +128,13 @@ public DataRepositories getDataRepositories( /** * List all DataRepository objects. * - *

List all DataRepository objects. + *

List all Data Repositories * *

200 - Successful Response * *

400 - The specification of the resource was incorrect * - * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param aiResourceGroup Resource Group ID * @return DataRepositories * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @@ -143,7 +147,7 @@ public DataRepositories getDataRepositories(@Nonnull final String aiResourceGrou /** * List single DataRepository object. * - *

List single DataRepository object. + *

List data repository by id * *

200 - Successful Response * @@ -153,8 +157,8 @@ public DataRepositories getDataRepositories(@Nonnull final String aiResourceGrou * *

404 - The specification of the resource was incorrect * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param repositoryId The value for the parameter repositoryId + * @param aiResourceGroup Resource Group ID + * @param repositoryId Repository ID * @return DataRepository * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @@ -216,7 +220,7 @@ public DataRepository getDataRepositoryById( } /** - * Retrieve relevant content given a query string. + * Retrieve relevant content * *

Retrieve relevant content given a query string. * @@ -226,17 +230,16 @@ public DataRepository getDataRepositoryById( * *

422 - There are validation issues with the data. * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param retrievalSearchInput The value for the parameter retrievalSearchInput - * @return RetievalSearchResults + * @param aiResourceGroup Resource Group ID + * @param searchInput The value for the parameter searchInput + * @return SearchResults * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public RetievalSearchResults search( - @Nonnull final String aiResourceGroup, - @Nonnull final RetrievalSearchInput retrievalSearchInput) + public SearchResults search( + @Nonnull final String aiResourceGroup, @Nonnull final SearchInput searchInput) throws OpenApiRequestException { - final Object localVarPostBody = retrievalSearchInput; + final Object localVarPostBody = searchInput; // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { @@ -244,10 +247,10 @@ public RetievalSearchResults search( "Missing the required parameter 'aiResourceGroup' when calling search"); } - // verify the required parameter 'retrievalSearchInput' is set - if (retrievalSearchInput == null) { + // verify the required parameter 'searchInput' is set + if (searchInput == null) { throw new OpenApiRequestException( - "Missing the required parameter 'retrievalSearchInput' when calling retrievalV1RetrievalEndpointsSearch"); + "Missing the required parameter 'searchInput' when calling retrievalV1RetrievalEndpointsSearch"); } final String localVarPath = @@ -269,8 +272,8 @@ public RetievalSearchResults search( final String[] localVarAuthNames = new String[] {}; - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; return apiClient.invokeAPI( localVarPath, HttpMethod.POST, diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/VectorApi.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/VectorApi.java index 7a9d27e9b..1366c6078 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/VectorApi.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/VectorApi.java @@ -33,13 +33,17 @@ import org.springframework.web.util.UriComponentsBuilder; /** - * Document Grounding Pipeline API in version 0.1.0. + * Grounding in version 0.1.0. * - *

SAP AI Core - API Specification AI Data Management api's + *

Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, + * using vector databases. It provides specialized data retrieval through these databases, grounding + * the retrieval process with your own external and context-relevant data. Grounding combines + * generative AI capabilities with the ability to use real-time, precise data to improve + * decision-making and business operations for specific AI-driven business solutions. */ public class VectorApi extends AbstractOpenApiService { /** - * Instantiates this API class to invoke operations on the Document Grounding Pipeline API. + * Instantiates this API class to invoke operations on the Grounding. * * @param httpDestination The destination that API should be used with */ @@ -48,8 +52,8 @@ public VectorApi(@Nonnull final Destination httpDestination) { } /** - * Instantiates this API class to invoke operations on the Document Grounding Pipeline API based - * on a given {@link ApiClient}. + * Instantiates this API class to invoke operations on the Grounding based on a given {@link + * ApiClient}. * * @param apiClient ApiClient to invoke the API on */ @@ -70,7 +74,7 @@ public VectorApi(@Nonnull final ApiClient apiClient) { * *

422 - There are validation issues with the data. * - * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param aiResourceGroup Resource Group ID * @param collectionRequest The value for the parameter collectionRequest * @return An OpenApiResponse containing the status code of the HttpResponse. * @throws OpenApiRequestException if an error occurs while attempting to invoke the API @@ -142,14 +146,14 @@ public OpenApiResponse createCollection( * *

422 - There are validation issues with the data. * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param collectionId The value for the parameter collectionId + * @param aiResourceGroup Resource Group ID + * @param collectionId Collection ID * @param documentCreateRequest The value for the parameter documentCreateRequest * @return DocumentsListResponse * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public DocumentsListResponse createDocuments( + public DocumentsListResponse createCollectionDocuments( @Nonnull final String aiResourceGroup, @Nonnull final UUID collectionId, @Nonnull final DocumentCreateRequest documentCreateRequest) @@ -159,13 +163,13 @@ public DocumentsListResponse createDocuments( // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling createDocuments"); + "Missing the required parameter 'aiResourceGroup' when calling createCollectionDocuments"); } // verify the required parameter 'collectionId' is set if (collectionId == null) { throw new OpenApiRequestException( - "Missing the required parameter 'collectionId' when calling createDocuments"); + "Missing the required parameter 'collectionId' when calling createCollectionDocuments"); } // verify the required parameter 'documentCreateRequest' is set @@ -227,8 +231,8 @@ public DocumentsListResponse createDocuments( * *

422 - There are validation issues with the data. * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param collectionId The value for the parameter collectionId + * @param aiResourceGroup Resource Group ID + * @param collectionId Collection ID * @return An OpenApiResponse containing the status code of the HttpResponse. * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @@ -303,14 +307,14 @@ public OpenApiResponse deleteCollectionById( * *

422 - There are validation issues with the data. * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param collectionId The value for the parameter collectionId - * @param documentId The value for the parameter documentId + * @param aiResourceGroup Resource Group ID + * @param collectionId Collection ID + * @param documentId Document ID * @return An OpenApiResponse containing the status code of the HttpResponse. * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public OpenApiResponse deleteDocumentById( + public OpenApiResponse deleteCollectionById( @Nonnull final String aiResourceGroup, @Nonnull final UUID collectionId, @Nonnull final UUID documentId) @@ -320,19 +324,19 @@ public OpenApiResponse deleteDocumentById( // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling deleteDocumentById"); + "Missing the required parameter 'aiResourceGroup' when calling deleteCollectionById"); } // verify the required parameter 'collectionId' is set if (collectionId == null) { throw new OpenApiRequestException( - "Missing the required parameter 'collectionId' when calling deleteDocumentById"); + "Missing the required parameter 'collectionId' when calling deleteCollectionById"); } // verify the required parameter 'documentId' is set if (documentId == null) { throw new OpenApiRequestException( - "Missing the required parameter 'documentId' when calling deleteDocumentById"); + "Missing the required parameter 'documentId' when calling deleteCollectionById"); } // create path and map variables @@ -385,7 +389,7 @@ public OpenApiResponse deleteDocumentById( * *

400 - The specification of the resource was incorrect * - * @param aiResourceGroup (required) The value for the parameter aiResourceGroup + * @param aiResourceGroup (required) Resource Group ID * @param $top (optional) Number of results to display * @param $skip (optional) Number of results to be skipped from the ordered list of results * @param $count (optional) When the $count field is set to false, the response contains a count @@ -457,7 +461,7 @@ public CollectionsListResponse getAllCollections( * *

400 - The specification of the resource was incorrect * - * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param aiResourceGroup Resource Group ID * @return CollectionsListResponse * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @@ -480,8 +484,8 @@ public CollectionsListResponse getAllCollections(@Nonnull final String aiResourc * *

422 - There are validation issues with the data. * - * @param aiResourceGroup (required) The value for the parameter aiResourceGroup - * @param collectionId (required) The value for the parameter collectionId + * @param aiResourceGroup (required) Resource Group ID + * @param collectionId (required) Collection ID * @param $top (optional) Number of results to display * @param $skip (optional) Number of results to be skipped from the ordered list of results * @param $count (optional) When the $count field is set to false, the response contains a count @@ -492,7 +496,7 @@ public CollectionsListResponse getAllCollections(@Nonnull final String aiResourc * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public Documents getAllDocuments( + public Documents getDocumentsByCollectionId( @Nonnull final String aiResourceGroup, @Nonnull final UUID collectionId, @Nullable final Integer $top, @@ -504,13 +508,13 @@ public Documents getAllDocuments( // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getAllDocuments"); + "Missing the required parameter 'aiResourceGroup' when calling getDocumentsByCollectionId"); } // verify the required parameter 'collectionId' is set if (collectionId == null) { throw new OpenApiRequestException( - "Missing the required parameter 'collectionId' when calling getAllDocuments"); + "Missing the required parameter 'collectionId' when calling getDocumentsByCollectionId"); } // create path and map variables @@ -569,16 +573,16 @@ public Documents getAllDocuments( * *

422 - There are validation issues with the data. * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param collectionId The value for the parameter collectionId + * @param aiResourceGroup Resource Group ID + * @param collectionId Collection ID * @return Documents * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public Documents getAllDocuments( + public Documents getDocumentsByCollectionId( @Nonnull final String aiResourceGroup, @Nonnull final UUID collectionId) throws OpenApiRequestException { - return getAllDocuments(aiResourceGroup, collectionId, null, null, null); + return getDocumentsByCollectionId(aiResourceGroup, collectionId, null, null, null); } /** @@ -594,8 +598,8 @@ public Documents getAllDocuments( * *

422 - There are validation issues with the data. * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param collectionId The value for the parameter collectionId + * @param aiResourceGroup Resource Group ID + * @param collectionId Collection ID * @return Collection * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @@ -669,13 +673,13 @@ public Collection getCollectionById( * *

422 - There are validation issues with the data. * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param id The value for the parameter id + * @param aiResourceGroup Resource Group ID + * @param id Collection ID * @return VectorV1VectorEndpointsGetCollectionCreationStatus200Response * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public VectorV1VectorEndpointsGetCollectionCreationStatus200Response getCollectionCreationStatus( + public VectorV1VectorEndpointsGetCollectionCreationStatus200Response getCollectionStatus( @Nonnull final String aiResourceGroup, @Nonnull final UUID id) throws OpenApiRequestException { final Object localVarPostBody = null; @@ -683,13 +687,13 @@ public VectorV1VectorEndpointsGetCollectionCreationStatus200Response getCollecti // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getCollectionCreationStatus"); + "Missing the required parameter 'aiResourceGroup' when calling getCollectionStatus"); } // verify the required parameter 'id' is set if (id == null) { throw new OpenApiRequestException( - "Missing the required parameter 'id' when calling getCollectionCreationStatus"); + "Missing the required parameter 'id' when calling getCollectionStatus"); } // create path and map variables @@ -746,8 +750,8 @@ public VectorV1VectorEndpointsGetCollectionCreationStatus200Response getCollecti * *

422 - There are validation issues with the data. * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param id The value for the parameter id + * @param aiResourceGroup Resource Group ID + * @param id Collection ID * @return VectorV1VectorEndpointsGetCollectionDeletionStatus200Response * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @@ -823,14 +827,14 @@ public VectorV1VectorEndpointsGetCollectionDeletionStatus200Response getCollecti * *

422 - There are validation issues with the data. * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param collectionId The value for the parameter collectionId - * @param documentId The value for the parameter documentId + * @param aiResourceGroup Resource Group ID + * @param collectionId Collection ID + * @param documentId Document ID * @return DocumentResponse * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public DocumentResponse getDocumentById( + public DocumentResponse getDocumentByIdForCollection( @Nonnull final String aiResourceGroup, @Nonnull final UUID collectionId, @Nonnull final UUID documentId) @@ -840,19 +844,19 @@ public DocumentResponse getDocumentById( // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getDocumentById"); + "Missing the required parameter 'aiResourceGroup' when calling getDocumentByIdForCollection"); } // verify the required parameter 'collectionId' is set if (collectionId == null) { throw new OpenApiRequestException( - "Missing the required parameter 'collectionId' when calling getDocumentById"); + "Missing the required parameter 'collectionId' when calling getDocumentByIdForCollection"); } // verify the required parameter 'documentId' is set if (documentId == null) { throw new OpenApiRequestException( - "Missing the required parameter 'documentId' when calling getDocumentById"); + "Missing the required parameter 'documentId' when calling getDocumentByIdForCollection"); } // create path and map variables @@ -898,7 +902,7 @@ public DocumentResponse getDocumentById( /** * Search chunk by vector * - *

Search chunk by vector + *

Search chunks * *

200 - Successful Response * @@ -908,13 +912,13 @@ public DocumentResponse getDocumentById( * *

422 - There are validation issues with the data. * - * @param aiResourceGroup The value for the parameter aiResourceGroup + * @param aiResourceGroup Resource Group ID * @param textSearchRequest The value for the parameter textSearchRequest * @return SearchResults * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public SearchResults search( + public SearchResults vectorSearchByChunk( @Nonnull final String aiResourceGroup, @Nonnull final TextSearchRequest textSearchRequest) throws OpenApiRequestException { final Object localVarPostBody = textSearchRequest; @@ -922,13 +926,13 @@ public SearchResults search( // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling search"); + "Missing the required parameter 'aiResourceGroup' when calling vectorSearchByChunk"); } // verify the required parameter 'textSearchRequest' is set if (textSearchRequest == null) { throw new OpenApiRequestException( - "Missing the required parameter 'textSearchRequest' when calling vectorV1VectorEndpointsSearch"); + "Missing the required parameter 'textSearchRequest' when calling vectorV1VectorEndpointsSearchChunk"); } final String localVarPath = @@ -978,14 +982,14 @@ public SearchResults search( * *

422 - There are validation issues with the data. * - * @param aiResourceGroup The value for the parameter aiResourceGroup - * @param collectionId The value for the parameter collectionId + * @param aiResourceGroup Resource Group ID + * @param collectionId Collection ID * @param documentUpdateRequest The value for the parameter documentUpdateRequest * @return DocumentsListResponse * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public DocumentsListResponse updateDocuments( + public DocumentsListResponse insertOrUpdateDocumentsInCollection( @Nonnull final String aiResourceGroup, @Nonnull final UUID collectionId, @Nonnull final DocumentUpdateRequest documentUpdateRequest) @@ -995,13 +999,13 @@ public DocumentsListResponse updateDocuments( // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling updateDocuments"); + "Missing the required parameter 'aiResourceGroup' when calling insertOrUpdateDocumentsInCollection"); } // verify the required parameter 'collectionId' is set if (collectionId == null) { throw new OpenApiRequestException( - "Missing the required parameter 'collectionId' when calling updateDocuments"); + "Missing the required parameter 'collectionId' when calling insertOrUpdateDocumentsInCollection"); } // verify the required parameter 'documentUpdateRequest' is set diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ApiError.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ApiError.java index 1f51261b7..8c6d2cead 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ApiError.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ApiError.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java index 371ac7c3e..b23bfcf24 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/BasePipelineResponse.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/BasePipelineResponse.java new file mode 100644 index 000000000..09f758b55 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/BasePipelineResponse.java @@ -0,0 +1,270 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** BasePipelineResponse */ +// CHECKSTYLE:OFF +public class BasePipelineResponse +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("type") + private String type; + + @JsonProperty("metadata") + private MetaData metadata; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for BasePipelineResponse. */ + protected BasePipelineResponse() {} + + /** + * Set the id of this {@link BasePipelineResponse} instance and return the same instance. + * + * @param id The id of this {@link BasePipelineResponse} + * @return The same instance of this {@link BasePipelineResponse} class + */ + @Nonnull + public BasePipelineResponse id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link BasePipelineResponse} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link BasePipelineResponse} instance. + * + * @param id The id of this {@link BasePipelineResponse} + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the type of this {@link BasePipelineResponse} instance and return the same instance. + * + * @param type The type of this {@link BasePipelineResponse} + * @return The same instance of this {@link BasePipelineResponse} class + */ + @Nonnull + public BasePipelineResponse type(@Nonnull final String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link BasePipelineResponse} instance. + */ + @Nonnull + public String getType() { + return type; + } + + /** + * Set the type of this {@link BasePipelineResponse} instance. + * + * @param type The type of this {@link BasePipelineResponse} + */ + public void setType(@Nonnull final String type) { + this.type = type; + } + + /** + * Set the metadata of this {@link BasePipelineResponse} instance and return the same instance. + * + * @param metadata The metadata of this {@link BasePipelineResponse} + * @return The same instance of this {@link BasePipelineResponse} class + */ + @Nonnull + public BasePipelineResponse metadata(@Nullable final MetaData metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link BasePipelineResponse} instance. + */ + @Nonnull + public MetaData getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link BasePipelineResponse} instance. + * + * @param metadata The metadata of this {@link BasePipelineResponse} + */ + public void setMetadata(@Nullable final MetaData metadata) { + this.metadata = metadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link BasePipelineResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link BasePipelineResponse} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "BasePipelineResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link BasePipelineResponse} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (type != null) declaredFields.put("type", type); + if (metadata != null) declaredFields.put("metadata", metadata); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link BasePipelineResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final BasePipelineResponse basePipelineResponse = (BasePipelineResponse) o; + return Objects.equals(this.cloudSdkCustomFields, basePipelineResponse.cloudSdkCustomFields) + && Objects.equals(this.id, basePipelineResponse.id) + && Objects.equals(this.type, basePipelineResponse.type) + && Objects.equals(this.metadata, basePipelineResponse.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, metadata, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class BasePipelineResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link BasePipelineResponse} + * instance with all required arguments. + */ + public static Builder create() { + return (id) -> (type) -> new BasePipelineResponse().id(id).type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link BasePipelineResponse} instance. + * + * @param id The id of this {@link BasePipelineResponse} + * @return The BasePipelineResponse builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the type of this {@link BasePipelineResponse} instance. + * + * @param type The type of this {@link BasePipelineResponse} + * @return The BasePipelineResponse instance. + */ + BasePipelineResponse type(@Nonnull final String type); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Chunk.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Chunk.java index f70d1424f..836a24ae7 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Chunk.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Chunk.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Collection.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Collection.java index 3aa28b4f3..e7eab9bed 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Collection.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Collection.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -66,7 +66,7 @@ public Collection title(@Nullable final String title) { * * @return title The title of this {@link Collection} instance. */ - @Nonnull + @Nullable public String getTitle() { return title; } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionCreatedResponse.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionCreatedResponse.java index 2e92d289e..cbf3612d7 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionCreatedResponse.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionCreatedResponse.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionDeletedResponse.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionDeletedResponse.java index 89ec30e63..2c2251b29 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionDeletedResponse.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionDeletedResponse.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionPendingResponse.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionPendingResponse.java index 7c330f35d..ed5259502 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionPendingResponse.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionPendingResponse.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -15,7 +15,6 @@ import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import java.net.URI; import java.util.LinkedHashMap; import java.util.Map; import java.util.NoSuchElementException; @@ -32,7 +31,7 @@ public class CollectionPendingResponse // CHECKSTYLE:ON { @JsonProperty("Location") - private URI location; + private String location; @JsonProperty("status") private String status; @@ -51,7 +50,7 @@ protected CollectionPendingResponse() {} * @return The same instance of this {@link CollectionPendingResponse} class */ @Nonnull - public CollectionPendingResponse location(@Nonnull final URI location) { + public CollectionPendingResponse location(@Nonnull final String location) { this.location = location; return this; } @@ -62,7 +61,7 @@ public CollectionPendingResponse location(@Nonnull final URI location) { * @return location The location of this {@link CollectionPendingResponse} instance. */ @Nonnull - public URI getLocation() { + public String getLocation() { return location; } @@ -71,7 +70,7 @@ public URI getLocation() { * * @param location The location of this {@link CollectionPendingResponse} */ - public void setLocation(@Nonnull final URI location) { + public void setLocation(@Nonnull final String location) { this.location = location; } @@ -222,7 +221,7 @@ public interface Builder { * @param location The location of this {@link CollectionPendingResponse} * @return The CollectionPendingResponse builder. */ - Builder1 location(@Nonnull final URI location); + Builder1 location(@Nonnull final String location); } /** Builder helper class. */ diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java index e2e553550..8826a7af0 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionRequest.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -62,7 +62,7 @@ public CollectionRequest title(@Nullable final String title) { * * @return title The title of this {@link CollectionRequest} instance. */ - @Nonnull + @Nullable public String getTitle() { return title; } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionsListResponse.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionsListResponse.java index 9d83c0ba3..96201b2fb 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionsListResponse.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CollectionsListResponse.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -31,18 +31,49 @@ public class CollectionsListResponse // CHECKSTYLE:ON { - @JsonProperty("resources") - private List resources = new ArrayList<>(); - @JsonProperty("count") private Integer count; + @JsonProperty("resources") + private List resources = new ArrayList<>(); + @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for CollectionsListResponse. */ protected CollectionsListResponse() {} + /** + * Set the count of this {@link CollectionsListResponse} instance and return the same instance. + * + * @param count The count of this {@link CollectionsListResponse} + * @return The same instance of this {@link CollectionsListResponse} class + */ + @Nonnull + public CollectionsListResponse count(@Nullable final Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count The count of this {@link CollectionsListResponse} instance. + */ + @Nonnull + public Integer getCount() { + return count; + } + + /** + * Set the count of this {@link CollectionsListResponse} instance. + * + * @param count The count of this {@link CollectionsListResponse} + */ + public void setCount(@Nullable final Integer count) { + this.count = count; + } + /** * Set the resources of this {@link CollectionsListResponse} instance and return the same * instance. @@ -90,37 +121,6 @@ public void setResources(@Nonnull final List resources) { this.resources = resources; } - /** - * Set the count of this {@link CollectionsListResponse} instance and return the same instance. - * - * @param count The count of this {@link CollectionsListResponse} - * @return The same instance of this {@link CollectionsListResponse} class - */ - @Nonnull - public CollectionsListResponse count(@Nullable final Integer count) { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count The count of this {@link CollectionsListResponse} instance. - */ - @Nonnull - public Integer getCount() { - return count; - } - - /** - * Set the count of this {@link CollectionsListResponse} instance. - * - * @param count The count of this {@link CollectionsListResponse} - */ - public void setCount(@Nullable final Integer count) { - this.count = count; - } - /** * Get the names of the unrecognizable properties of the {@link CollectionsListResponse}. * @@ -160,8 +160,8 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc @Nonnull public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (resources != null) declaredFields.put("resources", resources); if (count != null) declaredFields.put("count", count); + if (resources != null) declaredFields.put("resources", resources); return declaredFields; } @@ -187,13 +187,13 @@ public boolean equals(@Nullable final java.lang.Object o) { } final CollectionsListResponse collectionsListResponse = (CollectionsListResponse) o; return Objects.equals(this.cloudSdkCustomFields, collectionsListResponse.cloudSdkCustomFields) - && Objects.equals(this.resources, collectionsListResponse.resources) - && Objects.equals(this.count, collectionsListResponse.count); + && Objects.equals(this.count, collectionsListResponse.count) + && Objects.equals(this.resources, collectionsListResponse.resources); } @Override public int hashCode() { - return Objects.hash(resources, count, cloudSdkCustomFields); + return Objects.hash(count, resources, cloudSdkCustomFields); } @Override @@ -201,8 +201,8 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class CollectionsListResponse {\n"); - sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfiguration.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CommonConfiguration.java similarity index 55% rename from core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfiguration.java rename to core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CommonConfiguration.java index 0b424bc3a..2d07db9f7 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfiguration.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CommonConfiguration.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -23,32 +23,28 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -/** PipelineConfiguration */ +/** CommonConfiguration */ // CHECKSTYLE:OFF -public class PipelineConfiguration +public class CommonConfiguration // CHECKSTYLE:ON { @JsonProperty("destination") private String destination; - @JsonProperty("sharePoint") - private PipelineConfigurationSharePoint sharePoint; - @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for PipelineConfiguration. */ - protected PipelineConfiguration() {} + /** Default constructor for CommonConfiguration. */ + protected CommonConfiguration() {} /** - * Set the destination of this {@link PipelineConfiguration} instance and return the same - * instance. + * Set the destination of this {@link CommonConfiguration} instance and return the same instance. * - * @param destination The destination of this {@link PipelineConfiguration} - * @return The same instance of this {@link PipelineConfiguration} class + * @param destination The destination of this {@link CommonConfiguration} + * @return The same instance of this {@link CommonConfiguration} class */ @Nonnull - public PipelineConfiguration destination(@Nullable final String destination) { + public CommonConfiguration destination(@Nonnull final String destination) { this.destination = destination; return this; } @@ -56,7 +52,7 @@ public PipelineConfiguration destination(@Nullable final String destination) { /** * Get destination * - * @return destination The destination of this {@link PipelineConfiguration} instance. + * @return destination The destination of this {@link CommonConfiguration} instance. */ @Nonnull public String getDestination() { @@ -64,48 +60,16 @@ public String getDestination() { } /** - * Set the destination of this {@link PipelineConfiguration} instance. + * Set the destination of this {@link CommonConfiguration} instance. * - * @param destination The destination of this {@link PipelineConfiguration} + * @param destination The destination of this {@link CommonConfiguration} */ - public void setDestination(@Nullable final String destination) { + public void setDestination(@Nonnull final String destination) { this.destination = destination; } /** - * Set the sharePoint of this {@link PipelineConfiguration} instance and return the same instance. - * - * @param sharePoint The sharePoint of this {@link PipelineConfiguration} - * @return The same instance of this {@link PipelineConfiguration} class - */ - @Nonnull - public PipelineConfiguration sharePoint( - @Nullable final PipelineConfigurationSharePoint sharePoint) { - this.sharePoint = sharePoint; - return this; - } - - /** - * Get sharePoint - * - * @return sharePoint The sharePoint of this {@link PipelineConfiguration} instance. - */ - @Nonnull - public PipelineConfigurationSharePoint getSharePoint() { - return sharePoint; - } - - /** - * Set the sharePoint of this {@link PipelineConfiguration} instance. - * - * @param sharePoint The sharePoint of this {@link PipelineConfiguration} - */ - public void setSharePoint(@Nullable final PipelineConfigurationSharePoint sharePoint) { - this.sharePoint = sharePoint; - } - - /** - * Get the names of the unrecognizable properties of the {@link PipelineConfiguration}. + * Get the names of the unrecognizable properties of the {@link CommonConfiguration}. * * @return The set of properties names */ @@ -116,7 +80,7 @@ public Set getCustomFieldNames() { } /** - * Get the value of an unrecognizable property of this {@link PipelineConfiguration} instance. + * Get the value of an unrecognizable property of this {@link CommonConfiguration} instance. * * @deprecated Use {@link #toMap()} instead. * @param name The name of the property @@ -128,13 +92,13 @@ public Set getCustomFieldNames() { public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( - "PipelineConfiguration has no field with name '" + name + "'."); + "CommonConfiguration has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link PipelineConfiguration} instance including + * Get the value of all properties of this {@link CommonConfiguration} instance including * unrecognized properties. * * @return The map of all properties @@ -144,12 +108,11 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); if (destination != null) declaredFields.put("destination", destination); - if (sharePoint != null) declaredFields.put("sharePoint", sharePoint); return declaredFields; } /** - * Set an unrecognizable property of this {@link PipelineConfiguration} instance. If the map + * Set an unrecognizable property of this {@link CommonConfiguration} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. * * @param customFieldName The name of the property @@ -168,24 +131,22 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final PipelineConfiguration pipelineConfiguration = (PipelineConfiguration) o; - return Objects.equals(this.cloudSdkCustomFields, pipelineConfiguration.cloudSdkCustomFields) - && Objects.equals(this.destination, pipelineConfiguration.destination) - && Objects.equals(this.sharePoint, pipelineConfiguration.sharePoint); + final CommonConfiguration commonConfiguration = (CommonConfiguration) o; + return Objects.equals(this.cloudSdkCustomFields, commonConfiguration.cloudSdkCustomFields) + && Objects.equals(this.destination, commonConfiguration.destination); } @Override public int hashCode() { - return Objects.hash(destination, sharePoint, cloudSdkCustomFields); + return Objects.hash(destination, cloudSdkCustomFields); } @Override @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class PipelineConfiguration {\n"); + sb.append("class CommonConfiguration {\n"); sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); - sb.append(" sharePoint: ").append(toIndentedString(sharePoint)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); @@ -203,8 +164,22 @@ private String toIndentedString(final java.lang.Object o) { return o.toString().replace("\n", "\n "); } - /** Create a new {@link PipelineConfiguration} instance. No arguments are required. */ - public static PipelineConfiguration create() { - return new PipelineConfiguration(); + /** + * Create a type-safe, fluent-api builder object to construct a new {@link CommonConfiguration} + * instance with all required arguments. + */ + public static Builder create() { + return (destination) -> new CommonConfiguration().destination(destination); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the destination of this {@link CommonConfiguration} instance. + * + * @param destination The destination of this {@link CommonConfiguration} + * @return The CommonConfiguration instance. + */ + CommonConfiguration destination(@Nonnull final String destination); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CreatePipeline.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CreatePipeline.java new file mode 100644 index 000000000..17804cd51 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CreatePipeline.java @@ -0,0 +1,31 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** CreatePipeline */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = MSSharePointPipelineCreateRequest.class, name = "MSSharePoint"), + @JsonSubTypes.Type(value = S3PipelineCreateRequest.class, name = "S3"), + @JsonSubTypes.Type(value = SFTPPipelineCreateRequest.class, name = "SFTP"), + @JsonSubTypes.Type( + value = MSSharePointPipelineCreateRequest.class, + name = "MSSharePointPipelineCreateRequest"), + @JsonSubTypes.Type(value = S3PipelineCreateRequest.class, name = "S3PipelineCreateRequest"), + @JsonSubTypes.Type(value = SFTPPipelineCreateRequest.class, name = "SFTPPipelineCreateRequest"), +}) +public interface CreatePipeline { + Object getType(); +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositories.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositories.java index 0ecb91c66..17a68b141 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositories.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositories.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -31,18 +31,49 @@ public class DataRepositories // CHECKSTYLE:ON { - @JsonProperty("resources") - private List resources = new ArrayList<>(); - @JsonProperty("count") private Integer count; + @JsonProperty("resources") + private List resources = new ArrayList<>(); + @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for DataRepositories. */ protected DataRepositories() {} + /** + * Set the count of this {@link DataRepositories} instance and return the same instance. + * + * @param count The count of this {@link DataRepositories} + * @return The same instance of this {@link DataRepositories} class + */ + @Nonnull + public DataRepositories count(@Nullable final Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count The count of this {@link DataRepositories} instance. + */ + @Nonnull + public Integer getCount() { + return count; + } + + /** + * Set the count of this {@link DataRepositories} instance. + * + * @param count The count of this {@link DataRepositories} + */ + public void setCount(@Nullable final Integer count) { + this.count = count; + } + /** * Set the resources of this {@link DataRepositories} instance and return the same instance. * @@ -89,37 +120,6 @@ public void setResources(@Nonnull final List resources) { this.resources = resources; } - /** - * Set the count of this {@link DataRepositories} instance and return the same instance. - * - * @param count The count of this {@link DataRepositories} - * @return The same instance of this {@link DataRepositories} class - */ - @Nonnull - public DataRepositories count(@Nullable final Integer count) { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count The count of this {@link DataRepositories} instance. - */ - @Nonnull - public Integer getCount() { - return count; - } - - /** - * Set the count of this {@link DataRepositories} instance. - * - * @param count The count of this {@link DataRepositories} - */ - public void setCount(@Nullable final Integer count) { - this.count = count; - } - /** * Get the names of the unrecognizable properties of the {@link DataRepositories}. * @@ -158,8 +158,8 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc @Nonnull public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (resources != null) declaredFields.put("resources", resources); if (count != null) declaredFields.put("count", count); + if (resources != null) declaredFields.put("resources", resources); return declaredFields; } @@ -185,13 +185,13 @@ public boolean equals(@Nullable final java.lang.Object o) { } final DataRepositories dataRepositories = (DataRepositories) o; return Objects.equals(this.cloudSdkCustomFields, dataRepositories.cloudSdkCustomFields) - && Objects.equals(this.resources, dataRepositories.resources) - && Objects.equals(this.count, dataRepositories.count); + && Objects.equals(this.count, dataRepositories.count) + && Objects.equals(this.resources, dataRepositories.resources); } @Override public int hashCode() { - return Objects.hash(resources, count, cloudSdkCustomFields); + return Objects.hash(count, resources, cloudSdkCustomFields); } @Override @@ -199,8 +199,8 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class DataRepositories {\n"); - sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepository.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepository.java index d68e4e6e7..a6e60689b 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepository.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepository.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResult.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryPerFilterSearchResult.java similarity index 54% rename from core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResult.java rename to core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryPerFilterSearchResult.java index 1ae502495..5d0584af8 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResult.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryPerFilterSearchResult.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -25,32 +25,32 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -/** RetievalPerFilterSearchResult */ +/** DataRepositoryPerFilterSearchResult */ // CHECKSTYLE:OFF -public class RetievalPerFilterSearchResult +public class DataRepositoryPerFilterSearchResult // CHECKSTYLE:ON { @JsonProperty("filterId") private String filterId; @JsonProperty("results") - private List results = new ArrayList<>(); + private List results = new ArrayList<>(); @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for RetievalPerFilterSearchResult. */ - protected RetievalPerFilterSearchResult() {} + /** Default constructor for DataRepositoryPerFilterSearchResult. */ + protected DataRepositoryPerFilterSearchResult() {} /** - * Set the filterId of this {@link RetievalPerFilterSearchResult} instance and return the same - * instance. + * Set the filterId of this {@link DataRepositoryPerFilterSearchResult} instance and return the + * same instance. * - * @param filterId The filterId of this {@link RetievalPerFilterSearchResult} - * @return The same instance of this {@link RetievalPerFilterSearchResult} class + * @param filterId The filterId of this {@link DataRepositoryPerFilterSearchResult} + * @return The same instance of this {@link DataRepositoryPerFilterSearchResult} class */ @Nonnull - public RetievalPerFilterSearchResult filterId(@Nonnull final String filterId) { + public DataRepositoryPerFilterSearchResult filterId(@Nonnull final String filterId) { this.filterId = filterId; return this; } @@ -58,7 +58,7 @@ public RetievalPerFilterSearchResult filterId(@Nonnull final String filterId) { /** * Get filterId * - * @return filterId The filterId of this {@link RetievalPerFilterSearchResult} instance. + * @return filterId The filterId of this {@link DataRepositoryPerFilterSearchResult} instance. */ @Nonnull public String getFilterId() { @@ -66,37 +66,37 @@ public String getFilterId() { } /** - * Set the filterId of this {@link RetievalPerFilterSearchResult} instance. + * Set the filterId of this {@link DataRepositoryPerFilterSearchResult} instance. * - * @param filterId The filterId of this {@link RetievalPerFilterSearchResult} + * @param filterId The filterId of this {@link DataRepositoryPerFilterSearchResult} */ public void setFilterId(@Nonnull final String filterId) { this.filterId = filterId; } /** - * Set the results of this {@link RetievalPerFilterSearchResult} instance and return the same - * instance. + * Set the results of this {@link DataRepositoryPerFilterSearchResult} instance and return the + * same instance. * * @param results List of returned results. - * @return The same instance of this {@link RetievalPerFilterSearchResult} class + * @return The same instance of this {@link DataRepositoryPerFilterSearchResult} class */ @Nonnull - public RetievalPerFilterSearchResult results( - @Nullable final List results) { + public DataRepositoryPerFilterSearchResult results( + @Nullable final List results) { this.results = results; return this; } /** - * Add one results instance to this {@link RetievalPerFilterSearchResult}. + * Add one results instance to this {@link DataRepositoryPerFilterSearchResult}. * * @param resultsItem The results that should be added - * @return The same instance of type {@link RetievalPerFilterSearchResult} + * @return The same instance of type {@link DataRepositoryPerFilterSearchResult} */ @Nonnull - public RetievalPerFilterSearchResult addResultsItem( - @Nonnull final RetievalDataRepositorySearchResult resultsItem) { + public DataRepositoryPerFilterSearchResult addResultsItem( + @Nonnull final DataRepositorySearchResult resultsItem) { if (this.results == null) { this.results = new ArrayList<>(); } @@ -107,24 +107,25 @@ public RetievalPerFilterSearchResult addResultsItem( /** * List of returned results. * - * @return results The results of this {@link RetievalPerFilterSearchResult} instance. + * @return results The results of this {@link DataRepositoryPerFilterSearchResult} instance. */ @Nonnull - public List getResults() { + public List getResults() { return results; } /** - * Set the results of this {@link RetievalPerFilterSearchResult} instance. + * Set the results of this {@link DataRepositoryPerFilterSearchResult} instance. * * @param results List of returned results. */ - public void setResults(@Nullable final List results) { + public void setResults(@Nullable final List results) { this.results = results; } /** - * Get the names of the unrecognizable properties of the {@link RetievalPerFilterSearchResult}. + * Get the names of the unrecognizable properties of the {@link + * DataRepositoryPerFilterSearchResult}. * * @return The set of properties names */ @@ -135,7 +136,7 @@ public Set getCustomFieldNames() { } /** - * Get the value of an unrecognizable property of this {@link RetievalPerFilterSearchResult} + * Get the value of an unrecognizable property of this {@link DataRepositoryPerFilterSearchResult} * instance. * * @deprecated Use {@link #toMap()} instead. @@ -148,13 +149,13 @@ public Set getCustomFieldNames() { public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( - "RetievalPerFilterSearchResult has no field with name '" + name + "'."); + "DataRepositoryPerFilterSearchResult has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link RetievalPerFilterSearchResult} instance + * Get the value of all properties of this {@link DataRepositoryPerFilterSearchResult} instance * including unrecognized properties. * * @return The map of all properties @@ -169,8 +170,8 @@ public Map toMap() { } /** - * Set an unrecognizable property of this {@link RetievalPerFilterSearchResult} instance. If the - * map previously contained a mapping for the key, the old value is replaced by the specified + * Set an unrecognizable property of this {@link DataRepositoryPerFilterSearchResult} instance. If + * the map previously contained a mapping for the key, the old value is replaced by the specified * value. * * @param customFieldName The name of the property @@ -189,12 +190,12 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final RetievalPerFilterSearchResult retievalPerFilterSearchResult = - (RetievalPerFilterSearchResult) o; + final DataRepositoryPerFilterSearchResult dataRepositoryPerFilterSearchResult = + (DataRepositoryPerFilterSearchResult) o; return Objects.equals( - this.cloudSdkCustomFields, retievalPerFilterSearchResult.cloudSdkCustomFields) - && Objects.equals(this.filterId, retievalPerFilterSearchResult.filterId) - && Objects.equals(this.results, retievalPerFilterSearchResult.results); + this.cloudSdkCustomFields, dataRepositoryPerFilterSearchResult.cloudSdkCustomFields) + && Objects.equals(this.filterId, dataRepositoryPerFilterSearchResult.filterId) + && Objects.equals(this.results, dataRepositoryPerFilterSearchResult.results); } @Override @@ -206,7 +207,7 @@ public int hashCode() { @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class RetievalPerFilterSearchResult {\n"); + sb.append("class DataRepositoryPerFilterSearchResult {\n"); sb.append(" filterId: ").append(toIndentedString(filterId)).append("\n"); sb.append(" results: ").append(toIndentedString(results)).append("\n"); cloudSdkCustomFields.forEach( @@ -228,20 +229,20 @@ private String toIndentedString(final java.lang.Object o) { /** * Create a type-safe, fluent-api builder object to construct a new {@link - * RetievalPerFilterSearchResult} instance with all required arguments. + * DataRepositoryPerFilterSearchResult} instance with all required arguments. */ public static Builder create() { - return (filterId) -> new RetievalPerFilterSearchResult().filterId(filterId); + return (filterId) -> new DataRepositoryPerFilterSearchResult().filterId(filterId); } /** Builder helper class. */ public interface Builder { /** - * Set the filterId of this {@link RetievalPerFilterSearchResult} instance. + * Set the filterId of this {@link DataRepositoryPerFilterSearchResult} instance. * - * @param filterId The filterId of this {@link RetievalPerFilterSearchResult} - * @return The RetievalPerFilterSearchResult instance. + * @param filterId The filterId of this {@link DataRepositoryPerFilterSearchResult} + * @return The DataRepositoryPerFilterSearchResult instance. */ - RetievalPerFilterSearchResult filterId(@Nonnull final String filterId); + DataRepositoryPerFilterSearchResult filterId(@Nonnull final String filterId); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalDataRepositorySearchResult.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositorySearchResult.java similarity index 62% rename from core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalDataRepositorySearchResult.java rename to core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositorySearchResult.java index 7b125d369..423e8208a 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalDataRepositorySearchResult.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositorySearchResult.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -23,9 +23,9 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -/** RetievalDataRepositorySearchResult */ +/** DataRepositorySearchResult */ // CHECKSTYLE:OFF -public class RetievalDataRepositorySearchResult +public class DataRepositorySearchResult // CHECKSTYLE:ON { @JsonProperty("dataRepository") @@ -34,18 +34,18 @@ public class RetievalDataRepositorySearchResult @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for RetievalDataRepositorySearchResult. */ - protected RetievalDataRepositorySearchResult() {} + /** Default constructor for DataRepositorySearchResult. */ + protected DataRepositorySearchResult() {} /** - * Set the dataRepository of this {@link RetievalDataRepositorySearchResult} instance and return - * the same instance. + * Set the dataRepository of this {@link DataRepositorySearchResult} instance and return the same + * instance. * - * @param dataRepository The dataRepository of this {@link RetievalDataRepositorySearchResult} - * @return The same instance of this {@link RetievalDataRepositorySearchResult} class + * @param dataRepository The dataRepository of this {@link DataRepositorySearchResult} + * @return The same instance of this {@link DataRepositorySearchResult} class */ @Nonnull - public RetievalDataRepositorySearchResult dataRepository( + public DataRepositorySearchResult dataRepository( @Nonnull final DataRepositoryWithDocuments dataRepository) { this.dataRepository = dataRepository; return this; @@ -54,8 +54,7 @@ public RetievalDataRepositorySearchResult dataRepository( /** * Get dataRepository * - * @return dataRepository The dataRepository of this {@link RetievalDataRepositorySearchResult} - * instance. + * @return dataRepository The dataRepository of this {@link DataRepositorySearchResult} instance. */ @Nonnull public DataRepositoryWithDocuments getDataRepository() { @@ -63,17 +62,16 @@ public DataRepositoryWithDocuments getDataRepository() { } /** - * Set the dataRepository of this {@link RetievalDataRepositorySearchResult} instance. + * Set the dataRepository of this {@link DataRepositorySearchResult} instance. * - * @param dataRepository The dataRepository of this {@link RetievalDataRepositorySearchResult} + * @param dataRepository The dataRepository of this {@link DataRepositorySearchResult} */ public void setDataRepository(@Nonnull final DataRepositoryWithDocuments dataRepository) { this.dataRepository = dataRepository; } /** - * Get the names of the unrecognizable properties of the {@link - * RetievalDataRepositorySearchResult}. + * Get the names of the unrecognizable properties of the {@link DataRepositorySearchResult}. * * @return The set of properties names */ @@ -84,7 +82,7 @@ public Set getCustomFieldNames() { } /** - * Get the value of an unrecognizable property of this {@link RetievalDataRepositorySearchResult} + * Get the value of an unrecognizable property of this {@link DataRepositorySearchResult} * instance. * * @deprecated Use {@link #toMap()} instead. @@ -97,14 +95,14 @@ public Set getCustomFieldNames() { public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( - "RetievalDataRepositorySearchResult has no field with name '" + name + "'."); + "DataRepositorySearchResult has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link RetievalDataRepositorySearchResult} instance - * including unrecognized properties. + * Get the value of all properties of this {@link DataRepositorySearchResult} instance including + * unrecognized properties. * * @return The map of all properties */ @@ -117,9 +115,8 @@ public Map toMap() { } /** - * Set an unrecognizable property of this {@link RetievalDataRepositorySearchResult} instance. If - * the map previously contained a mapping for the key, the old value is replaced by the specified - * value. + * Set an unrecognizable property of this {@link DataRepositorySearchResult} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. * * @param customFieldName The name of the property * @param customFieldValue The value of the property @@ -137,11 +134,10 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final RetievalDataRepositorySearchResult retievalDataRepositorySearchResult = - (RetievalDataRepositorySearchResult) o; + final DataRepositorySearchResult dataRepositorySearchResult = (DataRepositorySearchResult) o; return Objects.equals( - this.cloudSdkCustomFields, retievalDataRepositorySearchResult.cloudSdkCustomFields) - && Objects.equals(this.dataRepository, retievalDataRepositorySearchResult.dataRepository); + this.cloudSdkCustomFields, dataRepositorySearchResult.cloudSdkCustomFields) + && Objects.equals(this.dataRepository, dataRepositorySearchResult.dataRepository); } @Override @@ -153,7 +149,7 @@ public int hashCode() { @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class RetievalDataRepositorySearchResult {\n"); + sb.append("class DataRepositorySearchResult {\n"); sb.append(" dataRepository: ").append(toIndentedString(dataRepository)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> @@ -174,22 +170,21 @@ private String toIndentedString(final java.lang.Object o) { /** * Create a type-safe, fluent-api builder object to construct a new {@link - * RetievalDataRepositorySearchResult} instance with all required arguments. + * DataRepositorySearchResult} instance with all required arguments. */ public static Builder create() { - return (dataRepository) -> - new RetievalDataRepositorySearchResult().dataRepository(dataRepository); + return (dataRepository) -> new DataRepositorySearchResult().dataRepository(dataRepository); } /** Builder helper class. */ public interface Builder { /** - * Set the dataRepository of this {@link RetievalDataRepositorySearchResult} instance. + * Set the dataRepository of this {@link DataRepositorySearchResult} instance. * - * @param dataRepository The dataRepository of this {@link RetievalDataRepositorySearchResult} - * @return The RetievalDataRepositorySearchResult instance. + * @param dataRepository The dataRepository of this {@link DataRepositorySearchResult} + * @return The DataRepositorySearchResult instance. */ - RetievalDataRepositorySearchResult dataRepository( + DataRepositorySearchResult dataRepository( @Nonnull final DataRepositoryWithDocuments dataRepository); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalSearchResults.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositorySearchResults.java similarity index 62% rename from core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalSearchResults.java rename to core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositorySearchResults.java index 060878e7c..392df0da3 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalSearchResults.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositorySearchResults.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -26,9 +26,9 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -/** RetievalSearchResults */ +/** DataRepositorySearchResults */ // CHECKSTYLE:OFF -public class RetievalSearchResults +public class DataRepositorySearchResults // CHECKSTYLE:ON { @JsonProperty("results") @@ -37,29 +37,30 @@ public class RetievalSearchResults @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for RetievalSearchResults. */ - protected RetievalSearchResults() {} + /** Default constructor for DataRepositorySearchResults. */ + protected DataRepositorySearchResults() {} /** - * Set the results of this {@link RetievalSearchResults} instance and return the same instance. + * Set the results of this {@link DataRepositorySearchResults} instance and return the same + * instance. * * @param results List of returned results. - * @return The same instance of this {@link RetievalSearchResults} class + * @return The same instance of this {@link DataRepositorySearchResults} class */ @Nonnull - public RetievalSearchResults results(@Nonnull final List results) { + public DataRepositorySearchResults results(@Nonnull final List results) { this.results = results; return this; } /** - * Add one results instance to this {@link RetievalSearchResults}. + * Add one results instance to this {@link DataRepositorySearchResults}. * * @param resultsItem The results that should be added - * @return The same instance of type {@link RetievalSearchResults} + * @return The same instance of type {@link DataRepositorySearchResults} */ @Nonnull - public RetievalSearchResults addResultsItem(@Nonnull final ResultsInner1 resultsItem) { + public DataRepositorySearchResults addResultsItem(@Nonnull final ResultsInner1 resultsItem) { if (this.results == null) { this.results = new ArrayList<>(); } @@ -70,7 +71,7 @@ public RetievalSearchResults addResultsItem(@Nonnull final ResultsInner1 results /** * List of returned results. * - * @return results The results of this {@link RetievalSearchResults} instance. + * @return results The results of this {@link DataRepositorySearchResults} instance. */ @Nonnull public List getResults() { @@ -78,7 +79,7 @@ public List getResults() { } /** - * Set the results of this {@link RetievalSearchResults} instance. + * Set the results of this {@link DataRepositorySearchResults} instance. * * @param results List of returned results. */ @@ -87,7 +88,7 @@ public void setResults(@Nonnull final List results) { } /** - * Get the names of the unrecognizable properties of the {@link RetievalSearchResults}. + * Get the names of the unrecognizable properties of the {@link DataRepositorySearchResults}. * * @return The set of properties names */ @@ -98,7 +99,8 @@ public Set getCustomFieldNames() { } /** - * Get the value of an unrecognizable property of this {@link RetievalSearchResults} instance. + * Get the value of an unrecognizable property of this {@link DataRepositorySearchResults} + * instance. * * @deprecated Use {@link #toMap()} instead. * @param name The name of the property @@ -110,13 +112,13 @@ public Set getCustomFieldNames() { public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( - "RetievalSearchResults has no field with name '" + name + "'."); + "DataRepositorySearchResults has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link RetievalSearchResults} instance including + * Get the value of all properties of this {@link DataRepositorySearchResults} instance including * unrecognized properties. * * @return The map of all properties @@ -130,7 +132,7 @@ public Map toMap() { } /** - * Set an unrecognizable property of this {@link RetievalSearchResults} instance. If the map + * Set an unrecognizable property of this {@link DataRepositorySearchResults} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. * * @param customFieldName The name of the property @@ -149,9 +151,10 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final RetievalSearchResults retievalSearchResults = (RetievalSearchResults) o; - return Objects.equals(this.cloudSdkCustomFields, retievalSearchResults.cloudSdkCustomFields) - && Objects.equals(this.results, retievalSearchResults.results); + final DataRepositorySearchResults dataRepositorySearchResults = (DataRepositorySearchResults) o; + return Objects.equals( + this.cloudSdkCustomFields, dataRepositorySearchResults.cloudSdkCustomFields) + && Objects.equals(this.results, dataRepositorySearchResults.results); } @Override @@ -163,7 +166,7 @@ public int hashCode() { @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class RetievalSearchResults {\n"); + sb.append("class DataRepositorySearchResults {\n"); sb.append(" results: ").append(toIndentedString(results)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> @@ -183,30 +186,30 @@ private String toIndentedString(final java.lang.Object o) { } /** - * Create a type-safe, fluent-api builder object to construct a new {@link RetievalSearchResults} - * instance with all required arguments. + * Create a type-safe, fluent-api builder object to construct a new {@link + * DataRepositorySearchResults} instance with all required arguments. */ public static Builder create() { - return (results) -> new RetievalSearchResults().results(results); + return (results) -> new DataRepositorySearchResults().results(results); } /** Builder helper class. */ public interface Builder { /** - * Set the results of this {@link RetievalSearchResults} instance. + * Set the results of this {@link DataRepositorySearchResults} instance. * * @param results List of returned results. - * @return The RetievalSearchResults instance. + * @return The DataRepositorySearchResults instance. */ - RetievalSearchResults results(@Nonnull final List results); + DataRepositorySearchResults results(@Nonnull final List results); /** - * Set the results of this {@link RetievalSearchResults} instance. + * Set the results of this {@link DataRepositorySearchResults} instance. * * @param results List of returned results. - * @return The RetievalSearchResults instance. + * @return The DataRepositorySearchResults instance. */ - default RetievalSearchResults results(@Nonnull final ResultsInner1... results) { + default DataRepositorySearchResults results(@Nonnull final ResultsInner1... results) { return results(Arrays.asList(results)); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryType.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryType.java index 0d7d8fff9..b3cc53040 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryType.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryType.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -19,6 +19,8 @@ public enum DataRepositoryType { VECTOR("vector"), + HELP_SAP_COM("help.sap.com"), + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); private final String value; diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryWithDocuments.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryWithDocuments.java index 95a009f35..b2dbc8cec 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryWithDocuments.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositoryWithDocuments.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -42,7 +42,7 @@ public class DataRepositoryWithDocuments private List metadata = new ArrayList<>(); @JsonProperty("documents") - private List documents = new ArrayList<>(); + private List documents = new ArrayList<>(); @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -171,7 +171,7 @@ public void setMetadata(@Nullable final List metadata) { * @return The same instance of this {@link DataRepositoryWithDocuments} class */ @Nonnull - public DataRepositoryWithDocuments documents(@Nonnull final List documents) { + public DataRepositoryWithDocuments documents(@Nonnull final List documents) { this.documents = documents; return this; } @@ -183,8 +183,7 @@ public DataRepositoryWithDocuments documents(@Nonnull final List(); } @@ -198,7 +197,7 @@ public DataRepositoryWithDocuments addDocumentsItem( * @return documents The documents of this {@link DataRepositoryWithDocuments} instance. */ @Nonnull - public List getDocuments() { + public List getDocuments() { return documents; } @@ -207,7 +206,7 @@ public List getDocuments() { * * @param documents The documents of this {@link DataRepositoryWithDocuments} */ - public void setDocuments(@Nonnull final List documents) { + public void setDocuments(@Nonnull final List documents) { this.documents = documents; } @@ -359,7 +358,7 @@ public interface Builder2 { * @param documents The documents of this {@link DataRepositoryWithDocuments} * @return The DataRepositoryWithDocuments instance. */ - DataRepositoryWithDocuments documents(@Nonnull final List documents); + DataRepositoryWithDocuments documents(@Nonnull final List documents); /** * Set the documents of this {@link DataRepositoryWithDocuments} instance. @@ -367,7 +366,7 @@ public interface Builder2 { * @param documents The documents of this {@link DataRepositoryWithDocuments} * @return The DataRepositoryWithDocuments instance. */ - default DataRepositoryWithDocuments documents(@Nonnull final RetrievalDocument... documents) { + default DataRepositoryWithDocuments documents(@Nonnull final Document... documents) { return documents(Arrays.asList(documents)); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DetailsErrorResponse.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DetailsErrorResponse.java index d0852bc24..a3b26e424 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DetailsErrorResponse.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DetailsErrorResponse.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDocument.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Document.java similarity index 58% rename from core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDocument.java rename to core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Document.java index b85085236..f60c56b31 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDocument.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Document.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -26,9 +26,9 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -/** RetrievalDocument */ +/** Document */ // CHECKSTYLE:OFF -public class RetrievalDocument +public class Document // CHECKSTYLE:ON { @JsonProperty("id") @@ -43,17 +43,17 @@ public class RetrievalDocument @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for RetrievalDocument. */ - protected RetrievalDocument() {} + /** Default constructor for Document. */ + protected Document() {} /** - * Set the id of this {@link RetrievalDocument} instance and return the same instance. + * Set the id of this {@link Document} instance and return the same instance. * - * @param id The id of this {@link RetrievalDocument} - * @return The same instance of this {@link RetrievalDocument} class + * @param id The id of this {@link Document} + * @return The same instance of this {@link Document} class */ @Nonnull - public RetrievalDocument id(@Nonnull final String id) { + public Document id(@Nonnull final String id) { this.id = id; return this; } @@ -61,7 +61,7 @@ public RetrievalDocument id(@Nonnull final String id) { /** * Get id * - * @return id The id of this {@link RetrievalDocument} instance. + * @return id The id of this {@link Document} instance. */ @Nonnull public String getId() { @@ -69,34 +69,34 @@ public String getId() { } /** - * Set the id of this {@link RetrievalDocument} instance. + * Set the id of this {@link Document} instance. * - * @param id The id of this {@link RetrievalDocument} + * @param id The id of this {@link Document} */ public void setId(@Nonnull final String id) { this.id = id; } /** - * Set the metadata of this {@link RetrievalDocument} instance and return the same instance. + * Set the metadata of this {@link Document} instance and return the same instance. * - * @param metadata The metadata of this {@link RetrievalDocument} - * @return The same instance of this {@link RetrievalDocument} class + * @param metadata The metadata of this {@link Document} + * @return The same instance of this {@link Document} class */ @Nonnull - public RetrievalDocument metadata(@Nullable final List metadata) { + public Document metadata(@Nullable final List metadata) { this.metadata = metadata; return this; } /** - * Add one metadata instance to this {@link RetrievalDocument}. + * Add one metadata instance to this {@link Document}. * * @param metadataItem The metadata that should be added - * @return The same instance of type {@link RetrievalDocument} + * @return The same instance of type {@link Document} */ @Nonnull - public RetrievalDocument addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { + public Document addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { if (this.metadata == null) { this.metadata = new ArrayList<>(); } @@ -107,7 +107,7 @@ public RetrievalDocument addMetadataItem(@Nonnull final DocumentKeyValueListPair /** * Get metadata * - * @return metadata The metadata of this {@link RetrievalDocument} instance. + * @return metadata The metadata of this {@link Document} instance. */ @Nonnull public List getMetadata() { @@ -115,34 +115,34 @@ public List getMetadata() { } /** - * Set the metadata of this {@link RetrievalDocument} instance. + * Set the metadata of this {@link Document} instance. * - * @param metadata The metadata of this {@link RetrievalDocument} + * @param metadata The metadata of this {@link Document} */ public void setMetadata(@Nullable final List metadata) { this.metadata = metadata; } /** - * Set the chunks of this {@link RetrievalDocument} instance and return the same instance. + * Set the chunks of this {@link Document} instance and return the same instance. * - * @param chunks The chunks of this {@link RetrievalDocument} - * @return The same instance of this {@link RetrievalDocument} class + * @param chunks The chunks of this {@link Document} + * @return The same instance of this {@link Document} class */ @Nonnull - public RetrievalDocument chunks(@Nonnull final List chunks) { + public Document chunks(@Nonnull final List chunks) { this.chunks = chunks; return this; } /** - * Add one chunks instance to this {@link RetrievalDocument}. + * Add one chunks instance to this {@link Document}. * * @param chunksItem The chunks that should be added - * @return The same instance of type {@link RetrievalDocument} + * @return The same instance of type {@link Document} */ @Nonnull - public RetrievalDocument addChunksItem(@Nonnull final Chunk chunksItem) { + public Document addChunksItem(@Nonnull final Chunk chunksItem) { if (this.chunks == null) { this.chunks = new ArrayList<>(); } @@ -153,7 +153,7 @@ public RetrievalDocument addChunksItem(@Nonnull final Chunk chunksItem) { /** * Get chunks * - * @return chunks The chunks of this {@link RetrievalDocument} instance. + * @return chunks The chunks of this {@link Document} instance. */ @Nonnull public List getChunks() { @@ -161,16 +161,16 @@ public List getChunks() { } /** - * Set the chunks of this {@link RetrievalDocument} instance. + * Set the chunks of this {@link Document} instance. * - * @param chunks The chunks of this {@link RetrievalDocument} + * @param chunks The chunks of this {@link Document} */ public void setChunks(@Nonnull final List chunks) { this.chunks = chunks; } /** - * Get the names of the unrecognizable properties of the {@link RetrievalDocument}. + * Get the names of the unrecognizable properties of the {@link Document}. * * @return The set of properties names */ @@ -181,7 +181,7 @@ public Set getCustomFieldNames() { } /** - * Get the value of an unrecognizable property of this {@link RetrievalDocument} instance. + * Get the value of an unrecognizable property of this {@link Document} instance. * * @deprecated Use {@link #toMap()} instead. * @param name The name of the property @@ -192,14 +192,14 @@ public Set getCustomFieldNames() { @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("RetrievalDocument has no field with name '" + name + "'."); + throw new NoSuchElementException("Document has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link RetrievalDocument} instance including - * unrecognized properties. + * Get the value of all properties of this {@link Document} instance including unrecognized + * properties. * * @return The map of all properties */ @@ -214,8 +214,8 @@ public Map toMap() { } /** - * Set an unrecognizable property of this {@link RetrievalDocument} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. + * Set an unrecognizable property of this {@link Document} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. * * @param customFieldName The name of the property * @param customFieldValue The value of the property @@ -233,11 +233,11 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final RetrievalDocument retrievalDocument = (RetrievalDocument) o; - return Objects.equals(this.cloudSdkCustomFields, retrievalDocument.cloudSdkCustomFields) - && Objects.equals(this.id, retrievalDocument.id) - && Objects.equals(this.metadata, retrievalDocument.metadata) - && Objects.equals(this.chunks, retrievalDocument.chunks); + final Document document = (Document) o; + return Objects.equals(this.cloudSdkCustomFields, document.cloudSdkCustomFields) + && Objects.equals(this.id, document.id) + && Objects.equals(this.metadata, document.metadata) + && Objects.equals(this.chunks, document.chunks); } @Override @@ -249,7 +249,7 @@ public int hashCode() { @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class RetrievalDocument {\n"); + sb.append("class Document {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); sb.append(" chunks: ").append(toIndentedString(chunks)).append("\n"); @@ -271,20 +271,20 @@ private String toIndentedString(final java.lang.Object o) { } /** - * Create a type-safe, fluent-api builder object to construct a new {@link RetrievalDocument} - * instance with all required arguments. + * Create a type-safe, fluent-api builder object to construct a new {@link Document} instance with + * all required arguments. */ public static Builder create() { - return (id) -> (chunks) -> new RetrievalDocument().id(id).chunks(chunks); + return (id) -> (chunks) -> new Document().id(id).chunks(chunks); } /** Builder helper class. */ public interface Builder { /** - * Set the id of this {@link RetrievalDocument} instance. + * Set the id of this {@link Document} instance. * - * @param id The id of this {@link RetrievalDocument} - * @return The RetrievalDocument builder. + * @param id The id of this {@link Document} + * @return The Document builder. */ Builder1 id(@Nonnull final String id); } @@ -292,20 +292,20 @@ public interface Builder { /** Builder helper class. */ public interface Builder1 { /** - * Set the chunks of this {@link RetrievalDocument} instance. + * Set the chunks of this {@link Document} instance. * - * @param chunks The chunks of this {@link RetrievalDocument} - * @return The RetrievalDocument instance. + * @param chunks The chunks of this {@link Document} + * @return The Document instance. */ - RetrievalDocument chunks(@Nonnull final List chunks); + Document chunks(@Nonnull final List chunks); /** - * Set the chunks of this {@link RetrievalDocument} instance. + * Set the chunks of this {@link Document} instance. * - * @param chunks The chunks of this {@link RetrievalDocument} - * @return The RetrievalDocument instance. + * @param chunks The chunks of this {@link Document} + * @return The Document instance. */ - default RetrievalDocument chunks(@Nonnull final Chunk... chunks) { + default Document chunks(@Nonnull final Chunk... chunks) { return chunks(Arrays.asList(chunks)); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java index 18ebe7798..02bc02483 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentCreateRequest.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java index a02c58f7a..95a55a1c2 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentInput.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java index 7f29322f2..38a9c5cb7 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentKeyValueListPair.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentOutput.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentOutput.java index c4d42f22f..972994555 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentOutput.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentOutput.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentResponse.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentResponse.java index 98e2d195f..6c27f1ec8 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentResponse.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentResponse.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentStatus.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentStatus.java new file mode 100644 index 000000000..cfbb1235c --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentStatus.java @@ -0,0 +1,72 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.annotation.Nonnull; + +/** Gets or Sets DocumentStatus */ +public enum DocumentStatus { + TO_BE_PROCESSED("TO_BE_PROCESSED"), + + INDEXED("INDEXED"), + + REINDEXED("REINDEXED"), + + DEINDEXED("DEINDEXED"), + + FAILED("FAILED"), + + FAILED_TO_BE_RETRIED("FAILED_TO_BE_RETRIED"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + DocumentStatus(String value) { + this.value = value; + } + + /** + * @return The enum value. + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * @return The String representation of the enum value. + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Converts the given value to its enum representation. + * + * @param value The input value. + * @return The enum representation of the given value. + */ + @JsonCreator + public static DocumentStatus fromValue(@Nonnull final String value) { + for (final DocumentStatus b : DocumentStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java index f4aea0d44..7d8a0ea99 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentUpdateRequest.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentWithoutChunks.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentWithoutChunks.java index bf1bda4a0..524d54dbd 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentWithoutChunks.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentWithoutChunks.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Documents.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Documents.java index 156028b44..fc9442919 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Documents.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Documents.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -31,18 +31,49 @@ public class Documents // CHECKSTYLE:ON { - @JsonProperty("resources") - private List resources = new ArrayList<>(); - @JsonProperty("count") private Integer count; + @JsonProperty("resources") + private List resources = new ArrayList<>(); + @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); /** Default constructor for Documents. */ protected Documents() {} + /** + * Set the count of this {@link Documents} instance and return the same instance. + * + * @param count The count of this {@link Documents} + * @return The same instance of this {@link Documents} class + */ + @Nonnull + public Documents count(@Nullable final Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count The count of this {@link Documents} instance. + */ + @Nonnull + public Integer getCount() { + return count; + } + + /** + * Set the count of this {@link Documents} instance. + * + * @param count The count of this {@link Documents} + */ + public void setCount(@Nullable final Integer count) { + this.count = count; + } + /** * Set the resources of this {@link Documents} instance and return the same instance. * @@ -89,37 +120,6 @@ public void setResources(@Nonnull final List resources) { this.resources = resources; } - /** - * Set the count of this {@link Documents} instance and return the same instance. - * - * @param count The count of this {@link Documents} - * @return The same instance of this {@link Documents} class - */ - @Nonnull - public Documents count(@Nullable final Integer count) { - this.count = count; - return this; - } - - /** - * Get count - * - * @return count The count of this {@link Documents} instance. - */ - @Nonnull - public Integer getCount() { - return count; - } - - /** - * Set the count of this {@link Documents} instance. - * - * @param count The count of this {@link Documents} - */ - public void setCount(@Nullable final Integer count) { - this.count = count; - } - /** * Get the names of the unrecognizable properties of the {@link Documents}. * @@ -158,8 +158,8 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc @Nonnull public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (resources != null) declaredFields.put("resources", resources); if (count != null) declaredFields.put("count", count); + if (resources != null) declaredFields.put("resources", resources); return declaredFields; } @@ -185,13 +185,13 @@ public boolean equals(@Nullable final java.lang.Object o) { } final Documents documents = (Documents) o; return Objects.equals(this.cloudSdkCustomFields, documents.cloudSdkCustomFields) - && Objects.equals(this.resources, documents.resources) - && Objects.equals(this.count, documents.count); + && Objects.equals(this.count, documents.count) + && Objects.equals(this.resources, documents.resources); } @Override public int hashCode() { - return Objects.hash(resources, count, cloudSdkCustomFields); + return Objects.hash(count, resources, cloudSdkCustomFields); } @Override @@ -199,8 +199,8 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class Documents {\n"); - sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsChunk.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsChunk.java index 169928d72..b79c0c891 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsChunk.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsChunk.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsListResponse.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsListResponse.java index fbe562fc9..5531d854b 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsListResponse.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsListResponse.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsStatusResponse.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsStatusResponse.java new file mode 100644 index 000000000..8b282679d --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsStatusResponse.java @@ -0,0 +1,228 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** DocumentsStatusResponse */ +// CHECKSTYLE:OFF +public class DocumentsStatusResponse +// CHECKSTYLE:ON +{ + @JsonProperty("count") + private Integer count; + + @JsonProperty("resources") + private List resources = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentsStatusResponse. */ + protected DocumentsStatusResponse() {} + + /** + * Set the count of this {@link DocumentsStatusResponse} instance and return the same instance. + * + * @param count The count of this {@link DocumentsStatusResponse} + * @return The same instance of this {@link DocumentsStatusResponse} class + */ + @Nonnull + public DocumentsStatusResponse count(@Nullable final Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count The count of this {@link DocumentsStatusResponse} instance. + */ + @Nonnull + public Integer getCount() { + return count; + } + + /** + * Set the count of this {@link DocumentsStatusResponse} instance. + * + * @param count The count of this {@link DocumentsStatusResponse} + */ + public void setCount(@Nullable final Integer count) { + this.count = count; + } + + /** + * Set the resources of this {@link DocumentsStatusResponse} instance and return the same + * instance. + * + * @param resources The resources of this {@link DocumentsStatusResponse} + * @return The same instance of this {@link DocumentsStatusResponse} class + */ + @Nonnull + public DocumentsStatusResponse resources( + @Nullable final List resources) { + this.resources = resources; + return this; + } + + /** + * Add one resources instance to this {@link DocumentsStatusResponse}. + * + * @param resourcesItem The resources that should be added + * @return The same instance of type {@link DocumentsStatusResponse} + */ + @Nonnull + public DocumentsStatusResponse addResourcesItem( + @Nonnull final DocumentsStatusResponseResourcesInner resourcesItem) { + if (this.resources == null) { + this.resources = new ArrayList<>(); + } + this.resources.add(resourcesItem); + return this; + } + + /** + * Get resources + * + * @return resources The resources of this {@link DocumentsStatusResponse} instance. + */ + @Nonnull + public List getResources() { + return resources; + } + + /** + * Set the resources of this {@link DocumentsStatusResponse} instance. + * + * @param resources The resources of this {@link DocumentsStatusResponse} + */ + public void setResources(@Nullable final List resources) { + this.resources = resources; + } + + /** + * Get the names of the unrecognizable properties of the {@link DocumentsStatusResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DocumentsStatusResponse} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "DocumentsStatusResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link DocumentsStatusResponse} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (count != null) declaredFields.put("count", count); + if (resources != null) declaredFields.put("resources", resources); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link DocumentsStatusResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentsStatusResponse documentsStatusResponse = (DocumentsStatusResponse) o; + return Objects.equals(this.cloudSdkCustomFields, documentsStatusResponse.cloudSdkCustomFields) + && Objects.equals(this.count, documentsStatusResponse.count) + && Objects.equals(this.resources, documentsStatusResponse.resources); + } + + @Override + public int hashCode() { + return Objects.hash(count, resources, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentsStatusResponse {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link DocumentsStatusResponse} instance. No arguments are required. */ + public static DocumentsStatusResponse create() { + return new DocumentsStatusResponse(); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsStatusResponseResourcesInner.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsStatusResponseResourcesInner.java new file mode 100644 index 000000000..5c9a182e1 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentsStatusResponseResourcesInner.java @@ -0,0 +1,217 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** DocumentsStatusResponseResourcesInner */ +// CHECKSTYLE:OFF +public class DocumentsStatusResponseResourcesInner +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("status") + private DocumentStatus status; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DocumentsStatusResponseResourcesInner. */ + protected DocumentsStatusResponseResourcesInner() {} + + /** + * Set the id of this {@link DocumentsStatusResponseResourcesInner} instance and return the same + * instance. + * + * @param id The id of this {@link DocumentsStatusResponseResourcesInner} + * @return The same instance of this {@link DocumentsStatusResponseResourcesInner} class + */ + @Nonnull + public DocumentsStatusResponseResourcesInner id(@Nullable final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link DocumentsStatusResponseResourcesInner} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link DocumentsStatusResponseResourcesInner} instance. + * + * @param id The id of this {@link DocumentsStatusResponseResourcesInner} + */ + public void setId(@Nullable final String id) { + this.id = id; + } + + /** + * Set the status of this {@link DocumentsStatusResponseResourcesInner} instance and return the + * same instance. + * + * @param status The status of this {@link DocumentsStatusResponseResourcesInner} + * @return The same instance of this {@link DocumentsStatusResponseResourcesInner} class + */ + @Nonnull + public DocumentsStatusResponseResourcesInner status(@Nullable final DocumentStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status The status of this {@link DocumentsStatusResponseResourcesInner} instance. + */ + @Nonnull + public DocumentStatus getStatus() { + return status; + } + + /** + * Set the status of this {@link DocumentsStatusResponseResourcesInner} instance. + * + * @param status The status of this {@link DocumentsStatusResponseResourcesInner} + */ + public void setStatus(@Nullable final DocumentStatus status) { + this.status = status; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * DocumentsStatusResponseResourcesInner}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * DocumentsStatusResponseResourcesInner} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "DocumentsStatusResponseResourcesInner has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link DocumentsStatusResponseResourcesInner} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (status != null) declaredFields.put("status", status); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link DocumentsStatusResponseResourcesInner} instance. + * If the map previously contained a mapping for the key, the old value is replaced by the + * specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DocumentsStatusResponseResourcesInner documentsStatusResponseResourcesInner = + (DocumentsStatusResponseResourcesInner) o; + return Objects.equals( + this.cloudSdkCustomFields, documentsStatusResponseResourcesInner.cloudSdkCustomFields) + && Objects.equals(this.id, documentsStatusResponseResourcesInner.id) + && Objects.equals(this.status, documentsStatusResponseResourcesInner.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, status, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DocumentsStatusResponseResourcesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a new {@link DocumentsStatusResponseResourcesInner} instance. No arguments are required. + */ + public static DocumentsStatusResponseResourcesInner create() { + return new DocumentsStatusResponseResourcesInner(); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java index 5e34f8729..1d124cf29 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/EmbeddingConfig.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipeline.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipeline.java new file mode 100644 index 000000000..8eb624ce7 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipeline.java @@ -0,0 +1,31 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** GetPipeline */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = MSSharePointPipelineGetResponse.class, name = "MSSharePoint"), + @JsonSubTypes.Type(value = S3PipelineGetResponse.class, name = "S3"), + @JsonSubTypes.Type(value = SFTPPipelineGetResponse.class, name = "SFTP"), + @JsonSubTypes.Type( + value = MSSharePointPipelineGetResponse.class, + name = "MSSharePointPipelineGetResponse"), + @JsonSubTypes.Type(value = S3PipelineGetResponse.class, name = "S3PipelineGetResponse"), + @JsonSubTypes.Type(value = SFTPPipelineGetResponse.class, name = "SFTPPipelineGetResponse"), +}) +public interface GetPipeline { + Object getType(); +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipelineExecutionById.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipelineExecutionById.java new file mode 100644 index 000000000..12a0afef7 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipelineExecutionById.java @@ -0,0 +1,284 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** GetPipelineExecutionById */ +// CHECKSTYLE:OFF +public class GetPipelineExecutionById +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("createdAt") + private String createdAt; + + @JsonProperty("modifiedAt") + private String modifiedAt; + + @JsonProperty("status") + private PipelineExecutionStatus status; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for GetPipelineExecutionById. */ + protected GetPipelineExecutionById() {} + + /** + * Set the id of this {@link GetPipelineExecutionById} instance and return the same instance. + * + * @param id The id of this {@link GetPipelineExecutionById} + * @return The same instance of this {@link GetPipelineExecutionById} class + */ + @Nonnull + public GetPipelineExecutionById id(@Nullable final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link GetPipelineExecutionById} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link GetPipelineExecutionById} instance. + * + * @param id The id of this {@link GetPipelineExecutionById} + */ + public void setId(@Nullable final String id) { + this.id = id; + } + + /** + * Set the createdAt of this {@link GetPipelineExecutionById} instance and return the same + * instance. + * + * @param createdAt The createdAt of this {@link GetPipelineExecutionById} + * @return The same instance of this {@link GetPipelineExecutionById} class + */ + @Nonnull + public GetPipelineExecutionById createdAt(@Nullable final String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * + * @return createdAt The createdAt of this {@link GetPipelineExecutionById} instance. + */ + @Nonnull + public String getCreatedAt() { + return createdAt; + } + + /** + * Set the createdAt of this {@link GetPipelineExecutionById} instance. + * + * @param createdAt The createdAt of this {@link GetPipelineExecutionById} + */ + public void setCreatedAt(@Nullable final String createdAt) { + this.createdAt = createdAt; + } + + /** + * Set the modifiedAt of this {@link GetPipelineExecutionById} instance and return the same + * instance. + * + * @param modifiedAt The modifiedAt of this {@link GetPipelineExecutionById} + * @return The same instance of this {@link GetPipelineExecutionById} class + */ + @Nonnull + public GetPipelineExecutionById modifiedAt(@Nullable final String modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Get modifiedAt + * + * @return modifiedAt The modifiedAt of this {@link GetPipelineExecutionById} instance. + */ + @Nonnull + public String getModifiedAt() { + return modifiedAt; + } + + /** + * Set the modifiedAt of this {@link GetPipelineExecutionById} instance. + * + * @param modifiedAt The modifiedAt of this {@link GetPipelineExecutionById} + */ + public void setModifiedAt(@Nullable final String modifiedAt) { + this.modifiedAt = modifiedAt; + } + + /** + * Set the status of this {@link GetPipelineExecutionById} instance and return the same instance. + * + * @param status The status of this {@link GetPipelineExecutionById} + * @return The same instance of this {@link GetPipelineExecutionById} class + */ + @Nonnull + public GetPipelineExecutionById status(@Nullable final PipelineExecutionStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status The status of this {@link GetPipelineExecutionById} instance. + */ + @Nonnull + public PipelineExecutionStatus getStatus() { + return status; + } + + /** + * Set the status of this {@link GetPipelineExecutionById} instance. + * + * @param status The status of this {@link GetPipelineExecutionById} + */ + public void setStatus(@Nullable final PipelineExecutionStatus status) { + this.status = status; + } + + /** + * Get the names of the unrecognizable properties of the {@link GetPipelineExecutionById}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link GetPipelineExecutionById} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "GetPipelineExecutionById has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link GetPipelineExecutionById} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (createdAt != null) declaredFields.put("createdAt", createdAt); + if (modifiedAt != null) declaredFields.put("modifiedAt", modifiedAt); + if (status != null) declaredFields.put("status", status); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link GetPipelineExecutionById} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final GetPipelineExecutionById getPipelineExecutionById = (GetPipelineExecutionById) o; + return Objects.equals(this.cloudSdkCustomFields, getPipelineExecutionById.cloudSdkCustomFields) + && Objects.equals(this.id, getPipelineExecutionById.id) + && Objects.equals(this.createdAt, getPipelineExecutionById.createdAt) + && Objects.equals(this.modifiedAt, getPipelineExecutionById.modifiedAt) + && Objects.equals(this.status, getPipelineExecutionById.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, createdAt, modifiedAt, status, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class GetPipelineExecutionById {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link GetPipelineExecutionById} instance. No arguments are required. */ + public static GetPipelineExecutionById create() { + return new GetPipelineExecutionById(); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipelineExecutions.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipelineExecutions.java new file mode 100644 index 000000000..d91272b9e --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipelineExecutions.java @@ -0,0 +1,226 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** GetPipelineExecutions */ +// CHECKSTYLE:OFF +public class GetPipelineExecutions +// CHECKSTYLE:ON +{ + @JsonProperty("count") + private Integer count; + + @JsonProperty("resources") + private List resources = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for GetPipelineExecutions. */ + protected GetPipelineExecutions() {} + + /** + * Set the count of this {@link GetPipelineExecutions} instance and return the same instance. + * + * @param count The count of this {@link GetPipelineExecutions} + * @return The same instance of this {@link GetPipelineExecutions} class + */ + @Nonnull + public GetPipelineExecutions count(@Nullable final Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count The count of this {@link GetPipelineExecutions} instance. + */ + @Nonnull + public Integer getCount() { + return count; + } + + /** + * Set the count of this {@link GetPipelineExecutions} instance. + * + * @param count The count of this {@link GetPipelineExecutions} + */ + public void setCount(@Nullable final Integer count) { + this.count = count; + } + + /** + * Set the resources of this {@link GetPipelineExecutions} instance and return the same instance. + * + * @param resources The resources of this {@link GetPipelineExecutions} + * @return The same instance of this {@link GetPipelineExecutions} class + */ + @Nonnull + public GetPipelineExecutions resources(@Nullable final List resources) { + this.resources = resources; + return this; + } + + /** + * Add one resources instance to this {@link GetPipelineExecutions}. + * + * @param resourcesItem The resources that should be added + * @return The same instance of type {@link GetPipelineExecutions} + */ + @Nonnull + public GetPipelineExecutions addResourcesItem( + @Nonnull final PipelineExecutionData resourcesItem) { + if (this.resources == null) { + this.resources = new ArrayList<>(); + } + this.resources.add(resourcesItem); + return this; + } + + /** + * Get resources + * + * @return resources The resources of this {@link GetPipelineExecutions} instance. + */ + @Nonnull + public List getResources() { + return resources; + } + + /** + * Set the resources of this {@link GetPipelineExecutions} instance. + * + * @param resources The resources of this {@link GetPipelineExecutions} + */ + public void setResources(@Nullable final List resources) { + this.resources = resources; + } + + /** + * Get the names of the unrecognizable properties of the {@link GetPipelineExecutions}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link GetPipelineExecutions} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "GetPipelineExecutions has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link GetPipelineExecutions} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (count != null) declaredFields.put("count", count); + if (resources != null) declaredFields.put("resources", resources); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link GetPipelineExecutions} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final GetPipelineExecutions getPipelineExecutions = (GetPipelineExecutions) o; + return Objects.equals(this.cloudSdkCustomFields, getPipelineExecutions.cloudSdkCustomFields) + && Objects.equals(this.count, getPipelineExecutions.count) + && Objects.equals(this.resources, getPipelineExecutions.resources); + } + + @Override + public int hashCode() { + return Objects.hash(count, resources, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class GetPipelineExecutions {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link GetPipelineExecutions} instance. No arguments are required. */ + public static GetPipelineExecutions create() { + return new GetPipelineExecutions(); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipelineStatus.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipelineStatus.java new file mode 100644 index 000000000..fb54a8ccf --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipelineStatus.java @@ -0,0 +1,207 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** GetPipelineStatus */ +// CHECKSTYLE:OFF +public class GetPipelineStatus +// CHECKSTYLE:ON +{ + @JsonProperty("lastStarted") + private String lastStarted; + + @JsonProperty("status") + private PipelineExecutionStatus status; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for GetPipelineStatus. */ + protected GetPipelineStatus() {} + + /** + * Set the lastStarted of this {@link GetPipelineStatus} instance and return the same instance. + * + * @param lastStarted The lastStarted of this {@link GetPipelineStatus} + * @return The same instance of this {@link GetPipelineStatus} class + */ + @Nonnull + public GetPipelineStatus lastStarted(@Nullable final String lastStarted) { + this.lastStarted = lastStarted; + return this; + } + + /** + * Get lastStarted + * + * @return lastStarted The lastStarted of this {@link GetPipelineStatus} instance. + */ + @Nonnull + public String getLastStarted() { + return lastStarted; + } + + /** + * Set the lastStarted of this {@link GetPipelineStatus} instance. + * + * @param lastStarted The lastStarted of this {@link GetPipelineStatus} + */ + public void setLastStarted(@Nullable final String lastStarted) { + this.lastStarted = lastStarted; + } + + /** + * Set the status of this {@link GetPipelineStatus} instance and return the same instance. + * + * @param status The status of this {@link GetPipelineStatus} + * @return The same instance of this {@link GetPipelineStatus} class + */ + @Nonnull + public GetPipelineStatus status(@Nullable final PipelineExecutionStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status The status of this {@link GetPipelineStatus} instance. + */ + @Nonnull + public PipelineExecutionStatus getStatus() { + return status; + } + + /** + * Set the status of this {@link GetPipelineStatus} instance. + * + * @param status The status of this {@link GetPipelineStatus} + */ + public void setStatus(@Nullable final PipelineExecutionStatus status) { + this.status = status; + } + + /** + * Get the names of the unrecognizable properties of the {@link GetPipelineStatus}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link GetPipelineStatus} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("GetPipelineStatus has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link GetPipelineStatus} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (lastStarted != null) declaredFields.put("lastStarted", lastStarted); + if (status != null) declaredFields.put("status", status); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link GetPipelineStatus} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final GetPipelineStatus getPipelineStatus = (GetPipelineStatus) o; + return Objects.equals(this.cloudSdkCustomFields, getPipelineStatus.cloudSdkCustomFields) + && Objects.equals(this.lastStarted, getPipelineStatus.lastStarted) + && Objects.equals(this.status, getPipelineStatus.status); + } + + @Override + public int hashCode() { + return Objects.hash(lastStarted, status, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class GetPipelineStatus {\n"); + sb.append(" lastStarted: ").append(toIndentedString(lastStarted)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link GetPipelineStatus} instance. No arguments are required. */ + public static GetPipelineStatus create() { + return new GetPipelineStatus(); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipelines.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipelines.java similarity index 58% rename from core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipelines.java rename to core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipelines.java index e04fa932a..62270acac 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipelines.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipelines.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -26,102 +26,102 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -/** Pipelines */ +/** GetPipelines */ // CHECKSTYLE:OFF -public class Pipelines +public class GetPipelines // CHECKSTYLE:ON { - @JsonProperty("resources") - private List resources = new ArrayList<>(); - @JsonProperty("count") private Integer count; + @JsonProperty("resources") + private List resources = new ArrayList<>(); + @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for Pipelines. */ - protected Pipelines() {} + /** Default constructor for GetPipelines. */ + protected GetPipelines() {} /** - * Set the resources of this {@link Pipelines} instance and return the same instance. + * Set the count of this {@link GetPipelines} instance and return the same instance. * - * @param resources The resources of this {@link Pipelines} - * @return The same instance of this {@link Pipelines} class + * @param count The count of this {@link GetPipelines} + * @return The same instance of this {@link GetPipelines} class */ @Nonnull - public Pipelines resources(@Nonnull final List resources) { - this.resources = resources; + public GetPipelines count(@Nullable final Integer count) { + this.count = count; return this; } /** - * Add one resources instance to this {@link Pipelines}. + * Get count * - * @param resourcesItem The resources that should be added - * @return The same instance of type {@link Pipelines} + * @return count The count of this {@link GetPipelines} instance. */ @Nonnull - public Pipelines addResourcesItem(@Nonnull final Pipeline resourcesItem) { - if (this.resources == null) { - this.resources = new ArrayList<>(); - } - this.resources.add(resourcesItem); - return this; + public Integer getCount() { + return count; } /** - * Get resources + * Set the count of this {@link GetPipelines} instance. * - * @return resources The resources of this {@link Pipelines} instance. + * @param count The count of this {@link GetPipelines} */ - @Nonnull - public List getResources() { - return resources; + public void setCount(@Nullable final Integer count) { + this.count = count; } /** - * Set the resources of this {@link Pipelines} instance. + * Set the resources of this {@link GetPipelines} instance and return the same instance. * - * @param resources The resources of this {@link Pipelines} + * @param resources The resources of this {@link GetPipelines} + * @return The same instance of this {@link GetPipelines} class */ - public void setResources(@Nonnull final List resources) { + @Nonnull + public GetPipelines resources(@Nonnull final List resources) { this.resources = resources; + return this; } /** - * Set the count of this {@link Pipelines} instance and return the same instance. + * Add one resources instance to this {@link GetPipelines}. * - * @param count The count of this {@link Pipelines} - * @return The same instance of this {@link Pipelines} class + * @param resourcesItem The resources that should be added + * @return The same instance of type {@link GetPipelines} */ @Nonnull - public Pipelines count(@Nullable final Integer count) { - this.count = count; + public GetPipelines addResourcesItem(@Nonnull final GetPipeline resourcesItem) { + if (this.resources == null) { + this.resources = new ArrayList<>(); + } + this.resources.add(resourcesItem); return this; } /** - * Get count + * Get resources * - * @return count The count of this {@link Pipelines} instance. + * @return resources The resources of this {@link GetPipelines} instance. */ @Nonnull - public Integer getCount() { - return count; + public List getResources() { + return resources; } /** - * Set the count of this {@link Pipelines} instance. + * Set the resources of this {@link GetPipelines} instance. * - * @param count The count of this {@link Pipelines} + * @param resources The resources of this {@link GetPipelines} */ - public void setCount(@Nullable final Integer count) { - this.count = count; + public void setResources(@Nonnull final List resources) { + this.resources = resources; } /** - * Get the names of the unrecognizable properties of the {@link Pipelines}. + * Get the names of the unrecognizable properties of the {@link GetPipelines}. * * @return The set of properties names */ @@ -132,7 +132,7 @@ public Set getCustomFieldNames() { } /** - * Get the value of an unrecognizable property of this {@link Pipelines} instance. + * Get the value of an unrecognizable property of this {@link GetPipelines} instance. * * @deprecated Use {@link #toMap()} instead. * @param name The name of the property @@ -143,13 +143,13 @@ public Set getCustomFieldNames() { @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("Pipelines has no field with name '" + name + "'."); + throw new NoSuchElementException("GetPipelines has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link Pipelines} instance including unrecognized + * Get the value of all properties of this {@link GetPipelines} instance including unrecognized * properties. * * @return The map of all properties @@ -158,13 +158,13 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc @Nonnull public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (resources != null) declaredFields.put("resources", resources); if (count != null) declaredFields.put("count", count); + if (resources != null) declaredFields.put("resources", resources); return declaredFields; } /** - * Set an unrecognizable property of this {@link Pipelines} instance. If the map previously + * Set an unrecognizable property of this {@link GetPipelines} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. * * @param customFieldName The name of the property @@ -183,24 +183,24 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final Pipelines pipelines = (Pipelines) o; - return Objects.equals(this.cloudSdkCustomFields, pipelines.cloudSdkCustomFields) - && Objects.equals(this.resources, pipelines.resources) - && Objects.equals(this.count, pipelines.count); + final GetPipelines getPipelines = (GetPipelines) o; + return Objects.equals(this.cloudSdkCustomFields, getPipelines.cloudSdkCustomFields) + && Objects.equals(this.count, getPipelines.count) + && Objects.equals(this.resources, getPipelines.resources); } @Override public int hashCode() { - return Objects.hash(resources, count, cloudSdkCustomFields); + return Objects.hash(count, resources, cloudSdkCustomFields); } @Override @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class Pipelines {\n"); - sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); + sb.append("class GetPipelines {\n"); sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); @@ -219,30 +219,30 @@ private String toIndentedString(final java.lang.Object o) { } /** - * Create a type-safe, fluent-api builder object to construct a new {@link Pipelines} instance + * Create a type-safe, fluent-api builder object to construct a new {@link GetPipelines} instance * with all required arguments. */ public static Builder create() { - return (resources) -> new Pipelines().resources(resources); + return (resources) -> new GetPipelines().resources(resources); } /** Builder helper class. */ public interface Builder { /** - * Set the resources of this {@link Pipelines} instance. + * Set the resources of this {@link GetPipelines} instance. * - * @param resources The resources of this {@link Pipelines} - * @return The Pipelines instance. + * @param resources The resources of this {@link GetPipelines} + * @return The GetPipelines instance. */ - Pipelines resources(@Nonnull final List resources); + GetPipelines resources(@Nonnull final List resources); /** - * Set the resources of this {@link Pipelines} instance. + * Set the resources of this {@link GetPipelines} instance. * - * @param resources The resources of this {@link Pipelines} - * @return The Pipelines instance. + * @param resources The resources of this {@link GetPipelines} + * @return The GetPipelines instance. */ - default Pipelines resources(@Nonnull final Pipeline... resources) { + default GetPipelines resources(@Nonnull final GetPipeline... resources) { return resources(Arrays.asList(resources)); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/HTTPValidationError.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/HTTPValidationError.java new file mode 100644 index 000000000..1ea484333 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/HTTPValidationError.java @@ -0,0 +1,188 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** HTTPValidationError */ +// CHECKSTYLE:OFF +public class HTTPValidationError +// CHECKSTYLE:ON +{ + @JsonProperty("detail") + private List detail = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for HTTPValidationError. */ + protected HTTPValidationError() {} + + /** + * Set the detail of this {@link HTTPValidationError} instance and return the same instance. + * + * @param detail The detail of this {@link HTTPValidationError} + * @return The same instance of this {@link HTTPValidationError} class + */ + @Nonnull + public HTTPValidationError detail(@Nullable final List detail) { + this.detail = detail; + return this; + } + + /** + * Add one detail instance to this {@link HTTPValidationError}. + * + * @param detailItem The detail that should be added + * @return The same instance of type {@link HTTPValidationError} + */ + @Nonnull + public HTTPValidationError addDetailItem(@Nonnull final ValidationError detailItem) { + if (this.detail == null) { + this.detail = new ArrayList<>(); + } + this.detail.add(detailItem); + return this; + } + + /** + * Get detail + * + * @return detail The detail of this {@link HTTPValidationError} instance. + */ + @Nonnull + public List getDetail() { + return detail; + } + + /** + * Set the detail of this {@link HTTPValidationError} instance. + * + * @param detail The detail of this {@link HTTPValidationError} + */ + public void setDetail(@Nullable final List detail) { + this.detail = detail; + } + + /** + * Get the names of the unrecognizable properties of the {@link HTTPValidationError}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link HTTPValidationError} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "HTTPValidationError has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link HTTPValidationError} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (detail != null) declaredFields.put("detail", detail); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link HTTPValidationError} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final HTTPValidationError htTPValidationError = (HTTPValidationError) o; + return Objects.equals(this.cloudSdkCustomFields, htTPValidationError.cloudSdkCustomFields) + && Objects.equals(this.detail, htTPValidationError.detail); + } + + @Override + public int hashCode() { + return Objects.hash(detail, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class HTTPValidationError {\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link HTTPValidationError} instance. No arguments are required. */ + public static HTTPValidationError create() { + return new HTTPValidationError(); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/InlineObject.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/InlineObject.java index 0ea0ec98c..a184bda70 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/InlineObject.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/InlineObject.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java index 77c91e520..d9085bb4f 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/KeyValueListPair.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/MSSharePointConfiguration.java similarity index 53% rename from core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java rename to core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/MSSharePointConfiguration.java index 24ae2fbe6..76c70b513 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfiguration.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/MSSharePointConfiguration.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -23,32 +23,32 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -/** PipelinePostRequstConfiguration */ +/** MSSharePointConfiguration */ // CHECKSTYLE:OFF -public class PipelinePostRequstConfiguration +public class MSSharePointConfiguration // CHECKSTYLE:ON { @JsonProperty("destination") private String destination; @JsonProperty("sharePoint") - private PipelinePostRequstConfigurationSharePoint sharePoint; + private SharePointConfig sharePoint; @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for PipelinePostRequstConfiguration. */ - protected PipelinePostRequstConfiguration() {} + /** Default constructor for MSSharePointConfiguration. */ + protected MSSharePointConfiguration() {} /** - * Set the destination of this {@link PipelinePostRequstConfiguration} instance and return the - * same instance. + * Set the destination of this {@link MSSharePointConfiguration} instance and return the same + * instance. * - * @param destination The destination of this {@link PipelinePostRequstConfiguration} - * @return The same instance of this {@link PipelinePostRequstConfiguration} class + * @param destination The destination of this {@link MSSharePointConfiguration} + * @return The same instance of this {@link MSSharePointConfiguration} class */ @Nonnull - public PipelinePostRequstConfiguration destination(@Nonnull final String destination) { + public MSSharePointConfiguration destination(@Nonnull final String destination) { this.destination = destination; return this; } @@ -56,7 +56,7 @@ public PipelinePostRequstConfiguration destination(@Nonnull final String destina /** * Get destination * - * @return destination The destination of this {@link PipelinePostRequstConfiguration} instance. + * @return destination The destination of this {@link MSSharePointConfiguration} instance. */ @Nonnull public String getDestination() { @@ -64,24 +64,23 @@ public String getDestination() { } /** - * Set the destination of this {@link PipelinePostRequstConfiguration} instance. + * Set the destination of this {@link MSSharePointConfiguration} instance. * - * @param destination The destination of this {@link PipelinePostRequstConfiguration} + * @param destination The destination of this {@link MSSharePointConfiguration} */ public void setDestination(@Nonnull final String destination) { this.destination = destination; } /** - * Set the sharePoint of this {@link PipelinePostRequstConfiguration} instance and return the same + * Set the sharePoint of this {@link MSSharePointConfiguration} instance and return the same * instance. * - * @param sharePoint The sharePoint of this {@link PipelinePostRequstConfiguration} - * @return The same instance of this {@link PipelinePostRequstConfiguration} class + * @param sharePoint The sharePoint of this {@link MSSharePointConfiguration} + * @return The same instance of this {@link MSSharePointConfiguration} class */ @Nonnull - public PipelinePostRequstConfiguration sharePoint( - @Nullable final PipelinePostRequstConfigurationSharePoint sharePoint) { + public MSSharePointConfiguration sharePoint(@Nonnull final SharePointConfig sharePoint) { this.sharePoint = sharePoint; return this; } @@ -89,24 +88,24 @@ public PipelinePostRequstConfiguration sharePoint( /** * Get sharePoint * - * @return sharePoint The sharePoint of this {@link PipelinePostRequstConfiguration} instance. + * @return sharePoint The sharePoint of this {@link MSSharePointConfiguration} instance. */ @Nonnull - public PipelinePostRequstConfigurationSharePoint getSharePoint() { + public SharePointConfig getSharePoint() { return sharePoint; } /** - * Set the sharePoint of this {@link PipelinePostRequstConfiguration} instance. + * Set the sharePoint of this {@link MSSharePointConfiguration} instance. * - * @param sharePoint The sharePoint of this {@link PipelinePostRequstConfiguration} + * @param sharePoint The sharePoint of this {@link MSSharePointConfiguration} */ - public void setSharePoint(@Nullable final PipelinePostRequstConfigurationSharePoint sharePoint) { + public void setSharePoint(@Nonnull final SharePointConfig sharePoint) { this.sharePoint = sharePoint; } /** - * Get the names of the unrecognizable properties of the {@link PipelinePostRequstConfiguration}. + * Get the names of the unrecognizable properties of the {@link MSSharePointConfiguration}. * * @return The set of properties names */ @@ -117,8 +116,7 @@ public Set getCustomFieldNames() { } /** - * Get the value of an unrecognizable property of this {@link PipelinePostRequstConfiguration} - * instance. + * Get the value of an unrecognizable property of this {@link MSSharePointConfiguration} instance. * * @deprecated Use {@link #toMap()} instead. * @param name The name of the property @@ -130,14 +128,14 @@ public Set getCustomFieldNames() { public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( - "PipelinePostRequstConfiguration has no field with name '" + name + "'."); + "MSSharePointConfiguration has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link PipelinePostRequstConfiguration} instance - * including unrecognized properties. + * Get the value of all properties of this {@link MSSharePointConfiguration} instance including + * unrecognized properties. * * @return The map of all properties */ @@ -151,9 +149,8 @@ public Map toMap() { } /** - * Set an unrecognizable property of this {@link PipelinePostRequstConfiguration} instance. If the - * map previously contained a mapping for the key, the old value is replaced by the specified - * value. + * Set an unrecognizable property of this {@link MSSharePointConfiguration} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. * * @param customFieldName The name of the property * @param customFieldValue The value of the property @@ -171,12 +168,10 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final PipelinePostRequstConfiguration pipelinePostRequstConfiguration = - (PipelinePostRequstConfiguration) o; - return Objects.equals( - this.cloudSdkCustomFields, pipelinePostRequstConfiguration.cloudSdkCustomFields) - && Objects.equals(this.destination, pipelinePostRequstConfiguration.destination) - && Objects.equals(this.sharePoint, pipelinePostRequstConfiguration.sharePoint); + final MSSharePointConfiguration msSharePointConfiguration = (MSSharePointConfiguration) o; + return Objects.equals(this.cloudSdkCustomFields, msSharePointConfiguration.cloudSdkCustomFields) + && Objects.equals(this.destination, msSharePointConfiguration.destination) + && Objects.equals(this.sharePoint, msSharePointConfiguration.sharePoint); } @Override @@ -188,7 +183,7 @@ public int hashCode() { @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class PipelinePostRequstConfiguration {\n"); + sb.append("class MSSharePointConfiguration {\n"); sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); sb.append(" sharePoint: ").append(toIndentedString(sharePoint)).append("\n"); cloudSdkCustomFields.forEach( @@ -210,20 +205,33 @@ private String toIndentedString(final java.lang.Object o) { /** * Create a type-safe, fluent-api builder object to construct a new {@link - * PipelinePostRequstConfiguration} instance with all required arguments. + * MSSharePointConfiguration} instance with all required arguments. */ public static Builder create() { - return (destination) -> new PipelinePostRequstConfiguration().destination(destination); + return (destination) -> + (sharePoint) -> + new MSSharePointConfiguration().destination(destination).sharePoint(sharePoint); } /** Builder helper class. */ public interface Builder { /** - * Set the destination of this {@link PipelinePostRequstConfiguration} instance. + * Set the destination of this {@link MSSharePointConfiguration} instance. + * + * @param destination The destination of this {@link MSSharePointConfiguration} + * @return The MSSharePointConfiguration builder. + */ + Builder1 destination(@Nonnull final String destination); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the sharePoint of this {@link MSSharePointConfiguration} instance. * - * @param destination The destination of this {@link PipelinePostRequstConfiguration} - * @return The PipelinePostRequstConfiguration instance. + * @param sharePoint The sharePoint of this {@link MSSharePointConfiguration} + * @return The MSSharePointConfiguration instance. */ - PipelinePostRequstConfiguration destination(@Nonnull final String destination); + MSSharePointConfiguration sharePoint(@Nonnull final SharePointConfig sharePoint); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/MSSharePointConfigurationGetResponse.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/MSSharePointConfigurationGetResponse.java new file mode 100644 index 000000000..a5d42d7e6 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/MSSharePointConfigurationGetResponse.java @@ -0,0 +1,232 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** MSSharePointConfigurationGetResponse */ +// CHECKSTYLE:OFF +public class MSSharePointConfigurationGetResponse +// CHECKSTYLE:ON +{ + @JsonProperty("destination") + private String destination; + + @JsonProperty("sharePoint") + private SharePointConfigGetResponse sharePoint; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for MSSharePointConfigurationGetResponse. */ + protected MSSharePointConfigurationGetResponse() {} + + /** + * Set the destination of this {@link MSSharePointConfigurationGetResponse} instance and return + * the same instance. + * + * @param destination The destination of this {@link MSSharePointConfigurationGetResponse} + * @return The same instance of this {@link MSSharePointConfigurationGetResponse} class + */ + @Nonnull + public MSSharePointConfigurationGetResponse destination(@Nonnull final String destination) { + this.destination = destination; + return this; + } + + /** + * Get destination + * + * @return destination The destination of this {@link MSSharePointConfigurationGetResponse} + * instance. + */ + @Nonnull + public String getDestination() { + return destination; + } + + /** + * Set the destination of this {@link MSSharePointConfigurationGetResponse} instance. + * + * @param destination The destination of this {@link MSSharePointConfigurationGetResponse} + */ + public void setDestination(@Nonnull final String destination) { + this.destination = destination; + } + + /** + * Set the sharePoint of this {@link MSSharePointConfigurationGetResponse} instance and return the + * same instance. + * + * @param sharePoint The sharePoint of this {@link MSSharePointConfigurationGetResponse} + * @return The same instance of this {@link MSSharePointConfigurationGetResponse} class + */ + @Nonnull + public MSSharePointConfigurationGetResponse sharePoint( + @Nullable final SharePointConfigGetResponse sharePoint) { + this.sharePoint = sharePoint; + return this; + } + + /** + * Get sharePoint + * + * @return sharePoint The sharePoint of this {@link MSSharePointConfigurationGetResponse} + * instance. + */ + @Nonnull + public SharePointConfigGetResponse getSharePoint() { + return sharePoint; + } + + /** + * Set the sharePoint of this {@link MSSharePointConfigurationGetResponse} instance. + * + * @param sharePoint The sharePoint of this {@link MSSharePointConfigurationGetResponse} + */ + public void setSharePoint(@Nullable final SharePointConfigGetResponse sharePoint) { + this.sharePoint = sharePoint; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * MSSharePointConfigurationGetResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * MSSharePointConfigurationGetResponse} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "MSSharePointConfigurationGetResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link MSSharePointConfigurationGetResponse} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (destination != null) declaredFields.put("destination", destination); + if (sharePoint != null) declaredFields.put("sharePoint", sharePoint); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link MSSharePointConfigurationGetResponse} instance. + * If the map previously contained a mapping for the key, the old value is replaced by the + * specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final MSSharePointConfigurationGetResponse msSharePointConfigurationGetResponse = + (MSSharePointConfigurationGetResponse) o; + return Objects.equals( + this.cloudSdkCustomFields, msSharePointConfigurationGetResponse.cloudSdkCustomFields) + && Objects.equals(this.destination, msSharePointConfigurationGetResponse.destination) + && Objects.equals(this.sharePoint, msSharePointConfigurationGetResponse.sharePoint); + } + + @Override + public int hashCode() { + return Objects.hash(destination, sharePoint, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class MSSharePointConfigurationGetResponse {\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" sharePoint: ").append(toIndentedString(sharePoint)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * MSSharePointConfigurationGetResponse} instance with all required arguments. + */ + public static Builder create() { + return (destination) -> new MSSharePointConfigurationGetResponse().destination(destination); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the destination of this {@link MSSharePointConfigurationGetResponse} instance. + * + * @param destination The destination of this {@link MSSharePointConfigurationGetResponse} + * @return The MSSharePointConfigurationGetResponse instance. + */ + MSSharePointConfigurationGetResponse destination(@Nonnull final String destination); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/MSSharePointPipelineCreateRequest.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/MSSharePointPipelineCreateRequest.java new file mode 100644 index 000000000..0ae8a47ef --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/MSSharePointPipelineCreateRequest.java @@ -0,0 +1,339 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** MSSharePointPipelineCreateRequest */ +// CHECKSTYLE:OFF +public class MSSharePointPipelineCreateRequest implements CreatePipeline +// CHECKSTYLE:ON +{ + /** Gets or Sets type */ + public enum TypeEnum { + /** The MS_SHARE_POINT option of this MSSharePointPipelineCreateRequest */ + MS_SHARE_POINT("MSSharePoint"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this MSSharePointPipelineCreateRequest */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type MSSharePointPipelineCreateRequest + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("configuration") + private MSSharePointConfiguration _configuration; + + @JsonProperty("metadata") + private MetaData metadata; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for MSSharePointPipelineCreateRequest. */ + protected MSSharePointPipelineCreateRequest() {} + + /** + * Set the type of this {@link MSSharePointPipelineCreateRequest} instance and return the same + * instance. + * + * @param type The type of this {@link MSSharePointPipelineCreateRequest} + * @return The same instance of this {@link MSSharePointPipelineCreateRequest} class + */ + @Nonnull + public MSSharePointPipelineCreateRequest type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link MSSharePointPipelineCreateRequest} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link MSSharePointPipelineCreateRequest} instance. + * + * @param type The type of this {@link MSSharePointPipelineCreateRequest} + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the _configuration of this {@link MSSharePointPipelineCreateRequest} instance and return + * the same instance. + * + * @param _configuration The _configuration of this {@link MSSharePointPipelineCreateRequest} + * @return The same instance of this {@link MSSharePointPipelineCreateRequest} class + */ + @Nonnull + public MSSharePointPipelineCreateRequest _configuration( + @Nonnull final MSSharePointConfiguration _configuration) { + this._configuration = _configuration; + return this; + } + + /** + * Get _configuration + * + * @return _configuration The _configuration of this {@link MSSharePointPipelineCreateRequest} + * instance. + */ + @Nonnull + public MSSharePointConfiguration getConfiguration() { + return _configuration; + } + + /** + * Set the _configuration of this {@link MSSharePointPipelineCreateRequest} instance. + * + * @param _configuration The _configuration of this {@link MSSharePointPipelineCreateRequest} + */ + public void setConfiguration(@Nonnull final MSSharePointConfiguration _configuration) { + this._configuration = _configuration; + } + + /** + * Set the metadata of this {@link MSSharePointPipelineCreateRequest} instance and return the same + * instance. + * + * @param metadata The metadata of this {@link MSSharePointPipelineCreateRequest} + * @return The same instance of this {@link MSSharePointPipelineCreateRequest} class + */ + @Nonnull + public MSSharePointPipelineCreateRequest metadata(@Nullable final MetaData metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link MSSharePointPipelineCreateRequest} instance. + */ + @Nonnull + public MetaData getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link MSSharePointPipelineCreateRequest} instance. + * + * @param metadata The metadata of this {@link MSSharePointPipelineCreateRequest} + */ + public void setMetadata(@Nullable final MetaData metadata) { + this.metadata = metadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * MSSharePointPipelineCreateRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link MSSharePointPipelineCreateRequest} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "MSSharePointPipelineCreateRequest has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link MSSharePointPipelineCreateRequest} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (_configuration != null) declaredFields.put("_configuration", _configuration); + if (metadata != null) declaredFields.put("metadata", metadata); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link MSSharePointPipelineCreateRequest} instance. If + * the map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final MSSharePointPipelineCreateRequest msSharePointPipelineCreateRequest = + (MSSharePointPipelineCreateRequest) o; + return Objects.equals( + this.cloudSdkCustomFields, msSharePointPipelineCreateRequest.cloudSdkCustomFields) + && Objects.equals(this.type, msSharePointPipelineCreateRequest.type) + && Objects.equals(this._configuration, msSharePointPipelineCreateRequest._configuration) + && Objects.equals(this.metadata, msSharePointPipelineCreateRequest.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(type, _configuration, metadata, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class MSSharePointPipelineCreateRequest {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * MSSharePointPipelineCreateRequest} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (_configuration) -> + new MSSharePointPipelineCreateRequest().type(type)._configuration(_configuration); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link MSSharePointPipelineCreateRequest} instance. + * + * @param type The type of this {@link MSSharePointPipelineCreateRequest} + * @return The MSSharePointPipelineCreateRequest builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the _configuration of this {@link MSSharePointPipelineCreateRequest} instance. + * + * @param _configuration The _configuration of this {@link MSSharePointPipelineCreateRequest} + * @return The MSSharePointPipelineCreateRequest instance. + */ + MSSharePointPipelineCreateRequest _configuration( + @Nonnull final MSSharePointConfiguration _configuration); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/MSSharePointPipelineGetResponse.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/MSSharePointPipelineGetResponse.java new file mode 100644 index 000000000..143fcc5ea --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/MSSharePointPipelineGetResponse.java @@ -0,0 +1,391 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** MSSharePointPipelineGetResponse */ +// CHECKSTYLE:OFF +public class MSSharePointPipelineGetResponse implements GetPipeline +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + /** Gets or Sets type */ + public enum TypeEnum { + /** The MS_SHARE_POINT option of this MSSharePointPipelineGetResponse */ + MS_SHARE_POINT("MSSharePoint"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this MSSharePointPipelineGetResponse */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type MSSharePointPipelineGetResponse + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("metadata") + private MetaData metadata; + + @JsonProperty("configuration") + private MSSharePointConfigurationGetResponse _configuration; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for MSSharePointPipelineGetResponse. */ + protected MSSharePointPipelineGetResponse() {} + + /** + * Set the id of this {@link MSSharePointPipelineGetResponse} instance and return the same + * instance. + * + * @param id The id of this {@link MSSharePointPipelineGetResponse} + * @return The same instance of this {@link MSSharePointPipelineGetResponse} class + */ + @Nonnull + public MSSharePointPipelineGetResponse id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link MSSharePointPipelineGetResponse} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link MSSharePointPipelineGetResponse} instance. + * + * @param id The id of this {@link MSSharePointPipelineGetResponse} + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the type of this {@link MSSharePointPipelineGetResponse} instance and return the same + * instance. + * + * @param type The type of this {@link MSSharePointPipelineGetResponse} + * @return The same instance of this {@link MSSharePointPipelineGetResponse} class + */ + @Nonnull + public MSSharePointPipelineGetResponse type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link MSSharePointPipelineGetResponse} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link MSSharePointPipelineGetResponse} instance. + * + * @param type The type of this {@link MSSharePointPipelineGetResponse} + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the metadata of this {@link MSSharePointPipelineGetResponse} instance and return the same + * instance. + * + * @param metadata The metadata of this {@link MSSharePointPipelineGetResponse} + * @return The same instance of this {@link MSSharePointPipelineGetResponse} class + */ + @Nonnull + public MSSharePointPipelineGetResponse metadata(@Nullable final MetaData metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link MSSharePointPipelineGetResponse} instance. + */ + @Nonnull + public MetaData getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link MSSharePointPipelineGetResponse} instance. + * + * @param metadata The metadata of this {@link MSSharePointPipelineGetResponse} + */ + public void setMetadata(@Nullable final MetaData metadata) { + this.metadata = metadata; + } + + /** + * Set the _configuration of this {@link MSSharePointPipelineGetResponse} instance and return the + * same instance. + * + * @param _configuration The _configuration of this {@link MSSharePointPipelineGetResponse} + * @return The same instance of this {@link MSSharePointPipelineGetResponse} class + */ + @Nonnull + public MSSharePointPipelineGetResponse _configuration( + @Nonnull final MSSharePointConfigurationGetResponse _configuration) { + this._configuration = _configuration; + return this; + } + + /** + * Get _configuration + * + * @return _configuration The _configuration of this {@link MSSharePointPipelineGetResponse} + * instance. + */ + @Nonnull + public MSSharePointConfigurationGetResponse getConfiguration() { + return _configuration; + } + + /** + * Set the _configuration of this {@link MSSharePointPipelineGetResponse} instance. + * + * @param _configuration The _configuration of this {@link MSSharePointPipelineGetResponse} + */ + public void setConfiguration(@Nonnull final MSSharePointConfigurationGetResponse _configuration) { + this._configuration = _configuration; + } + + /** + * Get the names of the unrecognizable properties of the {@link MSSharePointPipelineGetResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link MSSharePointPipelineGetResponse} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "MSSharePointPipelineGetResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link MSSharePointPipelineGetResponse} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (type != null) declaredFields.put("type", type); + if (metadata != null) declaredFields.put("metadata", metadata); + if (_configuration != null) declaredFields.put("_configuration", _configuration); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link MSSharePointPipelineGetResponse} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final MSSharePointPipelineGetResponse msSharePointPipelineGetResponse = + (MSSharePointPipelineGetResponse) o; + return Objects.equals( + this.cloudSdkCustomFields, msSharePointPipelineGetResponse.cloudSdkCustomFields) + && Objects.equals(this.id, msSharePointPipelineGetResponse.id) + && Objects.equals(this.type, msSharePointPipelineGetResponse.type) + && Objects.equals(this.metadata, msSharePointPipelineGetResponse.metadata) + && Objects.equals(this._configuration, msSharePointPipelineGetResponse._configuration); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, metadata, _configuration, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class MSSharePointPipelineGetResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * MSSharePointPipelineGetResponse} instance with all required arguments. + */ + public static Builder create() { + return (id) -> + (type) -> + (_configuration) -> + new MSSharePointPipelineGetResponse() + .id(id) + .type(type) + ._configuration(_configuration); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link MSSharePointPipelineGetResponse} instance. + * + * @param id The id of this {@link MSSharePointPipelineGetResponse} + * @return The MSSharePointPipelineGetResponse builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the type of this {@link MSSharePointPipelineGetResponse} instance. + * + * @param type The type of this {@link MSSharePointPipelineGetResponse} + * @return The MSSharePointPipelineGetResponse builder. + */ + Builder2 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the _configuration of this {@link MSSharePointPipelineGetResponse} instance. + * + * @param _configuration The _configuration of this {@link MSSharePointPipelineGetResponse} + * @return The MSSharePointPipelineGetResponse instance. + */ + MSSharePointPipelineGetResponse _configuration( + @Nonnull final MSSharePointConfigurationGetResponse _configuration); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineStatus.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/MetaData.java similarity index 54% rename from core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineStatus.java rename to core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/MetaData.java index 8baf756ed..77029ecac 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineStatus.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/MetaData.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -15,7 +15,6 @@ import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; import java.util.LinkedHashMap; import java.util.Map; import java.util.NoSuchElementException; @@ -24,53 +23,53 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -/** PipelineStatus */ +/** MetaData */ // CHECKSTYLE:OFF -public class PipelineStatus +public class MetaData // CHECKSTYLE:ON { - @JsonProperty("lastStarted") - private OffsetDateTime lastStarted; + @JsonProperty("destination") + private String destination; @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for PipelineStatus. */ - protected PipelineStatus() {} + /** Default constructor for MetaData. */ + protected MetaData() {} /** - * Set the lastStarted of this {@link PipelineStatus} instance and return the same instance. + * Set the destination of this {@link MetaData} instance and return the same instance. * - * @param lastStarted The lastStarted of this {@link PipelineStatus} - * @return The same instance of this {@link PipelineStatus} class + * @param destination The destination of this {@link MetaData} + * @return The same instance of this {@link MetaData} class */ @Nonnull - public PipelineStatus lastStarted(@Nullable final OffsetDateTime lastStarted) { - this.lastStarted = lastStarted; + public MetaData destination(@Nonnull final String destination) { + this.destination = destination; return this; } /** - * Get lastStarted + * Get destination * - * @return lastStarted The lastStarted of this {@link PipelineStatus} instance. + * @return destination The destination of this {@link MetaData} instance. */ @Nonnull - public OffsetDateTime getLastStarted() { - return lastStarted; + public String getDestination() { + return destination; } /** - * Set the lastStarted of this {@link PipelineStatus} instance. + * Set the destination of this {@link MetaData} instance. * - * @param lastStarted The lastStarted of this {@link PipelineStatus} + * @param destination The destination of this {@link MetaData} */ - public void setLastStarted(@Nullable final OffsetDateTime lastStarted) { - this.lastStarted = lastStarted; + public void setDestination(@Nonnull final String destination) { + this.destination = destination; } /** - * Get the names of the unrecognizable properties of the {@link PipelineStatus}. + * Get the names of the unrecognizable properties of the {@link MetaData}. * * @return The set of properties names */ @@ -81,7 +80,7 @@ public Set getCustomFieldNames() { } /** - * Get the value of an unrecognizable property of this {@link PipelineStatus} instance. + * Get the value of an unrecognizable property of this {@link MetaData} instance. * * @deprecated Use {@link #toMap()} instead. * @param name The name of the property @@ -92,13 +91,13 @@ public Set getCustomFieldNames() { @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("PipelineStatus has no field with name '" + name + "'."); + throw new NoSuchElementException("MetaData has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link PipelineStatus} instance including unrecognized + * Get the value of all properties of this {@link MetaData} instance including unrecognized * properties. * * @return The map of all properties @@ -107,12 +106,12 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc @Nonnull public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (lastStarted != null) declaredFields.put("lastStarted", lastStarted); + if (destination != null) declaredFields.put("destination", destination); return declaredFields; } /** - * Set an unrecognizable property of this {@link PipelineStatus} instance. If the map previously + * Set an unrecognizable property of this {@link MetaData} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. * * @param customFieldName The name of the property @@ -131,22 +130,22 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final PipelineStatus pipelineStatus = (PipelineStatus) o; - return Objects.equals(this.cloudSdkCustomFields, pipelineStatus.cloudSdkCustomFields) - && Objects.equals(this.lastStarted, pipelineStatus.lastStarted); + final MetaData metaData = (MetaData) o; + return Objects.equals(this.cloudSdkCustomFields, metaData.cloudSdkCustomFields) + && Objects.equals(this.destination, metaData.destination); } @Override public int hashCode() { - return Objects.hash(lastStarted, cloudSdkCustomFields); + return Objects.hash(destination, cloudSdkCustomFields); } @Override @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class PipelineStatus {\n"); - sb.append(" lastStarted: ").append(toIndentedString(lastStarted)).append("\n"); + sb.append("class MetaData {\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); @@ -164,8 +163,22 @@ private String toIndentedString(final java.lang.Object o) { return o.toString().replace("\n", "\n "); } - /** Create a new {@link PipelineStatus} instance. No arguments are required. */ - public static PipelineStatus create() { - return new PipelineStatus(); + /** + * Create a type-safe, fluent-api builder object to construct a new {@link MetaData} instance with + * all required arguments. + */ + public static Builder create() { + return (destination) -> new MetaData().destination(destination); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the destination of this {@link MetaData} instance. + * + * @param destination The destination of this {@link MetaData} + * @return The MetaData instance. + */ + MetaData destination(@Nonnull final String destination); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResult.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResult.java index 6271cb841..9f01a61c9 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResult.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResult.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResultWithError.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResultError.java similarity index 59% rename from core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResultWithError.java rename to core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResultError.java index d1b557481..d359214c0 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetievalPerFilterSearchResultWithError.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResultError.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -23,9 +23,9 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -/** RetievalPerFilterSearchResultWithError */ +/** PerFilterSearchResultError */ // CHECKSTYLE:OFF -public class RetievalPerFilterSearchResultWithError +public class PerFilterSearchResultError // CHECKSTYLE:ON { @JsonProperty("message") @@ -34,18 +34,18 @@ public class RetievalPerFilterSearchResultWithError @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for RetievalPerFilterSearchResultWithError. */ - protected RetievalPerFilterSearchResultWithError() {} + /** Default constructor for PerFilterSearchResultError. */ + protected PerFilterSearchResultError() {} /** - * Set the message of this {@link RetievalPerFilterSearchResultWithError} instance and return the - * same instance. + * Set the message of this {@link PerFilterSearchResultError} instance and return the same + * instance. * - * @param message The message of this {@link RetievalPerFilterSearchResultWithError} - * @return The same instance of this {@link RetievalPerFilterSearchResultWithError} class + * @param message The message of this {@link PerFilterSearchResultError} + * @return The same instance of this {@link PerFilterSearchResultError} class */ @Nonnull - public RetievalPerFilterSearchResultWithError message(@Nonnull final String message) { + public PerFilterSearchResultError message(@Nonnull final String message) { this.message = message; return this; } @@ -53,7 +53,7 @@ public RetievalPerFilterSearchResultWithError message(@Nonnull final String mess /** * Get message * - * @return message The message of this {@link RetievalPerFilterSearchResultWithError} instance. + * @return message The message of this {@link PerFilterSearchResultError} instance. */ @Nonnull public String getMessage() { @@ -61,17 +61,16 @@ public String getMessage() { } /** - * Set the message of this {@link RetievalPerFilterSearchResultWithError} instance. + * Set the message of this {@link PerFilterSearchResultError} instance. * - * @param message The message of this {@link RetievalPerFilterSearchResultWithError} + * @param message The message of this {@link PerFilterSearchResultError} */ public void setMessage(@Nonnull final String message) { this.message = message; } /** - * Get the names of the unrecognizable properties of the {@link - * RetievalPerFilterSearchResultWithError}. + * Get the names of the unrecognizable properties of the {@link PerFilterSearchResultError}. * * @return The set of properties names */ @@ -82,8 +81,8 @@ public Set getCustomFieldNames() { } /** - * Get the value of an unrecognizable property of this {@link - * RetievalPerFilterSearchResultWithError} instance. + * Get the value of an unrecognizable property of this {@link PerFilterSearchResultError} + * instance. * * @deprecated Use {@link #toMap()} instead. * @param name The name of the property @@ -95,14 +94,14 @@ public Set getCustomFieldNames() { public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( - "RetievalPerFilterSearchResultWithError has no field with name '" + name + "'."); + "PerFilterSearchResultError has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link RetievalPerFilterSearchResultWithError} instance - * including unrecognized properties. + * Get the value of all properties of this {@link PerFilterSearchResultError} instance including + * unrecognized properties. * * @return The map of all properties */ @@ -115,9 +114,8 @@ public Map toMap() { } /** - * Set an unrecognizable property of this {@link RetievalPerFilterSearchResultWithError} instance. - * If the map previously contained a mapping for the key, the old value is replaced by the - * specified value. + * Set an unrecognizable property of this {@link PerFilterSearchResultError} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. * * @param customFieldName The name of the property * @param customFieldValue The value of the property @@ -135,11 +133,10 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final RetievalPerFilterSearchResultWithError retievalPerFilterSearchResultWithError = - (RetievalPerFilterSearchResultWithError) o; + final PerFilterSearchResultError perFilterSearchResultError = (PerFilterSearchResultError) o; return Objects.equals( - this.cloudSdkCustomFields, retievalPerFilterSearchResultWithError.cloudSdkCustomFields) - && Objects.equals(this.message, retievalPerFilterSearchResultWithError.message); + this.cloudSdkCustomFields, perFilterSearchResultError.cloudSdkCustomFields) + && Objects.equals(this.message, perFilterSearchResultError.message); } @Override @@ -151,7 +148,7 @@ public int hashCode() { @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class RetievalPerFilterSearchResultWithError {\n"); + sb.append("class PerFilterSearchResultError {\n"); sb.append(" message: ").append(toIndentedString(message)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> @@ -172,20 +169,20 @@ private String toIndentedString(final java.lang.Object o) { /** * Create a type-safe, fluent-api builder object to construct a new {@link - * RetievalPerFilterSearchResultWithError} instance with all required arguments. + * PerFilterSearchResultError} instance with all required arguments. */ public static Builder create() { - return (message) -> new RetievalPerFilterSearchResultWithError().message(message); + return (message) -> new PerFilterSearchResultError().message(message); } /** Builder helper class. */ public interface Builder { /** - * Set the message of this {@link RetievalPerFilterSearchResultWithError} instance. + * Set the message of this {@link PerFilterSearchResultError} instance. * - * @param message The message of this {@link RetievalPerFilterSearchResultWithError} - * @return The RetievalPerFilterSearchResultWithError instance. + * @param message The message of this {@link PerFilterSearchResultError} + * @return The PerFilterSearchResultError instance. */ - RetievalPerFilterSearchResultWithError message(@Nonnull final String message); + PerFilterSearchResultError message(@Nonnull final String message); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResultWithError.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResultWithError.java new file mode 100644 index 000000000..cf31c28f0 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PerFilterSearchResultWithError.java @@ -0,0 +1,228 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PerFilterSearchResultWithError */ +// CHECKSTYLE:OFF +public class PerFilterSearchResultWithError +// CHECKSTYLE:ON +{ + @JsonProperty("filterId") + private String filterId; + + @JsonProperty("error") + private PerFilterSearchResultError error; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PerFilterSearchResultWithError. */ + protected PerFilterSearchResultWithError() {} + + /** + * Set the filterId of this {@link PerFilterSearchResultWithError} instance and return the same + * instance. + * + * @param filterId The filterId of this {@link PerFilterSearchResultWithError} + * @return The same instance of this {@link PerFilterSearchResultWithError} class + */ + @Nonnull + public PerFilterSearchResultWithError filterId(@Nonnull final String filterId) { + this.filterId = filterId; + return this; + } + + /** + * Get filterId + * + * @return filterId The filterId of this {@link PerFilterSearchResultWithError} instance. + */ + @Nonnull + public String getFilterId() { + return filterId; + } + + /** + * Set the filterId of this {@link PerFilterSearchResultWithError} instance. + * + * @param filterId The filterId of this {@link PerFilterSearchResultWithError} + */ + public void setFilterId(@Nonnull final String filterId) { + this.filterId = filterId; + } + + /** + * Set the error of this {@link PerFilterSearchResultWithError} instance and return the same + * instance. + * + * @param error The error of this {@link PerFilterSearchResultWithError} + * @return The same instance of this {@link PerFilterSearchResultWithError} class + */ + @Nonnull + public PerFilterSearchResultWithError error(@Nullable final PerFilterSearchResultError error) { + this.error = error; + return this; + } + + /** + * Get error + * + * @return error The error of this {@link PerFilterSearchResultWithError} instance. + */ + @Nonnull + public PerFilterSearchResultError getError() { + return error; + } + + /** + * Set the error of this {@link PerFilterSearchResultWithError} instance. + * + * @param error The error of this {@link PerFilterSearchResultWithError} + */ + public void setError(@Nullable final PerFilterSearchResultError error) { + this.error = error; + } + + /** + * Get the names of the unrecognizable properties of the {@link PerFilterSearchResultWithError}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PerFilterSearchResultWithError} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "PerFilterSearchResultWithError has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link PerFilterSearchResultWithError} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filterId != null) declaredFields.put("filterId", filterId); + if (error != null) declaredFields.put("error", error); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link PerFilterSearchResultWithError} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PerFilterSearchResultWithError perFilterSearchResultWithError = + (PerFilterSearchResultWithError) o; + return Objects.equals( + this.cloudSdkCustomFields, perFilterSearchResultWithError.cloudSdkCustomFields) + && Objects.equals(this.filterId, perFilterSearchResultWithError.filterId) + && Objects.equals(this.error, perFilterSearchResultWithError.error); + } + + @Override + public int hashCode() { + return Objects.hash(filterId, error, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PerFilterSearchResultWithError {\n"); + sb.append(" filterId: ").append(toIndentedString(filterId)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * PerFilterSearchResultWithError} instance with all required arguments. + */ + public static Builder create() { + return (filterId) -> new PerFilterSearchResultWithError().filterId(filterId); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filterId of this {@link PerFilterSearchResultWithError} instance. + * + * @param filterId The filterId of this {@link PerFilterSearchResultWithError} + * @return The PerFilterSearchResultWithError instance. + */ + PerFilterSearchResultWithError filterId(@Nonnull final String filterId); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipeline.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipeline.java deleted file mode 100644 index 7d5c959f5..000000000 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Pipeline.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Pipeline */ -// CHECKSTYLE:OFF -public class Pipeline -// CHECKSTYLE:ON -{ - @JsonProperty("id") - private String id; - - @JsonProperty("type") - private String type; - - @JsonProperty("configuration") - private PipelineConfiguration _configuration; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for Pipeline. */ - protected Pipeline() {} - - /** - * Set the id of this {@link Pipeline} instance and return the same instance. - * - * @param id The id of this {@link Pipeline} - * @return The same instance of this {@link Pipeline} class - */ - @Nonnull - public Pipeline id(@Nullable final String id) { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id The id of this {@link Pipeline} instance. - */ - @Nonnull - public String getId() { - return id; - } - - /** - * Set the id of this {@link Pipeline} instance. - * - * @param id The id of this {@link Pipeline} - */ - public void setId(@Nullable final String id) { - this.id = id; - } - - /** - * Set the type of this {@link Pipeline} instance and return the same instance. - * - * @param type The type of this {@link Pipeline} - * @return The same instance of this {@link Pipeline} class - */ - @Nonnull - public Pipeline type(@Nullable final String type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link Pipeline} instance. - */ - @Nonnull - public String getType() { - return type; - } - - /** - * Set the type of this {@link Pipeline} instance. - * - * @param type The type of this {@link Pipeline} - */ - public void setType(@Nullable final String type) { - this.type = type; - } - - /** - * Set the _configuration of this {@link Pipeline} instance and return the same instance. - * - * @param _configuration The _configuration of this {@link Pipeline} - * @return The same instance of this {@link Pipeline} class - */ - @Nonnull - public Pipeline _configuration(@Nullable final PipelineConfiguration _configuration) { - this._configuration = _configuration; - return this; - } - - /** - * Get _configuration - * - * @return _configuration The _configuration of this {@link Pipeline} instance. - */ - @Nonnull - public PipelineConfiguration getConfiguration() { - return _configuration; - } - - /** - * Set the _configuration of this {@link Pipeline} instance. - * - * @param _configuration The _configuration of this {@link Pipeline} - */ - public void setConfiguration(@Nullable final PipelineConfiguration _configuration) { - this._configuration = _configuration; - } - - /** - * Get the names of the unrecognizable properties of the {@link Pipeline}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link Pipeline} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("Pipeline has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link Pipeline} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (id != null) declaredFields.put("id", id); - if (type != null) declaredFields.put("type", type); - if (_configuration != null) declaredFields.put("_configuration", _configuration); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link Pipeline} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final Pipeline pipeline = (Pipeline) o; - return Objects.equals(this.cloudSdkCustomFields, pipeline.cloudSdkCustomFields) - && Objects.equals(this.id, pipeline.id) - && Objects.equals(this.type, pipeline.type) - && Objects.equals(this._configuration, pipeline._configuration); - } - - @Override - public int hashCode() { - return Objects.hash(id, type, _configuration, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class Pipeline {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link Pipeline} instance. No arguments are required. */ - public static Pipeline create() { - return new Pipeline(); - } -} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineDocumentResponse.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineDocumentResponse.java new file mode 100644 index 000000000..61fb9653c --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineDocumentResponse.java @@ -0,0 +1,329 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelineDocumentResponse */ +// CHECKSTYLE:OFF +public class PipelineDocumentResponse +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("viewLocation") + private String viewLocation; + + @JsonProperty("downloadLocation") + private String downloadLocation; + + @JsonProperty("lastUpdatedTimestamp") + private String lastUpdatedTimestamp; + + @JsonProperty("status") + private DocumentStatus status; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelineDocumentResponse. */ + protected PipelineDocumentResponse() {} + + /** + * Set the id of this {@link PipelineDocumentResponse} instance and return the same instance. + * + * @param id The id of this {@link PipelineDocumentResponse} + * @return The same instance of this {@link PipelineDocumentResponse} class + */ + @Nonnull + public PipelineDocumentResponse id(@Nullable final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link PipelineDocumentResponse} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link PipelineDocumentResponse} instance. + * + * @param id The id of this {@link PipelineDocumentResponse} + */ + public void setId(@Nullable final String id) { + this.id = id; + } + + /** + * Set the viewLocation of this {@link PipelineDocumentResponse} instance and return the same + * instance. + * + * @param viewLocation The viewLocation of this {@link PipelineDocumentResponse} + * @return The same instance of this {@link PipelineDocumentResponse} class + */ + @Nonnull + public PipelineDocumentResponse viewLocation(@Nullable final String viewLocation) { + this.viewLocation = viewLocation; + return this; + } + + /** + * Get viewLocation + * + * @return viewLocation The viewLocation of this {@link PipelineDocumentResponse} instance. + */ + @Nullable + public String getViewLocation() { + return viewLocation; + } + + /** + * Set the viewLocation of this {@link PipelineDocumentResponse} instance. + * + * @param viewLocation The viewLocation of this {@link PipelineDocumentResponse} + */ + public void setViewLocation(@Nullable final String viewLocation) { + this.viewLocation = viewLocation; + } + + /** + * Set the downloadLocation of this {@link PipelineDocumentResponse} instance and return the same + * instance. + * + * @param downloadLocation The downloadLocation of this {@link PipelineDocumentResponse} + * @return The same instance of this {@link PipelineDocumentResponse} class + */ + @Nonnull + public PipelineDocumentResponse downloadLocation(@Nullable final String downloadLocation) { + this.downloadLocation = downloadLocation; + return this; + } + + /** + * Get downloadLocation + * + * @return downloadLocation The downloadLocation of this {@link PipelineDocumentResponse} + * instance. + */ + @Nullable + public String getDownloadLocation() { + return downloadLocation; + } + + /** + * Set the downloadLocation of this {@link PipelineDocumentResponse} instance. + * + * @param downloadLocation The downloadLocation of this {@link PipelineDocumentResponse} + */ + public void setDownloadLocation(@Nullable final String downloadLocation) { + this.downloadLocation = downloadLocation; + } + + /** + * Set the lastUpdatedTimestamp of this {@link PipelineDocumentResponse} instance and return the + * same instance. + * + * @param lastUpdatedTimestamp The lastUpdatedTimestamp of this {@link PipelineDocumentResponse} + * @return The same instance of this {@link PipelineDocumentResponse} class + */ + @Nonnull + public PipelineDocumentResponse lastUpdatedTimestamp( + @Nullable final String lastUpdatedTimestamp) { + this.lastUpdatedTimestamp = lastUpdatedTimestamp; + return this; + } + + /** + * Get lastUpdatedTimestamp + * + * @return lastUpdatedTimestamp The lastUpdatedTimestamp of this {@link PipelineDocumentResponse} + * instance. + */ + @Nonnull + public String getLastUpdatedTimestamp() { + return lastUpdatedTimestamp; + } + + /** + * Set the lastUpdatedTimestamp of this {@link PipelineDocumentResponse} instance. + * + * @param lastUpdatedTimestamp The lastUpdatedTimestamp of this {@link PipelineDocumentResponse} + */ + public void setLastUpdatedTimestamp(@Nullable final String lastUpdatedTimestamp) { + this.lastUpdatedTimestamp = lastUpdatedTimestamp; + } + + /** + * Set the status of this {@link PipelineDocumentResponse} instance and return the same instance. + * + * @param status The status of this {@link PipelineDocumentResponse} + * @return The same instance of this {@link PipelineDocumentResponse} class + */ + @Nonnull + public PipelineDocumentResponse status(@Nullable final DocumentStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status The status of this {@link PipelineDocumentResponse} instance. + */ + @Nonnull + public DocumentStatus getStatus() { + return status; + } + + /** + * Set the status of this {@link PipelineDocumentResponse} instance. + * + * @param status The status of this {@link PipelineDocumentResponse} + */ + public void setStatus(@Nullable final DocumentStatus status) { + this.status = status; + } + + /** + * Get the names of the unrecognizable properties of the {@link PipelineDocumentResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PipelineDocumentResponse} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "PipelineDocumentResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link PipelineDocumentResponse} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (viewLocation != null) declaredFields.put("viewLocation", viewLocation); + if (downloadLocation != null) declaredFields.put("downloadLocation", downloadLocation); + if (lastUpdatedTimestamp != null) + declaredFields.put("lastUpdatedTimestamp", lastUpdatedTimestamp); + if (status != null) declaredFields.put("status", status); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link PipelineDocumentResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelineDocumentResponse pipelineDocumentResponse = (PipelineDocumentResponse) o; + return Objects.equals(this.cloudSdkCustomFields, pipelineDocumentResponse.cloudSdkCustomFields) + && Objects.equals(this.id, pipelineDocumentResponse.id) + && Objects.equals(this.viewLocation, pipelineDocumentResponse.viewLocation) + && Objects.equals(this.downloadLocation, pipelineDocumentResponse.downloadLocation) + && Objects.equals(this.lastUpdatedTimestamp, pipelineDocumentResponse.lastUpdatedTimestamp) + && Objects.equals(this.status, pipelineDocumentResponse.status); + } + + @Override + public int hashCode() { + return Objects.hash( + id, viewLocation, downloadLocation, lastUpdatedTimestamp, status, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelineDocumentResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" viewLocation: ").append(toIndentedString(viewLocation)).append("\n"); + sb.append(" downloadLocation: ").append(toIndentedString(downloadLocation)).append("\n"); + sb.append(" lastUpdatedTimestamp: ") + .append(toIndentedString(lastUpdatedTimestamp)) + .append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link PipelineDocumentResponse} instance. No arguments are required. */ + public static PipelineDocumentResponse create() { + return new PipelineDocumentResponse(); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineExecutionData.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineExecutionData.java new file mode 100644 index 000000000..195ea2f82 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineExecutionData.java @@ -0,0 +1,208 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** PipelineExecutionData */ +// CHECKSTYLE:OFF +public class PipelineExecutionData +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("status") + private PipelineExecutionStatus status; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for PipelineExecutionData. */ + protected PipelineExecutionData() {} + + /** + * Set the id of this {@link PipelineExecutionData} instance and return the same instance. + * + * @param id The id of this {@link PipelineExecutionData} + * @return The same instance of this {@link PipelineExecutionData} class + */ + @Nonnull + public PipelineExecutionData id(@Nullable final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link PipelineExecutionData} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link PipelineExecutionData} instance. + * + * @param id The id of this {@link PipelineExecutionData} + */ + public void setId(@Nullable final String id) { + this.id = id; + } + + /** + * Set the status of this {@link PipelineExecutionData} instance and return the same instance. + * + * @param status The status of this {@link PipelineExecutionData} + * @return The same instance of this {@link PipelineExecutionData} class + */ + @Nonnull + public PipelineExecutionData status(@Nullable final PipelineExecutionStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status The status of this {@link PipelineExecutionData} instance. + */ + @Nonnull + public PipelineExecutionStatus getStatus() { + return status; + } + + /** + * Set the status of this {@link PipelineExecutionData} instance. + * + * @param status The status of this {@link PipelineExecutionData} + */ + public void setStatus(@Nullable final PipelineExecutionStatus status) { + this.status = status; + } + + /** + * Get the names of the unrecognizable properties of the {@link PipelineExecutionData}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link PipelineExecutionData} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "PipelineExecutionData has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link PipelineExecutionData} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (status != null) declaredFields.put("status", status); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link PipelineExecutionData} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final PipelineExecutionData pipelineExecutionData = (PipelineExecutionData) o; + return Objects.equals(this.cloudSdkCustomFields, pipelineExecutionData.cloudSdkCustomFields) + && Objects.equals(this.id, pipelineExecutionData.id) + && Objects.equals(this.status, pipelineExecutionData.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, status, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class PipelineExecutionData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link PipelineExecutionData} instance. No arguments are required. */ + public static PipelineExecutionData create() { + return new PipelineExecutionData(); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineExecutionStatus.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineExecutionStatus.java new file mode 100644 index 000000000..5204502d6 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineExecutionStatus.java @@ -0,0 +1,72 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.annotation.Nonnull; + +/** Gets or Sets PipelineExecutionStatus */ +public enum PipelineExecutionStatus { + NEW("NEW"), + + UNKNOWN("UNKNOWN"), + + INPROGRESS("INPROGRESS"), + + FINISHED("FINISHED"), + + FINISHEDWITHERRORS("FINISHEDWITHERRORS"), + + TIMEOUT("TIMEOUT"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + PipelineExecutionStatus(String value) { + this.value = value; + } + + /** + * @return The enum value. + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * @return The String representation of the enum value. + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Converts the given value to its enum representation. + * + * @param value The input value. + * @return The enum representation of the given value. + */ + @JsonCreator + public static PipelineExecutionStatus fromValue(@Nonnull final String value) { + for (final PipelineExecutionStatus b : PipelineExecutionStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineId.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineId.java index 5df05014c..c5f6ad7e4 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineId.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineId.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java deleted file mode 100644 index d2eb9094d..000000000 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequst.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** PipelinePostRequst */ -// CHECKSTYLE:OFF -public class PipelinePostRequst -// CHECKSTYLE:ON -{ - @JsonProperty("type") - private String type; - - @JsonProperty("configuration") - private PipelinePostRequstConfiguration _configuration; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for PipelinePostRequst. */ - protected PipelinePostRequst() {} - - /** - * Set the type of this {@link PipelinePostRequst} instance and return the same instance. - * - * @param type The type of this {@link PipelinePostRequst} - * @return The same instance of this {@link PipelinePostRequst} class - */ - @Nonnull - public PipelinePostRequst type(@Nonnull final String type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link PipelinePostRequst} instance. - */ - @Nonnull - public String getType() { - return type; - } - - /** - * Set the type of this {@link PipelinePostRequst} instance. - * - * @param type The type of this {@link PipelinePostRequst} - */ - public void setType(@Nonnull final String type) { - this.type = type; - } - - /** - * Set the _configuration of this {@link PipelinePostRequst} instance and return the same - * instance. - * - * @param _configuration The _configuration of this {@link PipelinePostRequst} - * @return The same instance of this {@link PipelinePostRequst} class - */ - @Nonnull - public PipelinePostRequst _configuration( - @Nonnull final PipelinePostRequstConfiguration _configuration) { - this._configuration = _configuration; - return this; - } - - /** - * Get _configuration - * - * @return _configuration The _configuration of this {@link PipelinePostRequst} instance. - */ - @Nonnull - public PipelinePostRequstConfiguration getConfiguration() { - return _configuration; - } - - /** - * Set the _configuration of this {@link PipelinePostRequst} instance. - * - * @param _configuration The _configuration of this {@link PipelinePostRequst} - */ - public void setConfiguration(@Nonnull final PipelinePostRequstConfiguration _configuration) { - this._configuration = _configuration; - } - - /** - * Get the names of the unrecognizable properties of the {@link PipelinePostRequst}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link PipelinePostRequst} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("PipelinePostRequst has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link PipelinePostRequst} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (_configuration != null) declaredFields.put("_configuration", _configuration); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link PipelinePostRequst} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final PipelinePostRequst pipelinePostRequst = (PipelinePostRequst) o; - return Objects.equals(this.cloudSdkCustomFields, pipelinePostRequst.cloudSdkCustomFields) - && Objects.equals(this.type, pipelinePostRequst.type) - && Objects.equals(this._configuration, pipelinePostRequst._configuration); - } - - @Override - public int hashCode() { - return Objects.hash(type, _configuration, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class PipelinePostRequst {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link PipelinePostRequst} - * instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (_configuration) -> new PipelinePostRequst().type(type)._configuration(_configuration); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link PipelinePostRequst} instance. - * - * @param type The type of this {@link PipelinePostRequst} - * @return The PipelinePostRequst builder. - */ - Builder1 type(@Nonnull final String type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the _configuration of this {@link PipelinePostRequst} instance. - * - * @param _configuration The _configuration of this {@link PipelinePostRequst} - * @return The PipelinePostRequst instance. - */ - PipelinePostRequst _configuration( - @Nonnull final PipelinePostRequstConfiguration _configuration); - } -} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner.java index 4535ee7f3..5aa15aca9 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java index c864d960c..aadf6fd58 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -34,10 +34,10 @@ public class ResultsInner1 private String filterId; @JsonProperty("results") - private List results = new ArrayList<>(); + private List results = new ArrayList<>(); - @JsonProperty("message") - private String message; + @JsonProperty("error") + private PerFilterSearchResultError error; @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -83,7 +83,7 @@ public void setFilterId(@Nonnull final String filterId) { * @return The same instance of this {@link ResultsInner1} class */ @Nonnull - public ResultsInner1 results(@Nullable final List results) { + public ResultsInner1 results(@Nullable final List results) { this.results = results; return this; } @@ -95,8 +95,7 @@ public ResultsInner1 results(@Nullable final List(); } @@ -110,7 +109,7 @@ public ResultsInner1 addResultsItem( * @return results The results of this {@link ResultsInner1} instance. */ @Nonnull - public List getResults() { + public List getResults() { return results; } @@ -119,39 +118,39 @@ public List getResults() { * * @param results List of returned results. */ - public void setResults(@Nullable final List results) { + public void setResults(@Nullable final List results) { this.results = results; } /** - * Set the message of this {@link ResultsInner1} instance and return the same instance. + * Set the error of this {@link ResultsInner1} instance and return the same instance. * - * @param message The message of this {@link ResultsInner1} + * @param error The error of this {@link ResultsInner1} * @return The same instance of this {@link ResultsInner1} class */ @Nonnull - public ResultsInner1 message(@Nonnull final String message) { - this.message = message; + public ResultsInner1 error(@Nullable final PerFilterSearchResultError error) { + this.error = error; return this; } /** - * Get message + * Get error * - * @return message The message of this {@link ResultsInner1} instance. + * @return error The error of this {@link ResultsInner1} instance. */ @Nonnull - public String getMessage() { - return message; + public PerFilterSearchResultError getError() { + return error; } /** - * Set the message of this {@link ResultsInner1} instance. + * Set the error of this {@link ResultsInner1} instance. * - * @param message The message of this {@link ResultsInner1} + * @param error The error of this {@link ResultsInner1} */ - public void setMessage(@Nonnull final String message) { - this.message = message; + public void setError(@Nullable final PerFilterSearchResultError error) { + this.error = error; } /** @@ -194,7 +193,7 @@ public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); if (filterId != null) declaredFields.put("filterId", filterId); if (results != null) declaredFields.put("results", results); - if (message != null) declaredFields.put("message", message); + if (error != null) declaredFields.put("error", error); return declaredFields; } @@ -222,12 +221,12 @@ public boolean equals(@Nullable final java.lang.Object o) { return Objects.equals(this.cloudSdkCustomFields, resultsInner1.cloudSdkCustomFields) && Objects.equals(this.filterId, resultsInner1.filterId) && Objects.equals(this.results, resultsInner1.results) - && Objects.equals(this.message, resultsInner1.message); + && Objects.equals(this.error, resultsInner1.error); } @Override public int hashCode() { - return Objects.hash(filterId, results, message, cloudSdkCustomFields); + return Objects.hash(filterId, results, error, cloudSdkCustomFields); } @Override @@ -237,7 +236,7 @@ public String toString() { sb.append("class ResultsInner1 {\n"); sb.append(" filterId: ").append(toIndentedString(filterId)).append("\n"); sb.append(" results: ").append(toIndentedString(results)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); @@ -260,7 +259,7 @@ private String toIndentedString(final java.lang.Object o) { * with all required arguments. */ public static Builder create() { - return (filterId) -> (message) -> new ResultsInner1().filterId(filterId).message(message); + return (filterId) -> new ResultsInner1().filterId(filterId); } /** Builder helper class. */ @@ -269,19 +268,8 @@ public interface Builder { * Set the filterId of this {@link ResultsInner1} instance. * * @param filterId The filterId of this {@link ResultsInner1} - * @return The ResultsInner1 builder. - */ - Builder1 filterId(@Nonnull final String filterId); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the message of this {@link ResultsInner1} instance. - * - * @param message The message of this {@link ResultsInner1} * @return The ResultsInner1 instance. */ - ResultsInner1 message(@Nonnull final String message); + ResultsInner1 filterId(@Nonnull final String filterId); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchConfiguration.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchConfiguration.java new file mode 100644 index 000000000..9c7658971 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchConfiguration.java @@ -0,0 +1,224 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** RetrievalSearchConfiguration */ +// CHECKSTYLE:OFF +public class RetrievalSearchConfiguration +// CHECKSTYLE:ON +{ + @JsonProperty("maxChunkCount") + private Integer maxChunkCount; + + @JsonProperty("maxDocumentCount") + private Integer maxDocumentCount; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetrievalSearchConfiguration. */ + protected RetrievalSearchConfiguration() {} + + /** + * Set the maxChunkCount of this {@link RetrievalSearchConfiguration} instance and return the same + * instance. + * + * @param maxChunkCount Maximum number of chunks to be returned. Cannot be used with + * 'maxDocumentCount'. Minimum: 0 + * @return The same instance of this {@link RetrievalSearchConfiguration} class + */ + @Nonnull + public RetrievalSearchConfiguration maxChunkCount(@Nullable final Integer maxChunkCount) { + this.maxChunkCount = maxChunkCount; + return this; + } + + /** + * Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. + * minimum: 0 + * + * @return maxChunkCount The maxChunkCount of this {@link RetrievalSearchConfiguration} instance. + */ + @Nullable + public Integer getMaxChunkCount() { + return maxChunkCount; + } + + /** + * Set the maxChunkCount of this {@link RetrievalSearchConfiguration} instance. + * + * @param maxChunkCount Maximum number of chunks to be returned. Cannot be used with + * 'maxDocumentCount'. Minimum: 0 + */ + public void setMaxChunkCount(@Nullable final Integer maxChunkCount) { + this.maxChunkCount = maxChunkCount; + } + + /** + * Set the maxDocumentCount of this {@link RetrievalSearchConfiguration} instance and return the + * same instance. + * + * @param maxDocumentCount [Only supports 'vector' dataRepositoryType] - Maximum number of + * documents to be returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount + * is given, then only one chunk per document is returned. Minimum: 0 + * @return The same instance of this {@link RetrievalSearchConfiguration} class + */ + @Nonnull + public RetrievalSearchConfiguration maxDocumentCount(@Nullable final Integer maxDocumentCount) { + this.maxDocumentCount = maxDocumentCount; + return this; + } + + /** + * [Only supports 'vector' dataRepositoryType] - Maximum number of documents to be + * returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount is given, then only + * one chunk per document is returned. minimum: 0 + * + * @return maxDocumentCount The maxDocumentCount of this {@link RetrievalSearchConfiguration} + * instance. + */ + @Nullable + public Integer getMaxDocumentCount() { + return maxDocumentCount; + } + + /** + * Set the maxDocumentCount of this {@link RetrievalSearchConfiguration} instance. + * + * @param maxDocumentCount [Only supports 'vector' dataRepositoryType] - Maximum number of + * documents to be returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount + * is given, then only one chunk per document is returned. Minimum: 0 + */ + public void setMaxDocumentCount(@Nullable final Integer maxDocumentCount) { + this.maxDocumentCount = maxDocumentCount; + } + + /** + * Get the names of the unrecognizable properties of the {@link RetrievalSearchConfiguration}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetrievalSearchConfiguration} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "RetrievalSearchConfiguration has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link RetrievalSearchConfiguration} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (maxChunkCount != null) declaredFields.put("maxChunkCount", maxChunkCount); + if (maxDocumentCount != null) declaredFields.put("maxDocumentCount", maxDocumentCount); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link RetrievalSearchConfiguration} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetrievalSearchConfiguration retrievalSearchConfiguration = + (RetrievalSearchConfiguration) o; + return Objects.equals( + this.cloudSdkCustomFields, retrievalSearchConfiguration.cloudSdkCustomFields) + && Objects.equals(this.maxChunkCount, retrievalSearchConfiguration.maxChunkCount) + && Objects.equals(this.maxDocumentCount, retrievalSearchConfiguration.maxDocumentCount); + } + + @Override + public int hashCode() { + return Objects.hash(maxChunkCount, maxDocumentCount, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetrievalSearchConfiguration {\n"); + sb.append(" maxChunkCount: ").append(toIndentedString(maxChunkCount)).append("\n"); + sb.append(" maxDocumentCount: ").append(toIndentedString(maxDocumentCount)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link RetrievalSearchConfiguration} instance. No arguments are required. */ + public static RetrievalSearchConfiguration create() { + return new RetrievalSearchConfiguration(); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java index ea829cbf2..bae53516f 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -35,7 +35,7 @@ public class RetrievalSearchFilter private String id; @JsonProperty("searchConfiguration") - private SearchConfiguration searchConfiguration; + private RetrievalSearchConfiguration searchConfiguration; @JsonProperty("dataRepositories") private List dataRepositories = new ArrayList<>(Arrays.asList("*")); @@ -98,7 +98,7 @@ public void setId(@Nonnull final String id) { */ @Nonnull public RetrievalSearchFilter searchConfiguration( - @Nullable final SearchConfiguration searchConfiguration) { + @Nullable final RetrievalSearchConfiguration searchConfiguration) { this.searchConfiguration = searchConfiguration; return this; } @@ -110,7 +110,7 @@ public RetrievalSearchFilter searchConfiguration( * instance. */ @Nonnull - public SearchConfiguration getSearchConfiguration() { + public RetrievalSearchConfiguration getSearchConfiguration() { return searchConfiguration; } @@ -119,7 +119,8 @@ public SearchConfiguration getSearchConfiguration() { * * @param searchConfiguration The searchConfiguration of this {@link RetrievalSearchFilter} */ - public void setSearchConfiguration(@Nullable final SearchConfiguration searchConfiguration) { + public void setSearchConfiguration( + @Nullable final RetrievalSearchConfiguration searchConfiguration) { this.searchConfiguration = searchConfiguration; } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/S3PipelineCreateRequest.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/S3PipelineCreateRequest.java new file mode 100644 index 000000000..7218939b1 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/S3PipelineCreateRequest.java @@ -0,0 +1,328 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** S3PipelineCreateRequest */ +// CHECKSTYLE:OFF +public class S3PipelineCreateRequest implements CreatePipeline +// CHECKSTYLE:ON +{ + /** Gets or Sets type */ + public enum TypeEnum { + /** The S3 option of this S3PipelineCreateRequest */ + S3("S3"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this S3PipelineCreateRequest */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type S3PipelineCreateRequest + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("configuration") + private CommonConfiguration _configuration; + + @JsonProperty("metadata") + private MetaData metadata; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for S3PipelineCreateRequest. */ + protected S3PipelineCreateRequest() {} + + /** + * Set the type of this {@link S3PipelineCreateRequest} instance and return the same instance. + * + * @param type The type of this {@link S3PipelineCreateRequest} + * @return The same instance of this {@link S3PipelineCreateRequest} class + */ + @Nonnull + public S3PipelineCreateRequest type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link S3PipelineCreateRequest} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link S3PipelineCreateRequest} instance. + * + * @param type The type of this {@link S3PipelineCreateRequest} + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the _configuration of this {@link S3PipelineCreateRequest} instance and return the same + * instance. + * + * @param _configuration The _configuration of this {@link S3PipelineCreateRequest} + * @return The same instance of this {@link S3PipelineCreateRequest} class + */ + @Nonnull + public S3PipelineCreateRequest _configuration(@Nonnull final CommonConfiguration _configuration) { + this._configuration = _configuration; + return this; + } + + /** + * Get _configuration + * + * @return _configuration The _configuration of this {@link S3PipelineCreateRequest} instance. + */ + @Nonnull + public CommonConfiguration getConfiguration() { + return _configuration; + } + + /** + * Set the _configuration of this {@link S3PipelineCreateRequest} instance. + * + * @param _configuration The _configuration of this {@link S3PipelineCreateRequest} + */ + public void setConfiguration(@Nonnull final CommonConfiguration _configuration) { + this._configuration = _configuration; + } + + /** + * Set the metadata of this {@link S3PipelineCreateRequest} instance and return the same instance. + * + * @param metadata The metadata of this {@link S3PipelineCreateRequest} + * @return The same instance of this {@link S3PipelineCreateRequest} class + */ + @Nonnull + public S3PipelineCreateRequest metadata(@Nullable final MetaData metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link S3PipelineCreateRequest} instance. + */ + @Nonnull + public MetaData getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link S3PipelineCreateRequest} instance. + * + * @param metadata The metadata of this {@link S3PipelineCreateRequest} + */ + public void setMetadata(@Nullable final MetaData metadata) { + this.metadata = metadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link S3PipelineCreateRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link S3PipelineCreateRequest} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "S3PipelineCreateRequest has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link S3PipelineCreateRequest} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (_configuration != null) declaredFields.put("_configuration", _configuration); + if (metadata != null) declaredFields.put("metadata", metadata); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link S3PipelineCreateRequest} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final S3PipelineCreateRequest s3PipelineCreateRequest = (S3PipelineCreateRequest) o; + return Objects.equals(this.cloudSdkCustomFields, s3PipelineCreateRequest.cloudSdkCustomFields) + && Objects.equals(this.type, s3PipelineCreateRequest.type) + && Objects.equals(this._configuration, s3PipelineCreateRequest._configuration) + && Objects.equals(this.metadata, s3PipelineCreateRequest.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(type, _configuration, metadata, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class S3PipelineCreateRequest {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * S3PipelineCreateRequest} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (_configuration) -> new S3PipelineCreateRequest().type(type)._configuration(_configuration); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link S3PipelineCreateRequest} instance. + * + * @param type The type of this {@link S3PipelineCreateRequest} + * @return The S3PipelineCreateRequest builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the _configuration of this {@link S3PipelineCreateRequest} instance. + * + * @param _configuration The _configuration of this {@link S3PipelineCreateRequest} + * @return The S3PipelineCreateRequest instance. + */ + S3PipelineCreateRequest _configuration(@Nonnull final CommonConfiguration _configuration); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/S3PipelineGetResponse.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/S3PipelineGetResponse.java new file mode 100644 index 000000000..d204da19d --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/S3PipelineGetResponse.java @@ -0,0 +1,378 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** S3PipelineGetResponse */ +// CHECKSTYLE:OFF +public class S3PipelineGetResponse implements GetPipeline +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + /** Gets or Sets type */ + public enum TypeEnum { + /** The S3 option of this S3PipelineGetResponse */ + S3("S3"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this S3PipelineGetResponse */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type S3PipelineGetResponse + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("metadata") + private MetaData metadata; + + @JsonProperty("configuration") + private CommonConfiguration _configuration; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for S3PipelineGetResponse. */ + protected S3PipelineGetResponse() {} + + /** + * Set the id of this {@link S3PipelineGetResponse} instance and return the same instance. + * + * @param id The id of this {@link S3PipelineGetResponse} + * @return The same instance of this {@link S3PipelineGetResponse} class + */ + @Nonnull + public S3PipelineGetResponse id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link S3PipelineGetResponse} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link S3PipelineGetResponse} instance. + * + * @param id The id of this {@link S3PipelineGetResponse} + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the type of this {@link S3PipelineGetResponse} instance and return the same instance. + * + * @param type The type of this {@link S3PipelineGetResponse} + * @return The same instance of this {@link S3PipelineGetResponse} class + */ + @Nonnull + public S3PipelineGetResponse type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link S3PipelineGetResponse} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link S3PipelineGetResponse} instance. + * + * @param type The type of this {@link S3PipelineGetResponse} + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the metadata of this {@link S3PipelineGetResponse} instance and return the same instance. + * + * @param metadata The metadata of this {@link S3PipelineGetResponse} + * @return The same instance of this {@link S3PipelineGetResponse} class + */ + @Nonnull + public S3PipelineGetResponse metadata(@Nullable final MetaData metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link S3PipelineGetResponse} instance. + */ + @Nonnull + public MetaData getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link S3PipelineGetResponse} instance. + * + * @param metadata The metadata of this {@link S3PipelineGetResponse} + */ + public void setMetadata(@Nullable final MetaData metadata) { + this.metadata = metadata; + } + + /** + * Set the _configuration of this {@link S3PipelineGetResponse} instance and return the same + * instance. + * + * @param _configuration The _configuration of this {@link S3PipelineGetResponse} + * @return The same instance of this {@link S3PipelineGetResponse} class + */ + @Nonnull + public S3PipelineGetResponse _configuration(@Nonnull final CommonConfiguration _configuration) { + this._configuration = _configuration; + return this; + } + + /** + * Get _configuration + * + * @return _configuration The _configuration of this {@link S3PipelineGetResponse} instance. + */ + @Nonnull + public CommonConfiguration getConfiguration() { + return _configuration; + } + + /** + * Set the _configuration of this {@link S3PipelineGetResponse} instance. + * + * @param _configuration The _configuration of this {@link S3PipelineGetResponse} + */ + public void setConfiguration(@Nonnull final CommonConfiguration _configuration) { + this._configuration = _configuration; + } + + /** + * Get the names of the unrecognizable properties of the {@link S3PipelineGetResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link S3PipelineGetResponse} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "S3PipelineGetResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link S3PipelineGetResponse} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (type != null) declaredFields.put("type", type); + if (metadata != null) declaredFields.put("metadata", metadata); + if (_configuration != null) declaredFields.put("_configuration", _configuration); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link S3PipelineGetResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final S3PipelineGetResponse s3PipelineGetResponse = (S3PipelineGetResponse) o; + return Objects.equals(this.cloudSdkCustomFields, s3PipelineGetResponse.cloudSdkCustomFields) + && Objects.equals(this.id, s3PipelineGetResponse.id) + && Objects.equals(this.type, s3PipelineGetResponse.type) + && Objects.equals(this.metadata, s3PipelineGetResponse.metadata) + && Objects.equals(this._configuration, s3PipelineGetResponse._configuration); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, metadata, _configuration, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class S3PipelineGetResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link S3PipelineGetResponse} + * instance with all required arguments. + */ + public static Builder create() { + return (id) -> + (type) -> + (_configuration) -> + new S3PipelineGetResponse().id(id).type(type)._configuration(_configuration); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link S3PipelineGetResponse} instance. + * + * @param id The id of this {@link S3PipelineGetResponse} + * @return The S3PipelineGetResponse builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the type of this {@link S3PipelineGetResponse} instance. + * + * @param type The type of this {@link S3PipelineGetResponse} + * @return The S3PipelineGetResponse builder. + */ + Builder2 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the _configuration of this {@link S3PipelineGetResponse} instance. + * + * @param _configuration The _configuration of this {@link S3PipelineGetResponse} + * @return The S3PipelineGetResponse instance. + */ + S3PipelineGetResponse _configuration(@Nonnull final CommonConfiguration _configuration); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SFTPPipelineCreateRequest.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SFTPPipelineCreateRequest.java new file mode 100644 index 000000000..265a362da --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SFTPPipelineCreateRequest.java @@ -0,0 +1,331 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** SFTPPipelineCreateRequest */ +// CHECKSTYLE:OFF +public class SFTPPipelineCreateRequest implements CreatePipeline +// CHECKSTYLE:ON +{ + /** Gets or Sets type */ + public enum TypeEnum { + /** The SFTP option of this SFTPPipelineCreateRequest */ + SFTP("SFTP"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this SFTPPipelineCreateRequest */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type SFTPPipelineCreateRequest + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("configuration") + private CommonConfiguration _configuration; + + @JsonProperty("metadata") + private MetaData metadata; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SFTPPipelineCreateRequest. */ + protected SFTPPipelineCreateRequest() {} + + /** + * Set the type of this {@link SFTPPipelineCreateRequest} instance and return the same instance. + * + * @param type The type of this {@link SFTPPipelineCreateRequest} + * @return The same instance of this {@link SFTPPipelineCreateRequest} class + */ + @Nonnull + public SFTPPipelineCreateRequest type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link SFTPPipelineCreateRequest} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link SFTPPipelineCreateRequest} instance. + * + * @param type The type of this {@link SFTPPipelineCreateRequest} + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the _configuration of this {@link SFTPPipelineCreateRequest} instance and return the same + * instance. + * + * @param _configuration The _configuration of this {@link SFTPPipelineCreateRequest} + * @return The same instance of this {@link SFTPPipelineCreateRequest} class + */ + @Nonnull + public SFTPPipelineCreateRequest _configuration( + @Nonnull final CommonConfiguration _configuration) { + this._configuration = _configuration; + return this; + } + + /** + * Get _configuration + * + * @return _configuration The _configuration of this {@link SFTPPipelineCreateRequest} instance. + */ + @Nonnull + public CommonConfiguration getConfiguration() { + return _configuration; + } + + /** + * Set the _configuration of this {@link SFTPPipelineCreateRequest} instance. + * + * @param _configuration The _configuration of this {@link SFTPPipelineCreateRequest} + */ + public void setConfiguration(@Nonnull final CommonConfiguration _configuration) { + this._configuration = _configuration; + } + + /** + * Set the metadata of this {@link SFTPPipelineCreateRequest} instance and return the same + * instance. + * + * @param metadata The metadata of this {@link SFTPPipelineCreateRequest} + * @return The same instance of this {@link SFTPPipelineCreateRequest} class + */ + @Nonnull + public SFTPPipelineCreateRequest metadata(@Nullable final MetaData metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link SFTPPipelineCreateRequest} instance. + */ + @Nonnull + public MetaData getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link SFTPPipelineCreateRequest} instance. + * + * @param metadata The metadata of this {@link SFTPPipelineCreateRequest} + */ + public void setMetadata(@Nullable final MetaData metadata) { + this.metadata = metadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link SFTPPipelineCreateRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SFTPPipelineCreateRequest} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "SFTPPipelineCreateRequest has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link SFTPPipelineCreateRequest} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (_configuration != null) declaredFields.put("_configuration", _configuration); + if (metadata != null) declaredFields.put("metadata", metadata); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link SFTPPipelineCreateRequest} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final SFTPPipelineCreateRequest sfTPPipelineCreateRequest = (SFTPPipelineCreateRequest) o; + return Objects.equals(this.cloudSdkCustomFields, sfTPPipelineCreateRequest.cloudSdkCustomFields) + && Objects.equals(this.type, sfTPPipelineCreateRequest.type) + && Objects.equals(this._configuration, sfTPPipelineCreateRequest._configuration) + && Objects.equals(this.metadata, sfTPPipelineCreateRequest.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(type, _configuration, metadata, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class SFTPPipelineCreateRequest {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * SFTPPipelineCreateRequest} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (_configuration) -> + new SFTPPipelineCreateRequest().type(type)._configuration(_configuration); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link SFTPPipelineCreateRequest} instance. + * + * @param type The type of this {@link SFTPPipelineCreateRequest} + * @return The SFTPPipelineCreateRequest builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the _configuration of this {@link SFTPPipelineCreateRequest} instance. + * + * @param _configuration The _configuration of this {@link SFTPPipelineCreateRequest} + * @return The SFTPPipelineCreateRequest instance. + */ + SFTPPipelineCreateRequest _configuration(@Nonnull final CommonConfiguration _configuration); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SFTPPipelineGetResponse.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SFTPPipelineGetResponse.java new file mode 100644 index 000000000..6fe5e0324 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SFTPPipelineGetResponse.java @@ -0,0 +1,378 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** SFTPPipelineGetResponse */ +// CHECKSTYLE:OFF +public class SFTPPipelineGetResponse implements GetPipeline +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + /** Gets or Sets type */ + public enum TypeEnum { + /** The SFTP option of this SFTPPipelineGetResponse */ + SFTP("SFTP"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this SFTPPipelineGetResponse */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type SFTPPipelineGetResponse + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("metadata") + private MetaData metadata; + + @JsonProperty("configuration") + private CommonConfiguration _configuration; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SFTPPipelineGetResponse. */ + protected SFTPPipelineGetResponse() {} + + /** + * Set the id of this {@link SFTPPipelineGetResponse} instance and return the same instance. + * + * @param id The id of this {@link SFTPPipelineGetResponse} + * @return The same instance of this {@link SFTPPipelineGetResponse} class + */ + @Nonnull + public SFTPPipelineGetResponse id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link SFTPPipelineGetResponse} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link SFTPPipelineGetResponse} instance. + * + * @param id The id of this {@link SFTPPipelineGetResponse} + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the type of this {@link SFTPPipelineGetResponse} instance and return the same instance. + * + * @param type The type of this {@link SFTPPipelineGetResponse} + * @return The same instance of this {@link SFTPPipelineGetResponse} class + */ + @Nonnull + public SFTPPipelineGetResponse type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link SFTPPipelineGetResponse} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link SFTPPipelineGetResponse} instance. + * + * @param type The type of this {@link SFTPPipelineGetResponse} + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the metadata of this {@link SFTPPipelineGetResponse} instance and return the same instance. + * + * @param metadata The metadata of this {@link SFTPPipelineGetResponse} + * @return The same instance of this {@link SFTPPipelineGetResponse} class + */ + @Nonnull + public SFTPPipelineGetResponse metadata(@Nullable final MetaData metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link SFTPPipelineGetResponse} instance. + */ + @Nonnull + public MetaData getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link SFTPPipelineGetResponse} instance. + * + * @param metadata The metadata of this {@link SFTPPipelineGetResponse} + */ + public void setMetadata(@Nullable final MetaData metadata) { + this.metadata = metadata; + } + + /** + * Set the _configuration of this {@link SFTPPipelineGetResponse} instance and return the same + * instance. + * + * @param _configuration The _configuration of this {@link SFTPPipelineGetResponse} + * @return The same instance of this {@link SFTPPipelineGetResponse} class + */ + @Nonnull + public SFTPPipelineGetResponse _configuration(@Nonnull final CommonConfiguration _configuration) { + this._configuration = _configuration; + return this; + } + + /** + * Get _configuration + * + * @return _configuration The _configuration of this {@link SFTPPipelineGetResponse} instance. + */ + @Nonnull + public CommonConfiguration getConfiguration() { + return _configuration; + } + + /** + * Set the _configuration of this {@link SFTPPipelineGetResponse} instance. + * + * @param _configuration The _configuration of this {@link SFTPPipelineGetResponse} + */ + public void setConfiguration(@Nonnull final CommonConfiguration _configuration) { + this._configuration = _configuration; + } + + /** + * Get the names of the unrecognizable properties of the {@link SFTPPipelineGetResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SFTPPipelineGetResponse} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "SFTPPipelineGetResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link SFTPPipelineGetResponse} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (type != null) declaredFields.put("type", type); + if (metadata != null) declaredFields.put("metadata", metadata); + if (_configuration != null) declaredFields.put("_configuration", _configuration); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link SFTPPipelineGetResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final SFTPPipelineGetResponse sfTPPipelineGetResponse = (SFTPPipelineGetResponse) o; + return Objects.equals(this.cloudSdkCustomFields, sfTPPipelineGetResponse.cloudSdkCustomFields) + && Objects.equals(this.id, sfTPPipelineGetResponse.id) + && Objects.equals(this.type, sfTPPipelineGetResponse.type) + && Objects.equals(this.metadata, sfTPPipelineGetResponse.metadata) + && Objects.equals(this._configuration, sfTPPipelineGetResponse._configuration); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, metadata, _configuration, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class SFTPPipelineGetResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * SFTPPipelineGetResponse} instance with all required arguments. + */ + public static Builder create() { + return (id) -> + (type) -> + (_configuration) -> + new SFTPPipelineGetResponse().id(id).type(type)._configuration(_configuration); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link SFTPPipelineGetResponse} instance. + * + * @param id The id of this {@link SFTPPipelineGetResponse} + * @return The SFTPPipelineGetResponse builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the type of this {@link SFTPPipelineGetResponse} instance. + * + * @param type The type of this {@link SFTPPipelineGetResponse} + * @return The SFTPPipelineGetResponse builder. + */ + Builder2 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the _configuration of this {@link SFTPPipelineGetResponse} instance. + * + * @param _configuration The _configuration of this {@link SFTPPipelineGetResponse} + * @return The SFTPPipelineGetResponse instance. + */ + SFTPPipelineGetResponse _configuration(@Nonnull final CommonConfiguration _configuration); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java index f997bc0b4..6e4d3a8a5 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchConfiguration.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -60,7 +60,7 @@ public SearchConfiguration maxChunkCount(@Nullable final Integer maxChunkCount) * * @return maxChunkCount The maxChunkCount of this {@link SearchConfiguration} instance. */ - @Nonnull + @Nullable public Integer getMaxChunkCount() { return maxChunkCount; } @@ -97,7 +97,7 @@ public SearchConfiguration maxDocumentCount(@Nullable final Integer maxDocumentC * * @return maxDocumentCount The maxDocumentCount of this {@link SearchConfiguration} instance. */ - @Nonnull + @Nullable public Integer getMaxDocumentCount() { return maxDocumentCount; } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java index fdd3e79d0..eeef41246 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchDocumentKeyValueListPair.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java index 5d631dfd9..76e0add0d 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchFilter.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchInput.java similarity index 60% rename from core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java rename to core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchInput.java index 0d33f5e6a..39a08b731 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchInput.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -26,9 +26,9 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -/** RetrievalSearchInput */ +/** SearchInput */ // CHECKSTYLE:OFF -public class RetrievalSearchInput +public class SearchInput // CHECKSTYLE:ON { @JsonProperty("query") @@ -40,17 +40,17 @@ public class RetrievalSearchInput @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for RetrievalSearchInput. */ - protected RetrievalSearchInput() {} + /** Default constructor for SearchInput. */ + protected SearchInput() {} /** - * Set the query of this {@link RetrievalSearchInput} instance and return the same instance. + * Set the query of this {@link SearchInput} instance and return the same instance. * * @param query Query string - * @return The same instance of this {@link RetrievalSearchInput} class + * @return The same instance of this {@link SearchInput} class */ @Nonnull - public RetrievalSearchInput query(@Nonnull final String query) { + public SearchInput query(@Nonnull final String query) { this.query = query; return this; } @@ -58,7 +58,7 @@ public RetrievalSearchInput query(@Nonnull final String query) { /** * Query string * - * @return query The query of this {@link RetrievalSearchInput} instance. + * @return query The query of this {@link SearchInput} instance. */ @Nonnull public String getQuery() { @@ -66,7 +66,7 @@ public String getQuery() { } /** - * Set the query of this {@link RetrievalSearchInput} instance. + * Set the query of this {@link SearchInput} instance. * * @param query Query string */ @@ -75,25 +75,25 @@ public void setQuery(@Nonnull final String query) { } /** - * Set the filters of this {@link RetrievalSearchInput} instance and return the same instance. + * Set the filters of this {@link SearchInput} instance and return the same instance. * - * @param filters The filters of this {@link RetrievalSearchInput} - * @return The same instance of this {@link RetrievalSearchInput} class + * @param filters The filters of this {@link SearchInput} + * @return The same instance of this {@link SearchInput} class */ @Nonnull - public RetrievalSearchInput filters(@Nonnull final List filters) { + public SearchInput filters(@Nonnull final List filters) { this.filters = filters; return this; } /** - * Add one filters instance to this {@link RetrievalSearchInput}. + * Add one filters instance to this {@link SearchInput}. * * @param filtersItem The filters that should be added - * @return The same instance of type {@link RetrievalSearchInput} + * @return The same instance of type {@link SearchInput} */ @Nonnull - public RetrievalSearchInput addFiltersItem(@Nonnull final RetrievalSearchFilter filtersItem) { + public SearchInput addFiltersItem(@Nonnull final RetrievalSearchFilter filtersItem) { if (this.filters == null) { this.filters = new ArrayList<>(); } @@ -104,7 +104,7 @@ public RetrievalSearchInput addFiltersItem(@Nonnull final RetrievalSearchFilter /** * Get filters * - * @return filters The filters of this {@link RetrievalSearchInput} instance. + * @return filters The filters of this {@link SearchInput} instance. */ @Nonnull public List getFilters() { @@ -112,16 +112,16 @@ public List getFilters() { } /** - * Set the filters of this {@link RetrievalSearchInput} instance. + * Set the filters of this {@link SearchInput} instance. * - * @param filters The filters of this {@link RetrievalSearchInput} + * @param filters The filters of this {@link SearchInput} */ public void setFilters(@Nonnull final List filters) { this.filters = filters; } /** - * Get the names of the unrecognizable properties of the {@link RetrievalSearchInput}. + * Get the names of the unrecognizable properties of the {@link SearchInput}. * * @return The set of properties names */ @@ -132,7 +132,7 @@ public Set getCustomFieldNames() { } /** - * Get the value of an unrecognizable property of this {@link RetrievalSearchInput} instance. + * Get the value of an unrecognizable property of this {@link SearchInput} instance. * * @deprecated Use {@link #toMap()} instead. * @param name The name of the property @@ -143,15 +143,14 @@ public Set getCustomFieldNames() { @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "RetrievalSearchInput has no field with name '" + name + "'."); + throw new NoSuchElementException("SearchInput has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link RetrievalSearchInput} instance including - * unrecognized properties. + * Get the value of all properties of this {@link SearchInput} instance including unrecognized + * properties. * * @return The map of all properties */ @@ -165,8 +164,8 @@ public Map toMap() { } /** - * Set an unrecognizable property of this {@link RetrievalSearchInput} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. + * Set an unrecognizable property of this {@link SearchInput} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. * * @param customFieldName The name of the property * @param customFieldValue The value of the property @@ -184,10 +183,10 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final RetrievalSearchInput retrievalSearchInput = (RetrievalSearchInput) o; - return Objects.equals(this.cloudSdkCustomFields, retrievalSearchInput.cloudSdkCustomFields) - && Objects.equals(this.query, retrievalSearchInput.query) - && Objects.equals(this.filters, retrievalSearchInput.filters); + final SearchInput searchInput = (SearchInput) o; + return Objects.equals(this.cloudSdkCustomFields, searchInput.cloudSdkCustomFields) + && Objects.equals(this.query, searchInput.query) + && Objects.equals(this.filters, searchInput.filters); } @Override @@ -199,7 +198,7 @@ public int hashCode() { @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class RetrievalSearchInput {\n"); + sb.append("class SearchInput {\n"); sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); cloudSdkCustomFields.forEach( @@ -220,20 +219,20 @@ private String toIndentedString(final java.lang.Object o) { } /** - * Create a type-safe, fluent-api builder object to construct a new {@link RetrievalSearchInput} - * instance with all required arguments. + * Create a type-safe, fluent-api builder object to construct a new {@link SearchInput} instance + * with all required arguments. */ public static Builder create() { - return (query) -> (filters) -> new RetrievalSearchInput().query(query).filters(filters); + return (query) -> (filters) -> new SearchInput().query(query).filters(filters); } /** Builder helper class. */ public interface Builder { /** - * Set the query of this {@link RetrievalSearchInput} instance. + * Set the query of this {@link SearchInput} instance. * * @param query Query string - * @return The RetrievalSearchInput builder. + * @return The SearchInput builder. */ Builder1 query(@Nonnull final String query); } @@ -241,20 +240,20 @@ public interface Builder { /** Builder helper class. */ public interface Builder1 { /** - * Set the filters of this {@link RetrievalSearchInput} instance. + * Set the filters of this {@link SearchInput} instance. * - * @param filters The filters of this {@link RetrievalSearchInput} - * @return The RetrievalSearchInput instance. + * @param filters The filters of this {@link SearchInput} + * @return The SearchInput instance. */ - RetrievalSearchInput filters(@Nonnull final List filters); + SearchInput filters(@Nonnull final List filters); /** - * Set the filters of this {@link RetrievalSearchInput} instance. + * Set the filters of this {@link SearchInput} instance. * - * @param filters The filters of this {@link RetrievalSearchInput} - * @return The RetrievalSearchInput instance. + * @param filters The filters of this {@link SearchInput} + * @return The SearchInput instance. */ - default RetrievalSearchInput filters(@Nonnull final RetrievalSearchFilter... filters) { + default SearchInput filters(@Nonnull final RetrievalSearchFilter... filters) { return filters(Arrays.asList(filters)); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchResults.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchResults.java index eb561e3de..4eb7868d7 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchResults.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchResults.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchSelectOptionEnum.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchSelectOptionEnum.java index 59262938e..63a55747a 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchSelectOptionEnum.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchSelectOptionEnum.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePoint.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SharePointConfig.java similarity index 57% rename from core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePoint.java rename to core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SharePointConfig.java index 5fede6fa9..6deb5cc99 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePoint.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SharePointConfig.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -23,30 +23,28 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -/** PipelineConfigurationSharePoint */ +/** SharePointConfig */ // CHECKSTYLE:OFF -public class PipelineConfigurationSharePoint +public class SharePointConfig // CHECKSTYLE:ON { @JsonProperty("site") - private PipelineConfigurationSharePointSite site; + private SharePointSite site; @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for PipelineConfigurationSharePoint. */ - protected PipelineConfigurationSharePoint() {} + /** Default constructor for SharePointConfig. */ + protected SharePointConfig() {} /** - * Set the site of this {@link PipelineConfigurationSharePoint} instance and return the same - * instance. + * Set the site of this {@link SharePointConfig} instance and return the same instance. * - * @param site The site of this {@link PipelineConfigurationSharePoint} - * @return The same instance of this {@link PipelineConfigurationSharePoint} class + * @param site The site of this {@link SharePointConfig} + * @return The same instance of this {@link SharePointConfig} class */ @Nonnull - public PipelineConfigurationSharePoint site( - @Nullable final PipelineConfigurationSharePointSite site) { + public SharePointConfig site(@Nonnull final SharePointSite site) { this.site = site; return this; } @@ -54,24 +52,24 @@ public PipelineConfigurationSharePoint site( /** * Get site * - * @return site The site of this {@link PipelineConfigurationSharePoint} instance. + * @return site The site of this {@link SharePointConfig} instance. */ @Nonnull - public PipelineConfigurationSharePointSite getSite() { + public SharePointSite getSite() { return site; } /** - * Set the site of this {@link PipelineConfigurationSharePoint} instance. + * Set the site of this {@link SharePointConfig} instance. * - * @param site The site of this {@link PipelineConfigurationSharePoint} + * @param site The site of this {@link SharePointConfig} */ - public void setSite(@Nullable final PipelineConfigurationSharePointSite site) { + public void setSite(@Nonnull final SharePointSite site) { this.site = site; } /** - * Get the names of the unrecognizable properties of the {@link PipelineConfigurationSharePoint}. + * Get the names of the unrecognizable properties of the {@link SharePointConfig}. * * @return The set of properties names */ @@ -82,8 +80,7 @@ public Set getCustomFieldNames() { } /** - * Get the value of an unrecognizable property of this {@link PipelineConfigurationSharePoint} - * instance. + * Get the value of an unrecognizable property of this {@link SharePointConfig} instance. * * @deprecated Use {@link #toMap()} instead. * @param name The name of the property @@ -94,15 +91,14 @@ public Set getCustomFieldNames() { @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "PipelineConfigurationSharePoint has no field with name '" + name + "'."); + throw new NoSuchElementException("SharePointConfig has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link PipelineConfigurationSharePoint} instance - * including unrecognized properties. + * Get the value of all properties of this {@link SharePointConfig} instance including + * unrecognized properties. * * @return The map of all properties */ @@ -115,9 +111,8 @@ public Map toMap() { } /** - * Set an unrecognizable property of this {@link PipelineConfigurationSharePoint} instance. If the - * map previously contained a mapping for the key, the old value is replaced by the specified - * value. + * Set an unrecognizable property of this {@link SharePointConfig} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. * * @param customFieldName The name of the property * @param customFieldValue The value of the property @@ -135,11 +130,9 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final PipelineConfigurationSharePoint pipelineConfigurationSharePoint = - (PipelineConfigurationSharePoint) o; - return Objects.equals( - this.cloudSdkCustomFields, pipelineConfigurationSharePoint.cloudSdkCustomFields) - && Objects.equals(this.site, pipelineConfigurationSharePoint.site); + final SharePointConfig sharePointConfig = (SharePointConfig) o; + return Objects.equals(this.cloudSdkCustomFields, sharePointConfig.cloudSdkCustomFields) + && Objects.equals(this.site, sharePointConfig.site); } @Override @@ -151,7 +144,7 @@ public int hashCode() { @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class PipelineConfigurationSharePoint {\n"); + sb.append("class SharePointConfig {\n"); sb.append(" site: ").append(toIndentedString(site)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> @@ -170,8 +163,22 @@ private String toIndentedString(final java.lang.Object o) { return o.toString().replace("\n", "\n "); } - /** Create a new {@link PipelineConfigurationSharePoint} instance. No arguments are required. */ - public static PipelineConfigurationSharePoint create() { - return new PipelineConfigurationSharePoint(); + /** + * Create a type-safe, fluent-api builder object to construct a new {@link SharePointConfig} + * instance with all required arguments. + */ + public static Builder create() { + return (site) -> new SharePointConfig().site(site); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the site of this {@link SharePointConfig} instance. + * + * @param site The site of this {@link SharePointConfig} + * @return The SharePointConfig instance. + */ + SharePointConfig site(@Nonnull final SharePointSite site); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SharePointConfigGetResponse.java similarity index 53% rename from core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java rename to core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SharePointConfigGetResponse.java index dac31f906..03fe215b7 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePoint.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SharePointConfigGetResponse.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -23,30 +23,28 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -/** PipelinePostRequstConfigurationSharePoint */ +/** SharePointConfigGetResponse */ // CHECKSTYLE:OFF -public class PipelinePostRequstConfigurationSharePoint +public class SharePointConfigGetResponse // CHECKSTYLE:ON { @JsonProperty("site") - private PipelinePostRequstConfigurationSharePointSite site; + private SharePointSiteGetResponse site; @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for PipelinePostRequstConfigurationSharePoint. */ - protected PipelinePostRequstConfigurationSharePoint() {} + /** Default constructor for SharePointConfigGetResponse. */ + protected SharePointConfigGetResponse() {} /** - * Set the site of this {@link PipelinePostRequstConfigurationSharePoint} instance and return the - * same instance. + * Set the site of this {@link SharePointConfigGetResponse} instance and return the same instance. * - * @param site The site of this {@link PipelinePostRequstConfigurationSharePoint} - * @return The same instance of this {@link PipelinePostRequstConfigurationSharePoint} class + * @param site The site of this {@link SharePointConfigGetResponse} + * @return The same instance of this {@link SharePointConfigGetResponse} class */ @Nonnull - public PipelinePostRequstConfigurationSharePoint site( - @Nullable final PipelinePostRequstConfigurationSharePointSite site) { + public SharePointConfigGetResponse site(@Nonnull final SharePointSiteGetResponse site) { this.site = site; return this; } @@ -54,25 +52,24 @@ public PipelinePostRequstConfigurationSharePoint site( /** * Get site * - * @return site The site of this {@link PipelinePostRequstConfigurationSharePoint} instance. + * @return site The site of this {@link SharePointConfigGetResponse} instance. */ @Nonnull - public PipelinePostRequstConfigurationSharePointSite getSite() { + public SharePointSiteGetResponse getSite() { return site; } /** - * Set the site of this {@link PipelinePostRequstConfigurationSharePoint} instance. + * Set the site of this {@link SharePointConfigGetResponse} instance. * - * @param site The site of this {@link PipelinePostRequstConfigurationSharePoint} + * @param site The site of this {@link SharePointConfigGetResponse} */ - public void setSite(@Nullable final PipelinePostRequstConfigurationSharePointSite site) { + public void setSite(@Nonnull final SharePointSiteGetResponse site) { this.site = site; } /** - * Get the names of the unrecognizable properties of the {@link - * PipelinePostRequstConfigurationSharePoint}. + * Get the names of the unrecognizable properties of the {@link SharePointConfigGetResponse}. * * @return The set of properties names */ @@ -83,8 +80,8 @@ public Set getCustomFieldNames() { } /** - * Get the value of an unrecognizable property of this {@link - * PipelinePostRequstConfigurationSharePoint} instance. + * Get the value of an unrecognizable property of this {@link SharePointConfigGetResponse} + * instance. * * @deprecated Use {@link #toMap()} instead. * @param name The name of the property @@ -96,14 +93,14 @@ public Set getCustomFieldNames() { public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( - "PipelinePostRequstConfigurationSharePoint has no field with name '" + name + "'."); + "SharePointConfigGetResponse has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link PipelinePostRequstConfigurationSharePoint} - * instance including unrecognized properties. + * Get the value of all properties of this {@link SharePointConfigGetResponse} instance including + * unrecognized properties. * * @return The map of all properties */ @@ -116,9 +113,8 @@ public Map toMap() { } /** - * Set an unrecognizable property of this {@link PipelinePostRequstConfigurationSharePoint} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. + * Set an unrecognizable property of this {@link SharePointConfigGetResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. * * @param customFieldName The name of the property * @param customFieldValue The value of the property @@ -136,12 +132,10 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final PipelinePostRequstConfigurationSharePoint pipelinePostRequstConfigurationSharePoint = - (PipelinePostRequstConfigurationSharePoint) o; + final SharePointConfigGetResponse sharePointConfigGetResponse = (SharePointConfigGetResponse) o; return Objects.equals( - this.cloudSdkCustomFields, - pipelinePostRequstConfigurationSharePoint.cloudSdkCustomFields) - && Objects.equals(this.site, pipelinePostRequstConfigurationSharePoint.site); + this.cloudSdkCustomFields, sharePointConfigGetResponse.cloudSdkCustomFields) + && Objects.equals(this.site, sharePointConfigGetResponse.site); } @Override @@ -153,7 +147,7 @@ public int hashCode() { @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class PipelinePostRequstConfigurationSharePoint {\n"); + sb.append("class SharePointConfigGetResponse {\n"); sb.append(" site: ").append(toIndentedString(site)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> @@ -173,10 +167,21 @@ private String toIndentedString(final java.lang.Object o) { } /** - * Create a new {@link PipelinePostRequstConfigurationSharePoint} instance. No arguments are - * required. + * Create a type-safe, fluent-api builder object to construct a new {@link + * SharePointConfigGetResponse} instance with all required arguments. */ - public static PipelinePostRequstConfigurationSharePoint create() { - return new PipelinePostRequstConfigurationSharePoint(); + public static Builder create() { + return (site) -> new SharePointConfigGetResponse().site(site); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the site of this {@link SharePointConfigGetResponse} instance. + * + * @param site The site of this {@link SharePointConfigGetResponse} + * @return The SharePointConfigGetResponse instance. + */ + SharePointConfigGetResponse site(@Nonnull final SharePointSiteGetResponse site); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SharePointSite.java similarity index 53% rename from core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java rename to core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SharePointSite.java index a06b6b62d..9d6c8e679 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelinePostRequstConfigurationSharePointSite.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SharePointSite.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -25,9 +25,9 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -/** PipelinePostRequstConfigurationSharePointSite */ +/** SharePointSite */ // CHECKSTYLE:OFF -public class PipelinePostRequstConfigurationSharePointSite +public class SharePointSite // CHECKSTYLE:ON { @JsonProperty("name") @@ -39,18 +39,17 @@ public class PipelinePostRequstConfigurationSharePointSite @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for PipelinePostRequstConfigurationSharePointSite. */ - protected PipelinePostRequstConfigurationSharePointSite() {} + /** Default constructor for SharePointSite. */ + protected SharePointSite() {} /** - * Set the name of this {@link PipelinePostRequstConfigurationSharePointSite} instance and return - * the same instance. + * Set the name of this {@link SharePointSite} instance and return the same instance. * - * @param name The name of this {@link PipelinePostRequstConfigurationSharePointSite} - * @return The same instance of this {@link PipelinePostRequstConfigurationSharePointSite} class + * @param name The name of this {@link SharePointSite} + * @return The same instance of this {@link SharePointSite} class */ @Nonnull - public PipelinePostRequstConfigurationSharePointSite name(@Nullable final String name) { + public SharePointSite name(@Nonnull final String name) { this.name = name; return this; } @@ -58,7 +57,7 @@ public PipelinePostRequstConfigurationSharePointSite name(@Nullable final String /** * Get name * - * @return name The name of this {@link PipelinePostRequstConfigurationSharePointSite} instance. + * @return name The name of this {@link SharePointSite} instance. */ @Nonnull public String getName() { @@ -66,38 +65,34 @@ public String getName() { } /** - * Set the name of this {@link PipelinePostRequstConfigurationSharePointSite} instance. + * Set the name of this {@link SharePointSite} instance. * - * @param name The name of this {@link PipelinePostRequstConfigurationSharePointSite} + * @param name The name of this {@link SharePointSite} */ - public void setName(@Nullable final String name) { + public void setName(@Nonnull final String name) { this.name = name; } /** - * Set the includePaths of this {@link PipelinePostRequstConfigurationSharePointSite} instance and - * return the same instance. + * Set the includePaths of this {@link SharePointSite} instance and return the same instance. * - * @param includePaths The includePaths of this {@link - * PipelinePostRequstConfigurationSharePointSite} - * @return The same instance of this {@link PipelinePostRequstConfigurationSharePointSite} class + * @param includePaths The includePaths of this {@link SharePointSite} + * @return The same instance of this {@link SharePointSite} class */ @Nonnull - public PipelinePostRequstConfigurationSharePointSite includePaths( - @Nullable final List includePaths) { + public SharePointSite includePaths(@Nullable final List includePaths) { this.includePaths = includePaths; return this; } /** - * Add one includePaths instance to this {@link PipelinePostRequstConfigurationSharePointSite}. + * Add one includePaths instance to this {@link SharePointSite}. * * @param includePathsItem The includePaths that should be added - * @return The same instance of type {@link PipelinePostRequstConfigurationSharePointSite} + * @return The same instance of type {@link SharePointSite} */ @Nonnull - public PipelinePostRequstConfigurationSharePointSite addIncludePathsItem( - @Nonnull final String includePathsItem) { + public SharePointSite addIncludePathsItem(@Nonnull final String includePathsItem) { if (this.includePaths == null) { this.includePaths = new ArrayList<>(); } @@ -108,8 +103,7 @@ public PipelinePostRequstConfigurationSharePointSite addIncludePathsItem( /** * Get includePaths * - * @return includePaths The includePaths of this {@link - * PipelinePostRequstConfigurationSharePointSite} instance. + * @return includePaths The includePaths of this {@link SharePointSite} instance. */ @Nonnull public List getIncludePaths() { @@ -117,18 +111,16 @@ public List getIncludePaths() { } /** - * Set the includePaths of this {@link PipelinePostRequstConfigurationSharePointSite} instance. + * Set the includePaths of this {@link SharePointSite} instance. * - * @param includePaths The includePaths of this {@link - * PipelinePostRequstConfigurationSharePointSite} + * @param includePaths The includePaths of this {@link SharePointSite} */ public void setIncludePaths(@Nullable final List includePaths) { this.includePaths = includePaths; } /** - * Get the names of the unrecognizable properties of the {@link - * PipelinePostRequstConfigurationSharePointSite}. + * Get the names of the unrecognizable properties of the {@link SharePointSite}. * * @return The set of properties names */ @@ -139,8 +131,7 @@ public Set getCustomFieldNames() { } /** - * Get the value of an unrecognizable property of this {@link - * PipelinePostRequstConfigurationSharePointSite} instance. + * Get the value of an unrecognizable property of this {@link SharePointSite} instance. * * @deprecated Use {@link #toMap()} instead. * @param name The name of the property @@ -151,15 +142,14 @@ public Set getCustomFieldNames() { @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "PipelinePostRequstConfigurationSharePointSite has no field with name '" + name + "'."); + throw new NoSuchElementException("SharePointSite has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link PipelinePostRequstConfigurationSharePointSite} - * instance including unrecognized properties. + * Get the value of all properties of this {@link SharePointSite} instance including unrecognized + * properties. * * @return The map of all properties */ @@ -173,9 +163,8 @@ public Map toMap() { } /** - * Set an unrecognizable property of this {@link PipelinePostRequstConfigurationSharePointSite} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. + * Set an unrecognizable property of this {@link SharePointSite} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. * * @param customFieldName The name of the property * @param customFieldValue The value of the property @@ -193,15 +182,10 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final PipelinePostRequstConfigurationSharePointSite - pipelinePostRequstConfigurationSharePointSite = - (PipelinePostRequstConfigurationSharePointSite) o; - return Objects.equals( - this.cloudSdkCustomFields, - pipelinePostRequstConfigurationSharePointSite.cloudSdkCustomFields) - && Objects.equals(this.name, pipelinePostRequstConfigurationSharePointSite.name) - && Objects.equals( - this.includePaths, pipelinePostRequstConfigurationSharePointSite.includePaths); + final SharePointSite sharePointSite = (SharePointSite) o; + return Objects.equals(this.cloudSdkCustomFields, sharePointSite.cloudSdkCustomFields) + && Objects.equals(this.name, sharePointSite.name) + && Objects.equals(this.includePaths, sharePointSite.includePaths); } @Override @@ -213,7 +197,7 @@ public int hashCode() { @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class PipelinePostRequstConfigurationSharePointSite {\n"); + sb.append("class SharePointSite {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" includePaths: ").append(toIndentedString(includePaths)).append("\n"); cloudSdkCustomFields.forEach( @@ -234,10 +218,21 @@ private String toIndentedString(final java.lang.Object o) { } /** - * Create a new {@link PipelinePostRequstConfigurationSharePointSite} instance. No arguments are - * required. + * Create a type-safe, fluent-api builder object to construct a new {@link SharePointSite} + * instance with all required arguments. */ - public static PipelinePostRequstConfigurationSharePointSite create() { - return new PipelinePostRequstConfigurationSharePointSite(); + public static Builder create() { + return (name) -> new SharePointSite().name(name); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the name of this {@link SharePointSite} instance. + * + * @param name The name of this {@link SharePointSite} + * @return The SharePointSite instance. + */ + SharePointSite name(@Nonnull final String name); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePointSite.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SharePointSiteGetResponse.java similarity index 53% rename from core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePointSite.java rename to core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SharePointSiteGetResponse.java index 8fe4fec42..74df1a37b 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/PipelineConfigurationSharePointSite.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SharePointSiteGetResponse.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * @@ -25,9 +25,9 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -/** PipelineConfigurationSharePointSite */ +/** SharePointSiteGetResponse */ // CHECKSTYLE:OFF -public class PipelineConfigurationSharePointSite +public class SharePointSiteGetResponse // CHECKSTYLE:ON { @JsonProperty("id") @@ -42,18 +42,17 @@ public class PipelineConfigurationSharePointSite @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for PipelineConfigurationSharePointSite. */ - protected PipelineConfigurationSharePointSite() {} + /** Default constructor for SharePointSiteGetResponse. */ + protected SharePointSiteGetResponse() {} /** - * Set the id of this {@link PipelineConfigurationSharePointSite} instance and return the same - * instance. + * Set the id of this {@link SharePointSiteGetResponse} instance and return the same instance. * - * @param id The id of this {@link PipelineConfigurationSharePointSite} - * @return The same instance of this {@link PipelineConfigurationSharePointSite} class + * @param id The id of this {@link SharePointSiteGetResponse} + * @return The same instance of this {@link SharePointSiteGetResponse} class */ @Nonnull - public PipelineConfigurationSharePointSite id(@Nullable final String id) { + public SharePointSiteGetResponse id(@Nullable final String id) { this.id = id; return this; } @@ -61,7 +60,7 @@ public PipelineConfigurationSharePointSite id(@Nullable final String id) { /** * Get id * - * @return id The id of this {@link PipelineConfigurationSharePointSite} instance. + * @return id The id of this {@link SharePointSiteGetResponse} instance. */ @Nonnull public String getId() { @@ -69,23 +68,22 @@ public String getId() { } /** - * Set the id of this {@link PipelineConfigurationSharePointSite} instance. + * Set the id of this {@link SharePointSiteGetResponse} instance. * - * @param id The id of this {@link PipelineConfigurationSharePointSite} + * @param id The id of this {@link SharePointSiteGetResponse} */ public void setId(@Nullable final String id) { this.id = id; } /** - * Set the name of this {@link PipelineConfigurationSharePointSite} instance and return the same - * instance. + * Set the name of this {@link SharePointSiteGetResponse} instance and return the same instance. * - * @param name The name of this {@link PipelineConfigurationSharePointSite} - * @return The same instance of this {@link PipelineConfigurationSharePointSite} class + * @param name The name of this {@link SharePointSiteGetResponse} + * @return The same instance of this {@link SharePointSiteGetResponse} class */ @Nonnull - public PipelineConfigurationSharePointSite name(@Nullable final String name) { + public SharePointSiteGetResponse name(@Nonnull final String name) { this.name = name; return this; } @@ -93,7 +91,7 @@ public PipelineConfigurationSharePointSite name(@Nullable final String name) { /** * Get name * - * @return name The name of this {@link PipelineConfigurationSharePointSite} instance. + * @return name The name of this {@link SharePointSiteGetResponse} instance. */ @Nonnull public String getName() { @@ -101,37 +99,35 @@ public String getName() { } /** - * Set the name of this {@link PipelineConfigurationSharePointSite} instance. + * Set the name of this {@link SharePointSiteGetResponse} instance. * - * @param name The name of this {@link PipelineConfigurationSharePointSite} + * @param name The name of this {@link SharePointSiteGetResponse} */ - public void setName(@Nullable final String name) { + public void setName(@Nonnull final String name) { this.name = name; } /** - * Set the includePaths of this {@link PipelineConfigurationSharePointSite} instance and return - * the same instance. + * Set the includePaths of this {@link SharePointSiteGetResponse} instance and return the same + * instance. * - * @param includePaths The includePaths of this {@link PipelineConfigurationSharePointSite} - * @return The same instance of this {@link PipelineConfigurationSharePointSite} class + * @param includePaths The includePaths of this {@link SharePointSiteGetResponse} + * @return The same instance of this {@link SharePointSiteGetResponse} class */ @Nonnull - public PipelineConfigurationSharePointSite includePaths( - @Nullable final List includePaths) { + public SharePointSiteGetResponse includePaths(@Nullable final List includePaths) { this.includePaths = includePaths; return this; } /** - * Add one includePaths instance to this {@link PipelineConfigurationSharePointSite}. + * Add one includePaths instance to this {@link SharePointSiteGetResponse}. * * @param includePathsItem The includePaths that should be added - * @return The same instance of type {@link PipelineConfigurationSharePointSite} + * @return The same instance of type {@link SharePointSiteGetResponse} */ @Nonnull - public PipelineConfigurationSharePointSite addIncludePathsItem( - @Nonnull final String includePathsItem) { + public SharePointSiteGetResponse addIncludePathsItem(@Nonnull final String includePathsItem) { if (this.includePaths == null) { this.includePaths = new ArrayList<>(); } @@ -142,8 +138,7 @@ public PipelineConfigurationSharePointSite addIncludePathsItem( /** * Get includePaths * - * @return includePaths The includePaths of this {@link PipelineConfigurationSharePointSite} - * instance. + * @return includePaths The includePaths of this {@link SharePointSiteGetResponse} instance. */ @Nonnull public List getIncludePaths() { @@ -151,17 +146,16 @@ public List getIncludePaths() { } /** - * Set the includePaths of this {@link PipelineConfigurationSharePointSite} instance. + * Set the includePaths of this {@link SharePointSiteGetResponse} instance. * - * @param includePaths The includePaths of this {@link PipelineConfigurationSharePointSite} + * @param includePaths The includePaths of this {@link SharePointSiteGetResponse} */ public void setIncludePaths(@Nullable final List includePaths) { this.includePaths = includePaths; } /** - * Get the names of the unrecognizable properties of the {@link - * PipelineConfigurationSharePointSite}. + * Get the names of the unrecognizable properties of the {@link SharePointSiteGetResponse}. * * @return The set of properties names */ @@ -172,8 +166,7 @@ public Set getCustomFieldNames() { } /** - * Get the value of an unrecognizable property of this {@link PipelineConfigurationSharePointSite} - * instance. + * Get the value of an unrecognizable property of this {@link SharePointSiteGetResponse} instance. * * @deprecated Use {@link #toMap()} instead. * @param name The name of the property @@ -185,14 +178,14 @@ public Set getCustomFieldNames() { public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( - "PipelineConfigurationSharePointSite has no field with name '" + name + "'."); + "SharePointSiteGetResponse has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link PipelineConfigurationSharePointSite} instance - * including unrecognized properties. + * Get the value of all properties of this {@link SharePointSiteGetResponse} instance including + * unrecognized properties. * * @return The map of all properties */ @@ -207,9 +200,8 @@ public Map toMap() { } /** - * Set an unrecognizable property of this {@link PipelineConfigurationSharePointSite} instance. If - * the map previously contained a mapping for the key, the old value is replaced by the specified - * value. + * Set an unrecognizable property of this {@link SharePointSiteGetResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. * * @param customFieldName The name of the property * @param customFieldValue The value of the property @@ -227,13 +219,11 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final PipelineConfigurationSharePointSite pipelineConfigurationSharePointSite = - (PipelineConfigurationSharePointSite) o; - return Objects.equals( - this.cloudSdkCustomFields, pipelineConfigurationSharePointSite.cloudSdkCustomFields) - && Objects.equals(this.id, pipelineConfigurationSharePointSite.id) - && Objects.equals(this.name, pipelineConfigurationSharePointSite.name) - && Objects.equals(this.includePaths, pipelineConfigurationSharePointSite.includePaths); + final SharePointSiteGetResponse sharePointSiteGetResponse = (SharePointSiteGetResponse) o; + return Objects.equals(this.cloudSdkCustomFields, sharePointSiteGetResponse.cloudSdkCustomFields) + && Objects.equals(this.id, sharePointSiteGetResponse.id) + && Objects.equals(this.name, sharePointSiteGetResponse.name) + && Objects.equals(this.includePaths, sharePointSiteGetResponse.includePaths); } @Override @@ -245,7 +235,7 @@ public int hashCode() { @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class PipelineConfigurationSharePointSite {\n"); + sb.append("class SharePointSiteGetResponse {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" includePaths: ").append(toIndentedString(includePaths)).append("\n"); @@ -267,9 +257,21 @@ private String toIndentedString(final java.lang.Object o) { } /** - * Create a new {@link PipelineConfigurationSharePointSite} instance. No arguments are required. + * Create a type-safe, fluent-api builder object to construct a new {@link + * SharePointSiteGetResponse} instance with all required arguments. */ - public static PipelineConfigurationSharePointSite create() { - return new PipelineConfigurationSharePointSite(); + public static Builder create() { + return (name) -> new SharePointSiteGetResponse().name(name); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the name of this {@link SharePointSiteGetResponse} instance. + * + * @param name The name of this {@link SharePointSiteGetResponse} + * @return The SharePointSiteGetResponse instance. + */ + SharePointSiteGetResponse name(@Nonnull final String name); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java index 7df724156..e027733b1 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextOnlyBaseChunk.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java index 537582e21..7ecd57f07 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/TextSearchRequest.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ValidationError.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ValidationError.java new file mode 100644 index 000000000..a4c7471ff --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ValidationError.java @@ -0,0 +1,308 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** ValidationError */ +// CHECKSTYLE:OFF +public class ValidationError +// CHECKSTYLE:ON +{ + @JsonProperty("loc") + private List loc = new ArrayList<>(); + + @JsonProperty("msg") + private String msg; + + @JsonProperty("type") + private String type; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ValidationError. */ + protected ValidationError() {} + + /** + * Set the loc of this {@link ValidationError} instance and return the same instance. + * + * @param loc The loc of this {@link ValidationError} + * @return The same instance of this {@link ValidationError} class + */ + @Nonnull + public ValidationError loc(@Nonnull final List loc) { + this.loc = loc; + return this; + } + + /** + * Add one loc instance to this {@link ValidationError}. + * + * @param locItem The loc that should be added + * @return The same instance of type {@link ValidationError} + */ + @Nonnull + public ValidationError addLocItem(@Nonnull final String locItem) { + if (this.loc == null) { + this.loc = new ArrayList<>(); + } + this.loc.add(locItem); + return this; + } + + /** + * Get loc + * + * @return loc The loc of this {@link ValidationError} instance. + */ + @Nonnull + public List getLoc() { + return loc; + } + + /** + * Set the loc of this {@link ValidationError} instance. + * + * @param loc The loc of this {@link ValidationError} + */ + public void setLoc(@Nonnull final List loc) { + this.loc = loc; + } + + /** + * Set the msg of this {@link ValidationError} instance and return the same instance. + * + * @param msg The msg of this {@link ValidationError} + * @return The same instance of this {@link ValidationError} class + */ + @Nonnull + public ValidationError msg(@Nonnull final String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg The msg of this {@link ValidationError} instance. + */ + @Nonnull + public String getMsg() { + return msg; + } + + /** + * Set the msg of this {@link ValidationError} instance. + * + * @param msg The msg of this {@link ValidationError} + */ + public void setMsg(@Nonnull final String msg) { + this.msg = msg; + } + + /** + * Set the type of this {@link ValidationError} instance and return the same instance. + * + * @param type The type of this {@link ValidationError} + * @return The same instance of this {@link ValidationError} class + */ + @Nonnull + public ValidationError type(@Nonnull final String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link ValidationError} instance. + */ + @Nonnull + public String getType() { + return type; + } + + /** + * Set the type of this {@link ValidationError} instance. + * + * @param type The type of this {@link ValidationError} + */ + public void setType(@Nonnull final String type) { + this.type = type; + } + + /** + * Get the names of the unrecognizable properties of the {@link ValidationError}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ValidationError} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("ValidationError has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link ValidationError} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (loc != null) declaredFields.put("loc", loc); + if (msg != null) declaredFields.put("msg", msg); + if (type != null) declaredFields.put("type", type); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link ValidationError} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final ValidationError validationError = (ValidationError) o; + return Objects.equals(this.cloudSdkCustomFields, validationError.cloudSdkCustomFields) + && Objects.equals(this.loc, validationError.loc) + && Objects.equals(this.msg, validationError.msg) + && Objects.equals(this.type, validationError.type); + } + + @Override + public int hashCode() { + return Objects.hash(loc, msg, type, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ValidationError {\n"); + sb.append(" loc: ").append(toIndentedString(loc)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link ValidationError} + * instance with all required arguments. + */ + public static Builder create() { + return (loc) -> (msg) -> (type) -> new ValidationError().loc(loc).msg(msg).type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the loc of this {@link ValidationError} instance. + * + * @param loc The loc of this {@link ValidationError} + * @return The ValidationError builder. + */ + Builder1 loc(@Nonnull final List loc); + + /** + * Set the loc of this {@link ValidationError} instance. + * + * @param loc The loc of this {@link ValidationError} + * @return The ValidationError builder. + */ + default Builder1 loc(@Nonnull final String... loc) { + return loc(Arrays.asList(loc)); + } + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the msg of this {@link ValidationError} instance. + * + * @param msg The msg of this {@link ValidationError} + * @return The ValidationError builder. + */ + Builder2 msg(@Nonnull final String msg); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the type of this {@link ValidationError} instance. + * + * @param type The type of this {@link ValidationError} + * @return The ValidationError instance. + */ + ValidationError type(@Nonnull final String type); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java index b41503d9c..f058057e5 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionCreationStatus200Response.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java index f46b7badb..48b303615 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorV1VectorEndpointsGetCollectionDeletionStatus200Response.java @@ -1,6 +1,6 @@ /* - * Document Grounding Pipeline API - * SAP AI Core - API Specification AI Data Management api's + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. * * * diff --git a/core-services/document-grounding/src/main/resources/spec/grounding.yaml b/core-services/document-grounding/src/main/resources/spec/grounding.yaml index 897bbe9c9..d88cb2454 100644 --- a/core-services/document-grounding/src/main/resources/spec/grounding.yaml +++ b/core-services/document-grounding/src/main/resources/spec/grounding.yaml @@ -1,85 +1,113 @@ openapi: 3.0.0 info: - title: Document Grounding Pipeline API + title: Grounding version: 0.1.0 - description: "SAP AI Core - API Specification AI Data Management api's" + description: Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. contact: name: SAP AI Core +x-sap-shortText: Enhance content generation with additional capabilities for business AI scenarios. +externalDocs: + description: Documentation for SAP AI Core - Grounding + url: https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/grounding tags: - - name: pipelines + - name: Pipelines description: Tag for pipelines component - - name: vector + - name: Vector description: Tag for vector component - - name: retrieval + - name: Retrieval description: Tag for retrieval component servers: - - url: "/v2/lm/document-grounding" + - url: "https://api.ai.{region}.ml.hana.ondemand.com/v2/lm/{service}" + description: Production endpoint for SAP AI Core + variables: + region: + enum: + - prod.eu-central-1.aws + - prodeuonly.eu-central-1.aws + - prod.us-east-1.aws + - prod.ap-northeast-1.aws + - prod.ap-southeast-2.aws + - prod-eu20.westeurope.azure + - prod-eu30.europe-west3.gcp + - prod-us21.eastus.azure + - prod-us30.us-central1.gcp + - prod-ap20.australiaeast.az + - prod-ap11.ap-southeast-1.aws + default: prod.eu-central-1.aws + service: + default: document-grounding paths: "/pipelines": post: + tags: + - Pipelines operationId: pipeline.v1.pipeline_endpoints.create_pipeline - x-sap-cloud-sdk-operation-name: createPipeline + summary: Pipeline Creation description: 'Create a pipeline' - tags: - - pipelines + x-sap-cloud-sdk-operation-name: createPipeline parameters: - in: header name: AI-Resource-Group required: true schema: type: string + description: Resource Group ID requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/PipelinePostRequst' + $ref: '#/components/schemas/createPipeline' responses: '201': description: Returns pipelineId on successful creation. content: application/json: schema: - $ref: '#/components/schemas/PipelineId' + $ref: '#/components/schemas/pipelineId' '400': $ref: '#/components/responses/BadRequest' get: + tags: + - Pipelines parameters: - in: header name: AI-Resource-Group required: true schema: type: string + description: Resource Group ID - $ref: "#/components/parameters/top" - $ref: '#/components/parameters/skip' - $ref: '#/components/parameters/count' - operationId: pipeline.v1.pipeline_endpoints.get_all_pipelines - x-sap-cloud-sdk-operation-name: getAllPipelines + operationId: pipeline.v1.pipeline_endpoints.get_all_pipeline + summary: Get Pipelines description: 'Get all pipelines' - tags: - - pipelines + x-sap-cloud-sdk-operation-name: getAllPipelines responses: '200': description: Returns all pipelines for the tenant. content: application/json: schema: - $ref: '#/components/schemas/Pipelines' + $ref: '#/components/schemas/getPipelines' '400': $ref: '#/components/responses/BadRequest' "/pipelines/{pipelineId}": get: + tags: + - Pipelines operationId: pipeline.v1.pipeline_endpoints.get_pipeline_by_id - x-sap-cloud-sdk-operation-name: getPipelineById + summary: Get details of a Pipeline description: 'Get details of a pipeline by pipeline id' - tags: - - pipelines + x-sap-cloud-sdk-operation-name: getPipelineDetailsById parameters: - in: header name: AI-Resource-Group required: true schema: type: string + description: Resource Group ID - name: pipelineId in: path required: true @@ -92,21 +120,23 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Pipeline' + $ref: '#/components/schemas/getPipeline' '400': $ref: '#/components/responses/BadRequest' delete: + tags: + - Pipelines operationId: pipeline.v1.pipeline_endpoints.delete_pipeline_by_id - x-sap-cloud-sdk-operation-name: deletePipelineById + summary: Delete pipeline description: 'Delete a pipeline by pipeline id' - tags: - - pipelines + x-sap-cloud-sdk-operation-name: deletePipelineById parameters: - in: header name: AI-Resource-Group required: true schema: type: string + description: Resource Group ID - name: pipelineId in: path required: true @@ -120,17 +150,19 @@ paths: $ref: '#/components/responses/BadRequest' "/pipelines/{pipelineId}/status": get: + tags: + - Pipelines operationId: pipeline.v1.pipeline_endpoints.get_pipeline_status - x-sap-cloud-sdk-operation-name: getPipelineStatus + summary: Get status of Pipeline description: 'Get pipeline status by pipeline id' - tags: - - pipelines + x-sap-cloud-sdk-operation-name: getPipelineStatusById parameters: - in: header name: AI-Resource-Group required: true schema: type: string + description: Resource Group ID - name: pipelineId in: path required: true @@ -143,9 +175,231 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PipelineStatus' + $ref: '#/components/schemas/getPipelineStatus' '400': $ref: '#/components/responses/BadRequest' + + ### ### ### Pipeline Status API ### ### + ### ### ######################### ### ### + "/pipelines/{pipelineId}/executions": + get: + tags: + - Pipelines + operationId: pipeline.v1.pipeline_endpoints.get_pipeline_executions + summary: Get Pipeline Executions + description: Retrieve all executions for a specific pipeline. Optionally, filter to get only the last execution. + x-sap-cloud-sdk-operation-name: getAllExecutionsForPipeline + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: pipelineId + in: path + required: true + schema: + type: string + description: The ID of the pipeline + - name: lastExecution + in: query + required: false + schema: + type: boolean + description: Filter to get the last execution + - $ref: "#/components/parameters/top" + - $ref: '#/components/parameters/skip' + - $ref: '#/components/parameters/count' + responses: + '200': + description: Returns all executions + content: + application/json: + schema: + $ref: '#/components/schemas/getPipelineExecutions' + + "/pipelines/{pipelineId}/executions/{executionId}": + get: + tags: + - Pipelines + operationId: pipeline.v1.pipeline_endpoints.get_pipeline_execution_by_id + summary: Get Pipeline Execution by ID + description: Retrieve details of a specific pipeline execution by its execution ID. + x-sap-cloud-sdk-operation-name: getExecutionDetailsByIdForPipelineExecution + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: pipelineId + in: path + required: true + schema: + type: string + description: The ID of the pipeline + - name: executionId + in: path + required: true + schema: + type: string + description: The ID of the execution + responses: + '200': + description: Returns a response to execution id + content: + application/json: + schema: + $ref: '#/components/schemas/getPipelineExecutionById' + + "/pipelines/{pipelineId}/executions/{executionId}/documents": + get: + tags: + - Pipelines + operationId: pipeline.v1.pipeline_endpoints.get_pipeline_execution_documents + summary: Get Documents for a Pipeline Execution + description: Retrieve all documents associated with a specific pipeline execution. Optionally, filter the results using query parameters. + x-sap-cloud-sdk-operation-name: getDocumentsForPipelineExecution + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: pipelineId + in: path + required: true + schema: + type: string + description: The ID of the pipeline + - name: executionId + in: path + required: true + schema: + type: string + description: The ID of the execution + - $ref: "#/components/parameters/top" + - $ref: '#/components/parameters/skip' + - $ref: '#/components/parameters/count' + responses: + '200': + description: Returns a response to execution id + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentsStatusResponse' + + "/pipelines/{pipelineId}/executions/{executionId}/documents/{documentId}": + get: + tags: + - Pipelines + operationId: pipeline.v1.pipeline_endpoints.get_pipeline_execution_document_by_id + summary: Get Document by ID for a Pipeline Execution + description: Retrieve details of a specific document associated with a pipeline execution. + x-sap-cloud-sdk-operation-name: getDocumentByIdForPipelineExecution + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: pipelineId + in: path + required: true + schema: + type: string + description: The ID of the pipeline + - name: executionId + in: path + required: true + schema: + type: string + description: The ID of the execution + - name: documentId + in: path + required: true + schema: + type: string + description: The ID of the document to get. + responses: + '200': + description: Returns a response to execution id and document id. + content: + application/json: + schema: + $ref: '#/components/schemas/PipelineDocumentResponse' + + "/pipelines/{pipelineId}/documents": + get: + tags: + - Pipelines + operationId: pipeline.v1.pipeline_endpoints.get_pipeline_documents + summary: Get Documents for a Pipeline + description: Retrieve all documents associated with a specific pipeline. Optionally, filter the results using query parameters. + x-sap-cloud-sdk-operation-name: getAllDocumentsForPipeline + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: pipelineId + in: path + required: true + schema: + type: string + description: The ID of the pipeline to get. + - $ref: "#/components/parameters/top" + - $ref: '#/components/parameters/skip' + - $ref: '#/components/parameters/count' + responses: + '200': + description: Returns all documents for a pipeline. + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentsStatusResponse' + + "/pipelines/{pipelineId}/documents/{documentId}": + get: + tags: + - Pipelines + operationId: pipeline.v1.pipeline_endpoints.get_pipeline_document_by_id + summary: Get Document by ID for a Pipeline + description: Retrieve details of a specific document associated with a pipeline. + x-sap-cloud-sdk-operation-name: getDocumentByIdForPipeline + parameters: + - in: header + name: AI-Resource-Group + required: true + schema: + type: string + description: Resource Group ID + - name: pipelineId + in: path + required: true + schema: + type: string + description: The ID of the pipeline to get. + - name: documentId + in: path + required: true + schema: + type: string + description: The ID of the document to get. + responses: + '200': + description: Returns a response to document id. + content: + application/json: + schema: + $ref: '#/components/schemas/PipelineDocumentResponse' + "/vector/collections": get: parameters: @@ -154,11 +408,12 @@ paths: required: true schema: type: string + description: Resource Group ID - $ref: "#/components/parameters/top" - $ref: '#/components/parameters/skip' - $ref: '#/components/parameters/count' tags: - - vector + - Vector summary: Get collections description: Gets a list of collections. operationId: vector.v1.vector_endpoints.get_all_collections @@ -179,8 +434,9 @@ paths: required: true schema: type: string + description: Resource Group ID tags: - - vector + - Vector summary: Create collection description: Creates a collection. This operation is asynchronous. Poll the collection resource and check the status field to understand creation status. operationId: vector.v1.vector_endpoints.create_collection @@ -198,7 +454,9 @@ paths: Location: description: The newly created collections monitor url schema: - $ref: '#/components/schemas/CollectionPendingResponse' + type: string + format: uri + '400': $ref: '#/components/responses/BadRequest' '422': @@ -206,7 +464,7 @@ paths: "/vector/collections/{collectionId}": get: tags: - - vector + - Vector summary: Get collection by ID description: Gets a specific collection by ID. operationId: vector.v1.vector_endpoints.get_collection_by_id @@ -217,6 +475,7 @@ paths: required: true schema: type: string + description: Resource Group ID - name: collectionId in: path required: true @@ -224,6 +483,7 @@ paths: type: string format: uuid title: Collectionid + description: Collection ID responses: '200': description: Successful Response @@ -239,10 +499,10 @@ paths: $ref: '#/components/responses/UnprocessableEntity' delete: tags: - - vector + - Vector summary: Delete collection by ID description: Deletes a specific collection by ID. This operation is asynchronous. Poll the collection for a 404 status code. - operationId: vector.v1.vector_endpoints.delete_collection_by_id + operationId: vector.v1.vector_endpoints.delete_collection x-sap-cloud-sdk-operation-name: deleteCollectionById parameters: - in: header @@ -250,12 +510,14 @@ paths: required: true schema: type: string + description: Resource Group ID - name: collectionId in: path required: true schema: type: string title: Collectionid + description: Collection ID responses: '202': description: Successful Response @@ -263,7 +525,8 @@ paths: Location: description: The deleted collections monitor url schema: - $ref: '#/components/schemas/CollectionPendingResponse' + type: string + format: uri '400': $ref: '#/components/responses/BadRequest' '404': @@ -273,17 +536,18 @@ paths: "/vector/collections/{collectionId}/documents/{documentId}": get: tags: - - vector + - Vector summary: Get document by ID description: Gets a specific document in a collection by ID. operationId: vector.v1.vector_endpoints.get_document_by_id - x-sap-cloud-sdk-operation-name: getDocumentById + x-sap-cloud-sdk-operation-name: getDocumentByIdForCollection parameters: - in: header name: AI-Resource-Group required: true schema: type: string + description: Resource Group ID - name: collectionId in: path required: true @@ -291,6 +555,7 @@ paths: type: string format: uuid title: Collectionid + description: Collection ID - name: documentId in: path required: true @@ -298,6 +563,7 @@ paths: type: string format: uuid title: Documentid + description: Document ID responses: '200': description: Successful Response @@ -313,17 +579,18 @@ paths: $ref: '#/components/responses/UnprocessableEntity' delete: tags: - - vector + - Vector summary: Delete a document description: Deletes a specific document of a collection. - operationId: vector.v1.vector_endpoints.delete_document_by_id - x-sap-cloud-sdk-operation-name: deleteDocumentById + operationId: vector.v1.vector_endpoints.delete_document + x-sap-cloud-sdk-operation-name: deleteCollectionById parameters: - in: header name: AI-Resource-Group required: true schema: type: string + description: Resource Group ID - name: collectionId in: path required: true @@ -331,6 +598,7 @@ paths: type: string format: uuid title: Collectionid + description: Collection ID - name: documentId in: path required: true @@ -338,6 +606,7 @@ paths: type: string format: uuid title: Documentid + description: Document ID responses: '204': description: Successful Response @@ -350,17 +619,18 @@ paths: "/vector/collections/{collectionId}/documents": get: tags: - - vector + - Vector summary: Get documents description: Gets a list of documents of a collection. operationId: vector.v1.vector_endpoints.get_all_documents - x-sap-cloud-sdk-operation-name: getAllDocuments + x-sap-cloud-sdk-operation-name: getDocumentsByCollectionId parameters: - in: header name: AI-Resource-Group required: true schema: type: string + description: Resource Group ID - name: collectionId in: path required: true @@ -368,6 +638,7 @@ paths: type: string format: uuid title: Collectionid + description: Collection ID - $ref: "#/components/parameters/top" - $ref: '#/components/parameters/skip' - $ref: '#/components/parameters/count' @@ -386,17 +657,18 @@ paths: $ref: '#/components/responses/UnprocessableEntity' post: tags: - - vector + - Vector summary: Create documents in collection description: Create and stores one or multiple documents into a collection. If omitted, 'id' will be auto-generated. operationId: vector.v1.vector_endpoints.create_documents - x-sap-cloud-sdk-operation-name: createDocuments + x-sap-cloud-sdk-operation-name: createCollectionDocuments parameters: - in: header name: AI-Resource-Group required: true schema: type: string + description: Resource Group ID - name: collectionId in: path required: true @@ -404,6 +676,7 @@ paths: type: string format: uuid title: Collectionid + description: Collection ID requestBody: required: true content: @@ -425,17 +698,18 @@ paths: $ref: '#/components/responses/UnprocessableEntity' patch: tags: - - vector + - Vector summary: Upsert documents in collection description: Upserts the data of multiple documents into a collection. operationId: vector.v1.vector_endpoints.update_documents - x-sap-cloud-sdk-operation-name: updateDocuments + x-sap-cloud-sdk-operation-name: insertOrUpdateDocumentsInCollection parameters: - in: header name: AI-Resource-Group required: true schema: type: string + description: Resource Group ID - name: collectionId in: path required: true @@ -443,6 +717,7 @@ paths: type: string format: uuid title: Collectionid + description: Collection ID requestBody: required: true content: @@ -470,12 +745,13 @@ paths: required: true schema: type: string + description: Resource Group ID tags: - - vector + - Vector summary: Search chunk by vector - description: "Search chunk by vector" - operationId: vector.v1.vector_endpoints.search - x-sap-cloud-sdk-operation-name: search + description: Search chunks + operationId: vector.v1.vector_endpoints.search_chunk + x-sap-cloud-sdk-operation-name: vectorSearchByChunk requestBody: content: application/json: @@ -498,17 +774,18 @@ paths: "/vector/collections/{id}/creationStatus": get: tags: - - vector + - Vector summary: Get collection status by ID description: Gets a specific collection status from monitor by ID. operationId: vector.v1.vector_endpoints.get_collection_creation_status - x-sap-cloud-sdk-operation-name: getCollectionCreationStatus + x-sap-cloud-sdk-operation-name: getCollectionStatus parameters: - in: header name: AI-Resource-Group required: true schema: type: string + description: Resource Group ID - name: id in: path required: true @@ -516,6 +793,7 @@ paths: type: string format: uuid title: ID + description: Collection ID responses: '200': description: Successful Response @@ -534,7 +812,7 @@ paths: "/vector/collections/{id}/deletionStatus": get: tags: - - vector + - Vector summary: Get collection status by ID description: Gets a specific collection status from monitor by ID. operationId: vector.v1.vector_endpoints.get_collection_deletion_status @@ -545,6 +823,7 @@ paths: required: true schema: type: string + description: Resource Group ID - name: id in: path required: true @@ -552,6 +831,7 @@ paths: type: string format: uuid title: Id + description: Collection ID responses: '200': description: Successful Response @@ -575,13 +855,14 @@ paths: required: true schema: type: string + description: Resource Group ID - $ref: "#/components/parameters/top" - $ref: '#/components/parameters/skip' - $ref: '#/components/parameters/count' tags: - - retrieval + - Retrieval summary: List all DataRepository objects. - description: List all DataRepository objects. + description: List all Data Repositories operationId: retrieval.v1.retrieval_endpoints.get_data_repositories x-sap-cloud-sdk-operation-name: getDataRepositories responses: @@ -596,10 +877,10 @@ paths: "/retrieval/dataRepositories/{repositoryId}": get: tags: - - retrieval + - Retrieval summary: List single DataRepository object. - description: List single DataRepository object. - operationId: retrieval.v1.retrieval_endpoints.get_data_repository_by_id + description: List data repository by id + operationId: retrieval.v1.retrieval_endpoints.get_data_repository x-sap-cloud-sdk-operation-name: getDataRepositoryById parameters: - in: header @@ -607,6 +888,7 @@ paths: required: true schema: type: string + description: Resource Group ID - name: repositoryId in: path required: true @@ -614,6 +896,7 @@ paths: type: string format: uuid title: Repositoryid + description: Repository ID responses: '200': description: Successful Response @@ -635,9 +918,10 @@ paths: required: true schema: type: string + description: Resource Group ID tags: - - retrieval - summary: Retrieve relevant content given a query string. + - Retrieval + summary: Retrieve relevant content description: Retrieve relevant content given a query string. operationId: retrieval.v1.retrieval_endpoints.search x-sap-cloud-sdk-operation-name: search @@ -645,7 +929,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/RetrievalSearchInput" + $ref: "#/components/schemas/SearchInput" required: true responses: '200': @@ -653,157 +937,415 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/RetievalSearchResults" + $ref: "#/components/schemas/SearchResults" '400': $ref: '#/components/responses/BadRequest' '422': $ref: '#/components/responses/UnprocessableEntity' + components: + securitySchemes: + Oauth2: + type: oauth2 + description: OAuth client credentials (client ID and secret) are required. These can be requested from SAP BTP cloud cockpit. + flows: + clientCredentials: + tokenUrl: https://(subdomain_identity_zone).authentication.(host)/oauth/token + scopes: {} schemas: - PipelinePostRequst: + createPipeline: + oneOf: + - $ref: "#/components/schemas/MSSharePointPipelineCreateRequest" + - $ref: "#/components/schemas/S3PipelineCreateRequest" + - $ref: "#/components/schemas/SFTPPipelineCreateRequest" + discriminator: + propertyName: type + mapping: + MSSharePoint: "#/components/schemas/MSSharePointPipelineCreateRequest" + S3: "#/components/schemas/S3PipelineCreateRequest" + SFTP: "#/components/schemas/SFTPPipelineCreateRequest" + + MSSharePointPipelineCreateRequest: type: object required: - - type - - configuration - additionalProperties: true + - type + - configuration properties: type: type: string - example: MSSharePoint + enum: [MSSharePoint] configuration: - type: object - additionalProperties: true - required: - - destination - properties: - destination: - type: string - example: destination-name - sharePoint: - type: object - additionalProperties: true - properties: - site: - type: object - additionalProperties: true - properties: - name: - type: string - example: sharepoint-site-name - includePaths: - type: array - items: - type: string - example: ["/testFolder1","testFolder2"] - Pipelines: - properties: - resources: - type: array - items: - $ref: "#/components/schemas/Pipeline" - title: Get Pipelines - count: - type: integer + $ref: "#/components/schemas/MSSharePointConfiguration" + metadata: + $ref: "#/components/schemas/MetaData" + additionalProperties: true + + S3PipelineCreateRequest: type: object required: - - resources - title: Pipelines - Pipeline: - type: object + - type + - configuration properties: - id: - type: string - example: uuid type: type: string - example: MSSharePoint + enum: [S3] configuration: - type: object - properties: - destination: - type: string - example: destination-name - sharePoint: - type: object - properties: - site: - type: object - properties: - id: - type: string - example: sharepoint-site-id - name: - type: string - example: sharepoint-site-name - includePaths: - type: array - items: - type: string - example: ["/testFolder1","testFolder2"] - PipelineStatus: + $ref: "#/components/schemas/CommonConfiguration" + metadata: + $ref: "#/components/schemas/MetaData" + additionalProperties: true + + SFTPPipelineCreateRequest: type: object + required: + - type + - configuration properties: - lastStarted: + type: type: string - format: date-time - example: '2024-02-15T12:45:00.000Z' - PipelineId: + enum: [SFTP] + configuration: + $ref: "#/components/schemas/CommonConfiguration" + metadata: + $ref: "#/components/schemas/MetaData" + additionalProperties: true + + MSSharePointConfiguration: type: object + required: + - destination + - sharePoint properties: - pipelineId: + destination: type: string - example: uuid + example: generic-secret-name + sharePoint: + $ref: "#/components/schemas/SharePointConfig" + additionalProperties: true - Chunk: - properties: - id: - type: string - title: Id - content: - type: string - title: Content - metadata: - type: array - items: - $ref: "#/components/schemas/KeyValueListPair" - title: Metadata - default: [] + SharePointConfig: type: object required: - - id - - content - title: Chunk - DocumentKeyValueListPair: + - site + properties: + site: + $ref: "#/components/schemas/SharePointSite" additionalProperties: true + + SharePointSite: + type: object + required: + - name properties: - key: + name: type: string - maxLength: 1024 - title: Key - value: + example: sharepoint-site-name + includePaths: type: array items: type: string - maxLength: 1024 - title: Value - matchMode: - type: string - title: MatchMode - additionalProperties: true - description: Default match mode for search filters - default: ANY - anyOf: - - enum: - - ANY - - ALL - - {} + example: + - /testFolder1 + - /testFolder2 + additionalProperties: true + + CommonConfiguration: type: object required: - - key - - value - title: DocumentKeyValueListPair - KeyValueListPair: - additionalProperties: true + - destination + properties: + destination: + type: string + example: generic-secret-name + additionalProperties: true + + MetaData: + type: object + required: + - destination + properties: + destination: + type: string + example: destination-name + additionalProperties: true + + getPipelines: + type: object + required: + - resources + properties: + count: + type: integer + resources: + type: array + items: + $ref: "#/components/schemas/getPipeline" + + getPipeline: + oneOf: + - $ref: "#/components/schemas/MSSharePointPipelineGetResponse" + - $ref: "#/components/schemas/S3PipelineGetResponse" + - $ref: "#/components/schemas/SFTPPipelineGetResponse" + discriminator: + propertyName: type + mapping: + MSSharePoint: "#/components/schemas/MSSharePointPipelineGetResponse" + S3: "#/components/schemas/S3PipelineGetResponse" + SFTP: "#/components/schemas/SFTPPipelineGetResponse" + + MSSharePointPipelineGetResponse: + allOf: + - $ref: "#/components/schemas/BasePipelineResponse" + - type: object + required: + - configuration + properties: + type: + type: string + enum: [MSSharePoint] + configuration: + $ref: "#/components/schemas/MSSharePointConfigurationGetResponse" + + S3PipelineGetResponse: + allOf: + - $ref: "#/components/schemas/BasePipelineResponse" + - type: object + required: + - configuration + properties: + type: + type: string + enum: [S3] + configuration: + $ref: "#/components/schemas/CommonConfiguration" + + SFTPPipelineGetResponse: + allOf: + - $ref: "#/components/schemas/BasePipelineResponse" + - type: object + required: + - configuration + properties: + type: + type: string + enum: [SFTP] + configuration: + $ref: "#/components/schemas/CommonConfiguration" + + BasePipelineResponse: + type: object + required: + - id + - type + properties: + id: + type: string + type: + type: string + metadata: + $ref: "#/components/schemas/MetaData" + + MSSharePointConfigurationGetResponse: + type: object + required: + - destination + # - sharePoint # Commented out this required field due to an issue on the document grounding side, where the attribute is sent as 'sharepoint' in the response. This should be uncommented once the issue is resolved on the DG side. + properties: + destination: + type: string + sharePoint: + $ref: "#/components/schemas/SharePointConfigGetResponse" + + SharePointConfigGetResponse: + type: object + required: + - site + properties: + site: + $ref: "#/components/schemas/SharePointSiteGetResponse" + + SharePointSiteGetResponse: + type: object + required: + - name + properties: + id: + type: string + name: + type: string + includePaths: + type: array + items: + type: string + + getPipelineStatus: + type: object + properties: + lastStarted: + type: string + pattern: '^$|^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$' + example: '2024-02-15T12:45:00.000Z' + status: + $ref: '#/components/schemas/PipelineExecutionStatus' + + pipelineId: + type: object + properties: + pipelineId: + type: string + example: uuid + + PipelineExecutionStatus: + type: string + enum: + - NEW + - UNKNOWN + - INPROGRESS + - FINISHED + - FINISHEDWITHERRORS + - TIMEOUT + example: 'INPROGRESS' + + PipelineExecutionData: + type: object + properties: + id: + type: string + example: uuid + status: + $ref: '#/components/schemas/PipelineExecutionStatus' + + getPipelineExecutions: + type: object + properties: + count: + type: integer + example: 2 + resources: + type: array + items: + $ref: '#/components/schemas/PipelineExecutionData' + + getPipelineExecutionById: + type: object + properties: + id: + type: string + example: uuid + createdAt: + type: string + example: '2024-02-15T12:45:00Z' # UTC + modifiedAt: + type: string + example: '2024-02-15T12:45:00Z' # UTC + status: + $ref: '#/components/schemas/PipelineExecutionStatus' + + DocumentStatus: + type: string + enum: + - TO_BE_PROCESSED + - INDEXED + - REINDEXED + - DEINDEXED + - FAILED + - FAILED_TO_BE_RETRIED + example: 'INDEXED' + + DocumentsStatusResponse: + type: object + properties: + count: + type: integer + example: 1 + resources: + type: array + items: + type: object + properties: + id: + type: string + example: uuid + status: + $ref: '#/components/schemas/DocumentStatus' + + PipelineDocumentResponse: + type: object + properties: + id: + type: string + example: uuid + viewLocation: + type: string + example: 'location' + nullable: true + downloadLocation: + type: string + example: 'location' + nullable: true + lastUpdatedTimestamp: + type: string + example: '2024-02-15T12:45:00Z' + status: + $ref: '#/components/schemas/DocumentStatus' + + Chunk: + properties: + id: + type: string + title: Id + content: + type: string + title: Content + metadata: + type: array + items: + $ref: "#/components/schemas/KeyValueListPair" + title: Metadata + default: [] + type: object + required: + - id + - content + title: Chunk + DocumentKeyValueListPair: + properties: + key: + type: string + maxLength: 1024 + title: Key + value: + type: array + items: + type: string + maxLength: 1024 + title: Value + matchMode: + type: string + nullable: true + title: MatchMode + description: Default match mode for search filters + default: ANY + anyOf: + - enum: + - ANY + - ALL + - {} + type: object + required: + - key + - value + title: DocumentKeyValueListPair + HTTPValidationError: + properties: + detail: + type: array + items: + $ref: "#/components/schemas/ValidationError" + title: Detail + type: object + title: HTTPValidationError + KeyValueListPair: properties: key: type: string @@ -867,7 +1409,7 @@ components: - id - title - documents - title: DocumentsChunk + title: Collection PerFilterSearchResult: properties: filterId: @@ -884,9 +1426,9 @@ components: - results title: PerFilterSearchResult SearchConfiguration: - additionalProperties: true properties: maxChunkCount: + nullable: true type: integer minimum: 0 maximum: 0 @@ -894,6 +1436,7 @@ components: title: Maxchunkcount description: Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. maxDocumentCount: + nullable: true type: integer minimum: 0 maximum: 0 @@ -903,7 +1446,6 @@ components: type: object title: SearchConfiguration SearchDocumentKeyValueListPair: - additionalProperties: true properties: key: type: string @@ -939,25 +1481,26 @@ components: required: - results title: SearchResults + CollectionsListResponse: properties: + count: + type: integer resources: items: $ref: '#/components/schemas/Collection' type: array title: Collections - count: - type: integer type: object required: - resources title: CollectionsListResponse description: A response containing collections retrieved from the server. CollectionRequest: - additionalProperties: true properties: title: type: string + nullable: true title: Title embeddingConfig: $ref: '#/components/schemas/EmbeddingConfig' @@ -993,7 +1536,6 @@ components: Location: type: string title: Location - format: uri status: type: string title: Status @@ -1016,7 +1558,6 @@ components: - status title: CollectionDeletedResponse BaseDocument: - additionalProperties: true properties: chunks: items: @@ -1035,7 +1576,6 @@ components: title: BaseDocument description: Base class for documents, document requests and responses. DocumentCreateRequest: - additionalProperties: true properties: documents: items: @@ -1050,7 +1590,6 @@ components: A create request containing one or more new documents to create and store in a collection. Document-Input: - additionalProperties: true properties: chunks: items: @@ -1075,7 +1614,6 @@ components: title: Document description: A single document stored in a collection by ID. DocumentUpdateRequest: - additionalProperties: true properties: documents: items: @@ -1119,24 +1657,23 @@ components: type: object required: - documents - title: DocumentsListResponse + title: Documents description: A response containing documents created or updated, retrieved from the server. Documents: properties: + count: + type: integer resources: items: $ref: '#/components/schemas/DocumentWithoutChunks' type: array title: Documents - count: - type: integer type: object required: - resources title: Documents description: A response containing documents retrieved from the server. TextOnlyBaseChunk: - additionalProperties: true properties: content: type: string @@ -1186,7 +1723,6 @@ components: default: ignoreIfKeyAbsent title: SearchSelectOptionEnum SearchFilter: - additionalProperties: true properties: id: type: string @@ -1236,7 +1772,6 @@ components: - configuration title: SearchFilter TextSearchRequest: - additionalProperties: true properties: query: type: string @@ -1255,7 +1790,6 @@ components: - filters title: TextSearchRequest EmbeddingConfig: - additionalProperties: true properties: modelName: type: string @@ -1268,6 +1802,7 @@ components: properties: title: type: string + nullable: true title: Title embeddingConfig: $ref: '#/components/schemas/EmbeddingConfig' @@ -1291,13 +1826,19 @@ components: - id title: Collection description: A logical grouping of content. - DataRepositoryType: - type: string - anyOf: - - enum: - - vector - - {} - title: DataRepositoryType + DataRepositories: + properties: + count: + type: integer + resources: + type: array + items: + $ref: "#/components/schemas/DataRepository" + title: Datarepositories + type: object + required: + - resources + title: DataRepositories DataRepository: properties: id: @@ -1324,46 +1865,141 @@ components: - type title: DataRepository description: DataRepository schema expected by Retrieval. - DataRepositories: + DataRepositorySearchResult: properties: - resources: + dataRepository: + $ref: "#/components/schemas/DataRepositoryWithDocuments" + type: object + required: + - dataRepository + title: DataRepositorySearchResult + DataRepositoryType: + type: string + anyOf: + - enum: + - vector + - help.sap.com + - {} + title: DataRepositoryType + DataRepositoryWithDocuments: + properties: + id: + type: string + format: uuid + title: Id + description: Unique identifier of this DataRepository. + title: + type: string + title: Title + metadata: type: array items: - $ref: "#/components/schemas/DataRepository" - title: Datarepositories - count: - type: integer + $ref: "#/components/schemas/KeyValueListPair" + title: Metadata + description: Metadata attached to DataRepository. Useful to later limit search to a subset of DataRepositories. + documents: + type: array + items: + $ref: "#/components/schemas/Document" + title: Documents type: object required: - - resources - title: DataRepositories - RetrievalSearchInput: - additionalProperties: true + - id + - title + - documents + title: DataRepositoryWithDocuments + description: DataRepository schema returned by the Vector search endpoint + Document: properties: - query: + id: type: string - minLength: 1 - title: Query - description: Query string - filters: + title: Id + metadata: type: array items: - $ref: "#/components/schemas/RetrievalSearchFilter" - title: Filters + $ref: "#/components/schemas/DocumentKeyValueListPair" + title: Metadata + default: [] + chunks: + type: array + items: + $ref: "#/components/schemas/Chunk" + title: Chunks type: object required: - - query - - filters - title: SearchInput + - id + - chunks + title: Document + DataRepositoryPerFilterSearchResult: + properties: + filterId: + type: string + title: Filterid + results: + type: array + items: + $ref: "#/components/schemas/DataRepositorySearchResult" + title: Results + description: List of returned results. + default: [] + type: object + required: + - filterId + title: PerFilterSearchResult + PerFilterSearchResultError: + properties: + message: + type: string + title: Message + type: object + required: + - message + title: PerFilterSearchResultError + PerFilterSearchResultWithError: + properties: + filterId: + type: string + title: Filterid + error: + $ref: "#/components/schemas/PerFilterSearchResultError" + description: Error message if any. + default: + message: Unknown Error Occurred + type: object + required: + - filterId + title: PerFilterSearchResultWithError + RetrievalSearchConfiguration: + properties: + maxChunkCount: + nullable: true + type: integer + minimum: 0 + exclusiveMinimum: true + title: Maxchunkcount + description: Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. + maxDocumentCount: + nullable: true + type: integer + minimum: 0 + exclusiveMinimum: true + title: Maxdocumentcount + description: "[Only supports 'vector' dataRepositoryType] - Maximum number of documents to be returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount is given, then only one chunk per document is returned." + type: object + title: SearchConfiguration RetrievalSearchFilter: - additionalProperties: true properties: id: type: string title: Id description: Identifier of this SearchFilter - unique per request. searchConfiguration: - $ref: "#/components/schemas/SearchConfiguration" + type: object + nullable: true + $ref: "#/components/schemas/RetrievalSearchConfiguration" + default: {} + minProperties: 0 + maxProperties: 2 dataRepositories: type: array items: @@ -1373,7 +2009,9 @@ components: default: - "*" dataRepositoryType: + type: string $ref: "#/components/schemas/DataRepositoryType" + description: Only include DataRepositories with the given type. dataRepositoryMetadata: type: array items: @@ -1399,104 +2037,58 @@ components: required: - id - dataRepositoryType - title: RetrievalSearchFilter + title: SearchFilter description: Limit scope of search to certain DataRepositories, Documents or Chunks. - RetrievalDocument: + SearchInput: properties: - id: - type: string - title: Id - metadata: - type: array - items: - $ref: "#/components/schemas/DocumentKeyValueListPair" - title: Metadata - default: [] - chunks: - type: array - items: - $ref: "#/components/schemas/Chunk" - title: Chunks - type: object - required: - - id - - chunks - title: RetrievalDocument - DataRepositoryWithDocuments: - properties: - id: - type: string - format: uuid - title: Id - description: Unique identifier of this DataRepository. - title: + query: type: string - title: Title - metadata: - type: array - items: - $ref: "#/components/schemas/KeyValueListPair" - title: Metadata - description: Metadata attached to DataRepository. Useful to later limit search to a subset of DataRepositories. - documents: + minLength: 1 + title: Query + description: Query string + filters: type: array items: - $ref: "#/components/schemas/RetrievalDocument" - title: Documents - type: object - required: - - id - - title - - documents - title: DataRepositoryWithDocuments - description: DataRepository schema returned by the Vector search endpoint - RetievalDataRepositorySearchResult: - properties: - dataRepository: - $ref: "#/components/schemas/DataRepositoryWithDocuments" + $ref: "#/components/schemas/RetrievalSearchFilter" + title: Filters type: object required: - - dataRepository - title: DataRepositorySearchResult - RetievalPerFilterSearchResult: + - query + - filters + title: SearchInput + DataRepositorySearchResults: properties: - filterId: - type: string - title: Filterid results: type: array items: - $ref: "#/components/schemas/RetievalDataRepositorySearchResult" + anyOf: + - $ref: "#/components/schemas/DataRepositoryPerFilterSearchResult" + - $ref: "#/components/schemas/PerFilterSearchResultWithError" title: Results description: List of returned results. - default: [] type: object required: - - filterId - title: PerFilterSearchResult - RetievalPerFilterSearchResultWithError: - properties: - message: - type: string - title: Message - type: object - required: - - message - title: PerFilterSearchResultError - RetievalSearchResults: + - results + title: SearchResults + ValidationError: properties: - results: + loc: type: array items: - anyOf: - - $ref: "#/components/schemas/RetievalPerFilterSearchResult" - - $ref: "#/components/schemas/RetievalPerFilterSearchResultWithError" - title: Results - description: List of returned results. + type: string + title: Location + msg: + type: string + title: Message + type: + type: string + title: Error Type type: object required: - - results - title: SearchResults + - loc + - msg + - type + title: ValidationError ### ### ######################## ### ### ### ### ### Error ### ### ### From 9067dca887d5efb5173fd928008f280d9f7d0132 Mon Sep 17 00:00:00 2001 From: I538344 Date: Mon, 7 Jul 2025 12:56:38 +0200 Subject: [PATCH 02/10] temp fix --- .../ai/sdk/grounding/GroundingClientTest.java | 8 +++--- .../app/controllers/GroundingController.java | 26 ++++++++++--------- .../ai/sdk/app/controllers/GroundingTest.java | 17 ++++++------ 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/core-services/document-grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java b/core-services/document-grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java index 9447cc5b3..4c7b120d9 100644 --- a/core-services/document-grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java +++ b/core-services/document-grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java @@ -14,8 +14,8 @@ import com.sap.ai.sdk.grounding.model.DocumentKeyValueListPair; import com.sap.ai.sdk.grounding.model.DocumentResponse; import com.sap.ai.sdk.grounding.model.Documents; +import com.sap.ai.sdk.grounding.model.GetPipelines; import com.sap.ai.sdk.grounding.model.KeyValueListPair; -import com.sap.ai.sdk.grounding.model.Pipelines; import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination; import java.util.UUID; @@ -35,7 +35,7 @@ public class GroundingClientTest { void testPipelines() { final PipelinesApi api = new GroundingClient(SERVICE).pipelines(); - final Pipelines allPipelines = api.getAllPipelines("reosurceGroup"); + final GetPipelines allPipelines = api.getAllPipelines("reosurceGroup"); assertThat(allPipelines).isNotNull(); assertThat(allPipelines.getResources()).isEmpty(); } @@ -61,7 +61,7 @@ void testVector() { }); final UUID collectionId = collections.getResources().get(0).getId(); - final Documents documents = api.getAllDocuments("reosurceGroup", collectionId); + final Documents documents = api.getDocumentsByCollectionId("reosurceGroup", collectionId); assertThat(documents).isNotNull(); final DocumentKeyValueListPair documentMeta = DocumentKeyValueListPair.create() @@ -80,7 +80,7 @@ void testVector() { final UUID documentId = documents.getResources().get(0).getId(); final DocumentResponse document = - api.getDocumentById("reosurceGroup", collectionId, documentId); + api.getDocumentByIdForCollection("reosurceGroup", collectionId, documentId); assertThat(document).isNotNull(); assertThat(document.getId()).isEqualTo(documentId); assertThat(document.getMetadata()).isNotNull().containsExactly(documentMeta); diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java index 7d914ca06..86580b9a1 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java @@ -20,10 +20,9 @@ import com.sap.ai.sdk.grounding.model.DocumentWithoutChunks; import com.sap.ai.sdk.grounding.model.EmbeddingConfig; import com.sap.ai.sdk.grounding.model.KeyValueListPair; -import com.sap.ai.sdk.grounding.model.Pipeline; +import com.sap.ai.sdk.grounding.model.RetrievalSearchConfiguration; import com.sap.ai.sdk.grounding.model.RetrievalSearchFilter; -import com.sap.ai.sdk.grounding.model.RetrievalSearchInput; -import com.sap.ai.sdk.grounding.model.SearchConfiguration; +import com.sap.ai.sdk.grounding.model.SearchInput; import com.sap.ai.sdk.grounding.model.TextOnlyBaseChunk; import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse; import java.time.format.TextStyle; @@ -64,7 +63,8 @@ Object getAllPipelines( if ("json".equals(format)) { return pipelines; } - final var ids = pipelines.getResources().stream().map(Pipeline::getId).collect(joining(", ")); + final var ids = List.of(); + // pipelines.getResources().stream().map(getPipeline::getId).collect(joining(", ")); return "Found pipelines with ids: " + ids; } @@ -92,8 +92,8 @@ Object searchInDocuments( .id("question") .dataRepositoryType(DataRepositoryType.VECTOR) .dataRepositories(List.of("*")) - .searchConfiguration(SearchConfiguration.create().maxChunkCount(10)); - final var q = RetrievalSearchInput.create().query("When was the last upload?").filters(filter); + .searchConfiguration(RetrievalSearchConfiguration.create().maxChunkCount(10)); + final var q = SearchInput.create().query("When was the last upload?").filters(filter); final var results = CLIENT_RETRIEVAL.search(RESOURCE_GROUP, q); if ("json".equals(format)) { @@ -102,7 +102,7 @@ Object searchInDocuments( final var messages = results.getResults().stream() .flatMap(resultsInner1 -> resultsInner1.getResults().stream()) - .flatMap(result -> result.getDataRepository().getDocuments().stream()) + .flatMap(result -> result.getDocuments().stream()) .flatMap(dataRepositorySearchResult -> dataRepositorySearchResult.getChunks().stream()) .map(Chunk::getContent) .toList(); @@ -127,7 +127,7 @@ Object getAllCollections( Object getDocumentsByCollectionId( @Nonnull @PathVariable("id") final UUID collectionId, @Nullable @RequestParam(value = "format", required = false) final String format) { - final var documents = CLIENT_VECTOR.getAllDocuments(RESOURCE_GROUP, collectionId); + final var documents = CLIENT_VECTOR.getDocumentsByCollectionId(RESOURCE_GROUP, collectionId); if ("json".equals(format)) { return documents; } @@ -162,7 +162,8 @@ Object createDocument( final var docMeta = DocumentKeyValueListPair.create().key("purpose").value("testing"); final var doc = BaseDocument.create().chunks(chunk).metadata(docMeta); final var request = DocumentCreateRequest.create().documents(doc); - final var response = CLIENT_VECTOR.createDocuments(RESOURCE_GROUP, collectionId, request); + final var response = + CLIENT_VECTOR.createCollectionDocuments(RESOURCE_GROUP, collectionId, request); if ("json".equals(format)) { return response; @@ -184,12 +185,12 @@ Object deleteCollection( final var doc = BaseDocument.create().chunks(chunk).metadata(docMeta); final var request = DocumentCreateRequest.create().documents(doc); - final var documents = CLIENT_VECTOR.getAllDocuments(RESOURCE_GROUP, collectionId); + final var documents = CLIENT_VECTOR.getDocumentsByCollectionId(RESOURCE_GROUP, collectionId); final var ids = documents.getResources().stream().map(DocumentWithoutChunks::getId).toList(); log.info("Deleting collection {} with {} documents: {}", collectionId, ids.size(), ids); for (final var documentId : ids) { - final var del = CLIENT_VECTOR.deleteDocumentById(RESOURCE_GROUP, collectionId, documentId); + final var del = CLIENT_VECTOR.deleteCollectionById(RESOURCE_GROUP, collectionId, documentId); if (del.getStatusCode() >= 400) { final var msg = "Document {} could not be deleted, status code [{}], headers: {}"; log.error(msg, documentId, del.getStatusCode(), del.getHeaders()); @@ -209,7 +210,8 @@ Object getDocumentChunksById( @Nonnull @PathVariable("collectionId") final UUID collectionId, @Nonnull @PathVariable("documentId") final UUID documentId, @Nullable @RequestParam(value = "format", required = false) final String format) { - final var document = CLIENT_VECTOR.getDocumentById(RESOURCE_GROUP, collectionId, documentId); + final var document = + CLIENT_VECTOR.getDocumentByIdForCollection(RESOURCE_GROUP, collectionId, documentId); if ("json".equals(format)) { return document; } diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java index 493366ca9..89e02259f 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java @@ -6,11 +6,12 @@ import com.sap.ai.sdk.grounding.model.CollectionsListResponse; import com.sap.ai.sdk.grounding.model.DataRepositories; +import com.sap.ai.sdk.grounding.model.DataRepositorySearchResults; import com.sap.ai.sdk.grounding.model.DocumentResponse; import com.sap.ai.sdk.grounding.model.Documents; import com.sap.ai.sdk.grounding.model.DocumentsListResponse; -import com.sap.ai.sdk.grounding.model.Pipelines; -import com.sap.ai.sdk.grounding.model.RetievalSearchResults; +import com.sap.ai.sdk.grounding.model.GetPipelines; +import com.sap.ai.sdk.grounding.model.SearchResults; import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse; import java.time.format.TextStyle; import java.util.Locale; @@ -29,9 +30,9 @@ void testPipelinesGetAll() { final var controller = new GroundingController(); final var result = controller.getAllPipelines(JSON_FORMAT); - assertThat(result).isInstanceOf(Pipelines.class); - final var pipelinesList = ((Pipelines) result).getResources(); - final var pipelinesCount = ((Pipelines) result).getCount(); + assertThat(result).isInstanceOf(GetPipelines.class); + final var pipelinesList = ((GetPipelines) result).getResources(); + final var pipelinesCount = ((GetPipelines) result).getCount(); // we don't have testable data yet, but the endpoint works without errors assertThat(pipelinesCount).isEqualTo(0); @@ -87,9 +88,9 @@ void testCreateDeleteCollection() { // (4) SEARCH FOR DOCUMENTS Object search = controller.searchInDocuments(JSON_FORMAT); - assertThat(search).isInstanceOf(RetievalSearchResults.class); + assertThat(search).isInstanceOf(SearchResults.class); final var dayOfWeek = now().getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.ENGLISH); - this.assertDocumentSearchResult((RetievalSearchResults) search, dayOfWeek); + this.assertDocumentSearchResult((DataRepositorySearchResults) search, dayOfWeek); // (5) CLEAN UP Object deletion = controller.deleteCollection(collectionUuid, JSON_FORMAT); @@ -101,7 +102,7 @@ void testCreateDeleteCollection() { .hasMessageContaining("404 Not Found"); } - private void assertDocumentSearchResult(RetievalSearchResults search, String dayOfWeek) { + private void assertDocumentSearchResult(DataRepositorySearchResults search, String dayOfWeek) { assertThat(search.getResults()).isNotEmpty(); for (final var resultsByFilter : search.getResults()) { assertThat(resultsByFilter.getFilterId()).isEqualTo("question"); From 1bf1bce759429c163cacb10e2e0d120b5f139e98 Mon Sep 17 00:00:00 2001 From: I538344 Date: Wed, 9 Jul 2025 16:04:12 +0200 Subject: [PATCH 03/10] fixed --- .../ai/sdk/grounding/client/PipelinesApi.java | 12 +- .../ai/sdk/grounding/client/RetrievalApi.java | 15 +- .../ai/sdk/grounding/client/VectorApi.java | 48 ++-- .../model/RetrievalSearchConfiguration.java | 224 ------------------ .../model/RetrievalSearchFilter.java | 9 +- ...chInput.java => RetrievalSearchInput.java} | 89 +++---- .../src/main/resources/spec/grounding.yaml | 160 ++++++------- .../app/controllers/GroundingController.java | 20 +- 8 files changed, 167 insertions(+), 410 deletions(-) delete mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchConfiguration.java rename core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/{SearchInput.java => RetrievalSearchInput.java} (63%) diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/PipelinesApi.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/PipelinesApi.java index 54eb6a9af..54377a57a 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/PipelinesApi.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/PipelinesApi.java @@ -300,7 +300,7 @@ public GetPipelines getAllPipelines(@Nonnull final String aiResourceGroup) * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public GetPipeline getPipelineDetailsById( + public GetPipeline getPipelineById( @Nonnull final String aiResourceGroup, @Nonnull final String pipelineId) throws OpenApiRequestException { final Object localVarPostBody = null; @@ -308,13 +308,13 @@ public GetPipeline getPipelineDetailsById( // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getPipelineDetailsById"); + "Missing the required parameter 'aiResourceGroup' when calling getPipelineById"); } // verify the required parameter 'pipelineId' is set if (pipelineId == null) { throw new OpenApiRequestException( - "Missing the required parameter 'pipelineId' when calling getPipelineDetailsById"); + "Missing the required parameter 'pipelineId' when calling getPipelineById"); } // create path and map variables @@ -947,7 +947,7 @@ public GetPipelineExecutions getAllExecutionsForPipeline( * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public GetPipelineStatus getPipelineStatusById( + public GetPipelineStatus getPipelineStatus( @Nonnull final String aiResourceGroup, @Nonnull final String pipelineId) throws OpenApiRequestException { final Object localVarPostBody = null; @@ -955,13 +955,13 @@ public GetPipelineStatus getPipelineStatusById( // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getPipelineStatusById"); + "Missing the required parameter 'aiResourceGroup' when calling getPipelineStatus"); } // verify the required parameter 'pipelineId' is set if (pipelineId == null) { throw new OpenApiRequestException( - "Missing the required parameter 'pipelineId' when calling getPipelineStatusById"); + "Missing the required parameter 'pipelineId' when calling getPipelineStatus"); } // create path and map variables diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/RetrievalApi.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/RetrievalApi.java index 27a9795c1..67da074b8 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/RetrievalApi.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/RetrievalApi.java @@ -3,7 +3,7 @@ import com.google.common.annotations.Beta; import com.sap.ai.sdk.grounding.model.DataRepositories; import com.sap.ai.sdk.grounding.model.DataRepository; -import com.sap.ai.sdk.grounding.model.SearchInput; +import com.sap.ai.sdk.grounding.model.RetrievalSearchInput; import com.sap.ai.sdk.grounding.model.SearchResults; import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; @@ -231,15 +231,16 @@ public DataRepository getDataRepositoryById( *

422 - There are validation issues with the data. * * @param aiResourceGroup Resource Group ID - * @param searchInput The value for the parameter searchInput + * @param retrievalSearchInput The value for the parameter retrievalSearchInput * @return SearchResults * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull public SearchResults search( - @Nonnull final String aiResourceGroup, @Nonnull final SearchInput searchInput) + @Nonnull final String aiResourceGroup, + @Nonnull final RetrievalSearchInput retrievalSearchInput) throws OpenApiRequestException { - final Object localVarPostBody = searchInput; + final Object localVarPostBody = retrievalSearchInput; // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { @@ -247,10 +248,10 @@ public SearchResults search( "Missing the required parameter 'aiResourceGroup' when calling search"); } - // verify the required parameter 'searchInput' is set - if (searchInput == null) { + // verify the required parameter 'retrievalSearchInput' is set + if (retrievalSearchInput == null) { throw new OpenApiRequestException( - "Missing the required parameter 'searchInput' when calling retrievalV1RetrievalEndpointsSearch"); + "Missing the required parameter 'retrievalSearchInput' when calling retrievalV1RetrievalEndpointsSearch"); } final String localVarPath = diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/VectorApi.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/VectorApi.java index 1366c6078..085d949c7 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/VectorApi.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/VectorApi.java @@ -153,7 +153,7 @@ public OpenApiResponse createCollection( * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public DocumentsListResponse createCollectionDocuments( + public DocumentsListResponse createDocuments( @Nonnull final String aiResourceGroup, @Nonnull final UUID collectionId, @Nonnull final DocumentCreateRequest documentCreateRequest) @@ -163,13 +163,13 @@ public DocumentsListResponse createCollectionDocuments( // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling createCollectionDocuments"); + "Missing the required parameter 'aiResourceGroup' when calling createDocuments"); } // verify the required parameter 'collectionId' is set if (collectionId == null) { throw new OpenApiRequestException( - "Missing the required parameter 'collectionId' when calling createCollectionDocuments"); + "Missing the required parameter 'collectionId' when calling createDocuments"); } // verify the required parameter 'documentCreateRequest' is set @@ -314,7 +314,7 @@ public OpenApiResponse deleteCollectionById( * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public OpenApiResponse deleteCollectionById( + public OpenApiResponse deleteDocumentById( @Nonnull final String aiResourceGroup, @Nonnull final UUID collectionId, @Nonnull final UUID documentId) @@ -324,19 +324,19 @@ public OpenApiResponse deleteCollectionById( // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling deleteCollectionById"); + "Missing the required parameter 'aiResourceGroup' when calling deleteDocumentById"); } // verify the required parameter 'collectionId' is set if (collectionId == null) { throw new OpenApiRequestException( - "Missing the required parameter 'collectionId' when calling deleteCollectionById"); + "Missing the required parameter 'collectionId' when calling deleteDocumentById"); } // verify the required parameter 'documentId' is set if (documentId == null) { throw new OpenApiRequestException( - "Missing the required parameter 'documentId' when calling deleteCollectionById"); + "Missing the required parameter 'documentId' when calling deleteDocumentById"); } // create path and map variables @@ -496,7 +496,7 @@ public CollectionsListResponse getAllCollections(@Nonnull final String aiResourc * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public Documents getDocumentsByCollectionId( + public Documents getAllDocuments( @Nonnull final String aiResourceGroup, @Nonnull final UUID collectionId, @Nullable final Integer $top, @@ -508,13 +508,13 @@ public Documents getDocumentsByCollectionId( // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getDocumentsByCollectionId"); + "Missing the required parameter 'aiResourceGroup' when calling getAllDocuments"); } // verify the required parameter 'collectionId' is set if (collectionId == null) { throw new OpenApiRequestException( - "Missing the required parameter 'collectionId' when calling getDocumentsByCollectionId"); + "Missing the required parameter 'collectionId' when calling getAllDocuments"); } // create path and map variables @@ -579,10 +579,10 @@ public Documents getDocumentsByCollectionId( * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public Documents getDocumentsByCollectionId( + public Documents getAllDocuments( @Nonnull final String aiResourceGroup, @Nonnull final UUID collectionId) throws OpenApiRequestException { - return getDocumentsByCollectionId(aiResourceGroup, collectionId, null, null, null); + return getAllDocuments(aiResourceGroup, collectionId, null, null, null); } /** @@ -679,7 +679,7 @@ public Collection getCollectionById( * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public VectorV1VectorEndpointsGetCollectionCreationStatus200Response getCollectionStatus( + public VectorV1VectorEndpointsGetCollectionCreationStatus200Response getCollectionCreationStatus( @Nonnull final String aiResourceGroup, @Nonnull final UUID id) throws OpenApiRequestException { final Object localVarPostBody = null; @@ -687,13 +687,13 @@ public VectorV1VectorEndpointsGetCollectionCreationStatus200Response getCollecti // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getCollectionStatus"); + "Missing the required parameter 'aiResourceGroup' when calling getCollectionCreationStatus"); } // verify the required parameter 'id' is set if (id == null) { throw new OpenApiRequestException( - "Missing the required parameter 'id' when calling getCollectionStatus"); + "Missing the required parameter 'id' when calling getCollectionCreationStatus"); } // create path and map variables @@ -834,7 +834,7 @@ public VectorV1VectorEndpointsGetCollectionDeletionStatus200Response getCollecti * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public DocumentResponse getDocumentByIdForCollection( + public DocumentResponse getDocumentById( @Nonnull final String aiResourceGroup, @Nonnull final UUID collectionId, @Nonnull final UUID documentId) @@ -844,19 +844,19 @@ public DocumentResponse getDocumentByIdForCollection( // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling getDocumentByIdForCollection"); + "Missing the required parameter 'aiResourceGroup' when calling getDocumentById"); } // verify the required parameter 'collectionId' is set if (collectionId == null) { throw new OpenApiRequestException( - "Missing the required parameter 'collectionId' when calling getDocumentByIdForCollection"); + "Missing the required parameter 'collectionId' when calling getDocumentById"); } // verify the required parameter 'documentId' is set if (documentId == null) { throw new OpenApiRequestException( - "Missing the required parameter 'documentId' when calling getDocumentByIdForCollection"); + "Missing the required parameter 'documentId' when calling getDocumentById"); } // create path and map variables @@ -918,7 +918,7 @@ public DocumentResponse getDocumentByIdForCollection( * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public SearchResults vectorSearchByChunk( + public SearchResults search( @Nonnull final String aiResourceGroup, @Nonnull final TextSearchRequest textSearchRequest) throws OpenApiRequestException { final Object localVarPostBody = textSearchRequest; @@ -926,7 +926,7 @@ public SearchResults vectorSearchByChunk( // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling vectorSearchByChunk"); + "Missing the required parameter 'aiResourceGroup' when calling search"); } // verify the required parameter 'textSearchRequest' is set @@ -989,7 +989,7 @@ public SearchResults vectorSearchByChunk( * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public DocumentsListResponse insertOrUpdateDocumentsInCollection( + public DocumentsListResponse updateDocuments( @Nonnull final String aiResourceGroup, @Nonnull final UUID collectionId, @Nonnull final DocumentUpdateRequest documentUpdateRequest) @@ -999,13 +999,13 @@ public DocumentsListResponse insertOrUpdateDocumentsInCollection( // verify the required parameter 'aiResourceGroup' is set if (aiResourceGroup == null) { throw new OpenApiRequestException( - "Missing the required parameter 'aiResourceGroup' when calling insertOrUpdateDocumentsInCollection"); + "Missing the required parameter 'aiResourceGroup' when calling updateDocuments"); } // verify the required parameter 'collectionId' is set if (collectionId == null) { throw new OpenApiRequestException( - "Missing the required parameter 'collectionId' when calling insertOrUpdateDocumentsInCollection"); + "Missing the required parameter 'collectionId' when calling updateDocuments"); } // verify the required parameter 'documentUpdateRequest' is set diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchConfiguration.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchConfiguration.java deleted file mode 100644 index 9c7658971..000000000 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchConfiguration.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Grounding - * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.grounding.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** RetrievalSearchConfiguration */ -// CHECKSTYLE:OFF -public class RetrievalSearchConfiguration -// CHECKSTYLE:ON -{ - @JsonProperty("maxChunkCount") - private Integer maxChunkCount; - - @JsonProperty("maxDocumentCount") - private Integer maxDocumentCount; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for RetrievalSearchConfiguration. */ - protected RetrievalSearchConfiguration() {} - - /** - * Set the maxChunkCount of this {@link RetrievalSearchConfiguration} instance and return the same - * instance. - * - * @param maxChunkCount Maximum number of chunks to be returned. Cannot be used with - * 'maxDocumentCount'. Minimum: 0 - * @return The same instance of this {@link RetrievalSearchConfiguration} class - */ - @Nonnull - public RetrievalSearchConfiguration maxChunkCount(@Nullable final Integer maxChunkCount) { - this.maxChunkCount = maxChunkCount; - return this; - } - - /** - * Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. - * minimum: 0 - * - * @return maxChunkCount The maxChunkCount of this {@link RetrievalSearchConfiguration} instance. - */ - @Nullable - public Integer getMaxChunkCount() { - return maxChunkCount; - } - - /** - * Set the maxChunkCount of this {@link RetrievalSearchConfiguration} instance. - * - * @param maxChunkCount Maximum number of chunks to be returned. Cannot be used with - * 'maxDocumentCount'. Minimum: 0 - */ - public void setMaxChunkCount(@Nullable final Integer maxChunkCount) { - this.maxChunkCount = maxChunkCount; - } - - /** - * Set the maxDocumentCount of this {@link RetrievalSearchConfiguration} instance and return the - * same instance. - * - * @param maxDocumentCount [Only supports 'vector' dataRepositoryType] - Maximum number of - * documents to be returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount - * is given, then only one chunk per document is returned. Minimum: 0 - * @return The same instance of this {@link RetrievalSearchConfiguration} class - */ - @Nonnull - public RetrievalSearchConfiguration maxDocumentCount(@Nullable final Integer maxDocumentCount) { - this.maxDocumentCount = maxDocumentCount; - return this; - } - - /** - * [Only supports 'vector' dataRepositoryType] - Maximum number of documents to be - * returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount is given, then only - * one chunk per document is returned. minimum: 0 - * - * @return maxDocumentCount The maxDocumentCount of this {@link RetrievalSearchConfiguration} - * instance. - */ - @Nullable - public Integer getMaxDocumentCount() { - return maxDocumentCount; - } - - /** - * Set the maxDocumentCount of this {@link RetrievalSearchConfiguration} instance. - * - * @param maxDocumentCount [Only supports 'vector' dataRepositoryType] - Maximum number of - * documents to be returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount - * is given, then only one chunk per document is returned. Minimum: 0 - */ - public void setMaxDocumentCount(@Nullable final Integer maxDocumentCount) { - this.maxDocumentCount = maxDocumentCount; - } - - /** - * Get the names of the unrecognizable properties of the {@link RetrievalSearchConfiguration}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link RetrievalSearchConfiguration} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "RetrievalSearchConfiguration has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link RetrievalSearchConfiguration} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (maxChunkCount != null) declaredFields.put("maxChunkCount", maxChunkCount); - if (maxDocumentCount != null) declaredFields.put("maxDocumentCount", maxDocumentCount); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link RetrievalSearchConfiguration} instance. If the - * map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final RetrievalSearchConfiguration retrievalSearchConfiguration = - (RetrievalSearchConfiguration) o; - return Objects.equals( - this.cloudSdkCustomFields, retrievalSearchConfiguration.cloudSdkCustomFields) - && Objects.equals(this.maxChunkCount, retrievalSearchConfiguration.maxChunkCount) - && Objects.equals(this.maxDocumentCount, retrievalSearchConfiguration.maxDocumentCount); - } - - @Override - public int hashCode() { - return Objects.hash(maxChunkCount, maxDocumentCount, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class RetrievalSearchConfiguration {\n"); - sb.append(" maxChunkCount: ").append(toIndentedString(maxChunkCount)).append("\n"); - sb.append(" maxDocumentCount: ").append(toIndentedString(maxDocumentCount)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link RetrievalSearchConfiguration} instance. No arguments are required. */ - public static RetrievalSearchConfiguration create() { - return new RetrievalSearchConfiguration(); - } -} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java index bae53516f..a823f8258 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchFilter.java @@ -35,7 +35,7 @@ public class RetrievalSearchFilter private String id; @JsonProperty("searchConfiguration") - private RetrievalSearchConfiguration searchConfiguration; + private SearchConfiguration searchConfiguration; @JsonProperty("dataRepositories") private List dataRepositories = new ArrayList<>(Arrays.asList("*")); @@ -98,7 +98,7 @@ public void setId(@Nonnull final String id) { */ @Nonnull public RetrievalSearchFilter searchConfiguration( - @Nullable final RetrievalSearchConfiguration searchConfiguration) { + @Nullable final SearchConfiguration searchConfiguration) { this.searchConfiguration = searchConfiguration; return this; } @@ -110,7 +110,7 @@ public RetrievalSearchFilter searchConfiguration( * instance. */ @Nonnull - public RetrievalSearchConfiguration getSearchConfiguration() { + public SearchConfiguration getSearchConfiguration() { return searchConfiguration; } @@ -119,8 +119,7 @@ public RetrievalSearchConfiguration getSearchConfiguration() { * * @param searchConfiguration The searchConfiguration of this {@link RetrievalSearchFilter} */ - public void setSearchConfiguration( - @Nullable final RetrievalSearchConfiguration searchConfiguration) { + public void setSearchConfiguration(@Nullable final SearchConfiguration searchConfiguration) { this.searchConfiguration = searchConfiguration; } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchInput.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java similarity index 63% rename from core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchInput.java rename to core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java index 39a08b731..018ba627f 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SearchInput.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchInput.java @@ -26,9 +26,9 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -/** SearchInput */ +/** RetrievalSearchInput */ // CHECKSTYLE:OFF -public class SearchInput +public class RetrievalSearchInput // CHECKSTYLE:ON { @JsonProperty("query") @@ -40,17 +40,17 @@ public class SearchInput @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for SearchInput. */ - protected SearchInput() {} + /** Default constructor for RetrievalSearchInput. */ + protected RetrievalSearchInput() {} /** - * Set the query of this {@link SearchInput} instance and return the same instance. + * Set the query of this {@link RetrievalSearchInput} instance and return the same instance. * * @param query Query string - * @return The same instance of this {@link SearchInput} class + * @return The same instance of this {@link RetrievalSearchInput} class */ @Nonnull - public SearchInput query(@Nonnull final String query) { + public RetrievalSearchInput query(@Nonnull final String query) { this.query = query; return this; } @@ -58,7 +58,7 @@ public SearchInput query(@Nonnull final String query) { /** * Query string * - * @return query The query of this {@link SearchInput} instance. + * @return query The query of this {@link RetrievalSearchInput} instance. */ @Nonnull public String getQuery() { @@ -66,7 +66,7 @@ public String getQuery() { } /** - * Set the query of this {@link SearchInput} instance. + * Set the query of this {@link RetrievalSearchInput} instance. * * @param query Query string */ @@ -75,25 +75,25 @@ public void setQuery(@Nonnull final String query) { } /** - * Set the filters of this {@link SearchInput} instance and return the same instance. + * Set the filters of this {@link RetrievalSearchInput} instance and return the same instance. * - * @param filters The filters of this {@link SearchInput} - * @return The same instance of this {@link SearchInput} class + * @param filters The filters of this {@link RetrievalSearchInput} + * @return The same instance of this {@link RetrievalSearchInput} class */ @Nonnull - public SearchInput filters(@Nonnull final List filters) { + public RetrievalSearchInput filters(@Nonnull final List filters) { this.filters = filters; return this; } /** - * Add one filters instance to this {@link SearchInput}. + * Add one filters instance to this {@link RetrievalSearchInput}. * * @param filtersItem The filters that should be added - * @return The same instance of type {@link SearchInput} + * @return The same instance of type {@link RetrievalSearchInput} */ @Nonnull - public SearchInput addFiltersItem(@Nonnull final RetrievalSearchFilter filtersItem) { + public RetrievalSearchInput addFiltersItem(@Nonnull final RetrievalSearchFilter filtersItem) { if (this.filters == null) { this.filters = new ArrayList<>(); } @@ -104,7 +104,7 @@ public SearchInput addFiltersItem(@Nonnull final RetrievalSearchFilter filtersIt /** * Get filters * - * @return filters The filters of this {@link SearchInput} instance. + * @return filters The filters of this {@link RetrievalSearchInput} instance. */ @Nonnull public List getFilters() { @@ -112,16 +112,16 @@ public List getFilters() { } /** - * Set the filters of this {@link SearchInput} instance. + * Set the filters of this {@link RetrievalSearchInput} instance. * - * @param filters The filters of this {@link SearchInput} + * @param filters The filters of this {@link RetrievalSearchInput} */ public void setFilters(@Nonnull final List filters) { this.filters = filters; } /** - * Get the names of the unrecognizable properties of the {@link SearchInput}. + * Get the names of the unrecognizable properties of the {@link RetrievalSearchInput}. * * @return The set of properties names */ @@ -132,7 +132,7 @@ public Set getCustomFieldNames() { } /** - * Get the value of an unrecognizable property of this {@link SearchInput} instance. + * Get the value of an unrecognizable property of this {@link RetrievalSearchInput} instance. * * @deprecated Use {@link #toMap()} instead. * @param name The name of the property @@ -143,14 +143,15 @@ public Set getCustomFieldNames() { @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("SearchInput has no field with name '" + name + "'."); + throw new NoSuchElementException( + "RetrievalSearchInput has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link SearchInput} instance including unrecognized - * properties. + * Get the value of all properties of this {@link RetrievalSearchInput} instance including + * unrecognized properties. * * @return The map of all properties */ @@ -164,8 +165,8 @@ public Map toMap() { } /** - * Set an unrecognizable property of this {@link SearchInput} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. + * Set an unrecognizable property of this {@link RetrievalSearchInput} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. * * @param customFieldName The name of the property * @param customFieldValue The value of the property @@ -183,10 +184,10 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final SearchInput searchInput = (SearchInput) o; - return Objects.equals(this.cloudSdkCustomFields, searchInput.cloudSdkCustomFields) - && Objects.equals(this.query, searchInput.query) - && Objects.equals(this.filters, searchInput.filters); + final RetrievalSearchInput retrievalSearchInput = (RetrievalSearchInput) o; + return Objects.equals(this.cloudSdkCustomFields, retrievalSearchInput.cloudSdkCustomFields) + && Objects.equals(this.query, retrievalSearchInput.query) + && Objects.equals(this.filters, retrievalSearchInput.filters); } @Override @@ -198,7 +199,7 @@ public int hashCode() { @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class SearchInput {\n"); + sb.append("class RetrievalSearchInput {\n"); sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); cloudSdkCustomFields.forEach( @@ -219,20 +220,20 @@ private String toIndentedString(final java.lang.Object o) { } /** - * Create a type-safe, fluent-api builder object to construct a new {@link SearchInput} instance - * with all required arguments. + * Create a type-safe, fluent-api builder object to construct a new {@link RetrievalSearchInput} + * instance with all required arguments. */ public static Builder create() { - return (query) -> (filters) -> new SearchInput().query(query).filters(filters); + return (query) -> (filters) -> new RetrievalSearchInput().query(query).filters(filters); } /** Builder helper class. */ public interface Builder { /** - * Set the query of this {@link SearchInput} instance. + * Set the query of this {@link RetrievalSearchInput} instance. * * @param query Query string - * @return The SearchInput builder. + * @return The RetrievalSearchInput builder. */ Builder1 query(@Nonnull final String query); } @@ -240,20 +241,20 @@ public interface Builder { /** Builder helper class. */ public interface Builder1 { /** - * Set the filters of this {@link SearchInput} instance. + * Set the filters of this {@link RetrievalSearchInput} instance. * - * @param filters The filters of this {@link SearchInput} - * @return The SearchInput instance. + * @param filters The filters of this {@link RetrievalSearchInput} + * @return The RetrievalSearchInput instance. */ - SearchInput filters(@Nonnull final List filters); + RetrievalSearchInput filters(@Nonnull final List filters); /** - * Set the filters of this {@link SearchInput} instance. + * Set the filters of this {@link RetrievalSearchInput} instance. * - * @param filters The filters of this {@link SearchInput} - * @return The SearchInput instance. + * @param filters The filters of this {@link RetrievalSearchInput} + * @return The RetrievalSearchInput instance. */ - default SearchInput filters(@Nonnull final RetrievalSearchFilter... filters) { + default RetrievalSearchInput filters(@Nonnull final RetrievalSearchFilter... filters) { return filters(Arrays.asList(filters)); } } diff --git a/core-services/document-grounding/src/main/resources/spec/grounding.yaml b/core-services/document-grounding/src/main/resources/spec/grounding.yaml index d88cb2454..0378df1a1 100644 --- a/core-services/document-grounding/src/main/resources/spec/grounding.yaml +++ b/core-services/document-grounding/src/main/resources/spec/grounding.yaml @@ -22,19 +22,19 @@ servers: variables: region: enum: - - prod.eu-central-1.aws - - prodeuonly.eu-central-1.aws - - prod.us-east-1.aws - - prod.ap-northeast-1.aws - - prod.ap-southeast-2.aws - - prod-eu20.westeurope.azure - - prod-eu30.europe-west3.gcp - - prod-us21.eastus.azure - - prod-us30.us-central1.gcp - - prod-ap20.australiaeast.az - - prod-ap11.ap-southeast-1.aws + - prod.eu-central-1.aws + - prodeuonly.eu-central-1.aws + - prod.us-east-1.aws + - prod.ap-northeast-1.aws + - prod.ap-southeast-2.aws + - prod-eu20.westeurope.azure + - prod-eu30.europe-west3.gcp + - prod-us21.eastus.azure + - prod-us30.us-central1.gcp + - prod-ap20.australiaeast.az + - prod-ap11.ap-southeast-1.aws default: prod.eu-central-1.aws - service: + service: default: document-grounding paths: "/pipelines": @@ -100,7 +100,7 @@ paths: operationId: pipeline.v1.pipeline_endpoints.get_pipeline_by_id summary: Get details of a Pipeline description: 'Get details of a pipeline by pipeline id' - x-sap-cloud-sdk-operation-name: getPipelineDetailsById + x-sap-cloud-sdk-operation-name: getPipelineById parameters: - in: header name: AI-Resource-Group @@ -155,7 +155,7 @@ paths: operationId: pipeline.v1.pipeline_endpoints.get_pipeline_status summary: Get status of Pipeline description: 'Get pipeline status by pipeline id' - x-sap-cloud-sdk-operation-name: getPipelineStatusById + x-sap-cloud-sdk-operation-name: getPipelineStatus parameters: - in: header name: AI-Resource-Group @@ -184,7 +184,7 @@ paths: "/pipelines/{pipelineId}/executions": get: tags: - - Pipelines + - Pipelines operationId: pipeline.v1.pipeline_endpoints.get_pipeline_executions summary: Get Pipeline Executions description: Retrieve all executions for a specific pipeline. Optionally, filter to get only the last execution. @@ -222,7 +222,7 @@ paths: "/pipelines/{pipelineId}/executions/{executionId}": get: tags: - - Pipelines + - Pipelines operationId: pipeline.v1.pipeline_endpoints.get_pipeline_execution_by_id summary: Get Pipeline Execution by ID description: Retrieve details of a specific pipeline execution by its execution ID. @@ -540,7 +540,7 @@ paths: summary: Get document by ID description: Gets a specific document in a collection by ID. operationId: vector.v1.vector_endpoints.get_document_by_id - x-sap-cloud-sdk-operation-name: getDocumentByIdForCollection + x-sap-cloud-sdk-operation-name: getDocumentById parameters: - in: header name: AI-Resource-Group @@ -583,7 +583,7 @@ paths: summary: Delete a document description: Deletes a specific document of a collection. operationId: vector.v1.vector_endpoints.delete_document - x-sap-cloud-sdk-operation-name: deleteCollectionById + x-sap-cloud-sdk-operation-name: deleteDocumentById parameters: - in: header name: AI-Resource-Group @@ -623,7 +623,7 @@ paths: summary: Get documents description: Gets a list of documents of a collection. operationId: vector.v1.vector_endpoints.get_all_documents - x-sap-cloud-sdk-operation-name: getDocumentsByCollectionId + x-sap-cloud-sdk-operation-name: getAllDocuments parameters: - in: header name: AI-Resource-Group @@ -661,7 +661,7 @@ paths: summary: Create documents in collection description: Create and stores one or multiple documents into a collection. If omitted, 'id' will be auto-generated. operationId: vector.v1.vector_endpoints.create_documents - x-sap-cloud-sdk-operation-name: createCollectionDocuments + x-sap-cloud-sdk-operation-name: createDocuments parameters: - in: header name: AI-Resource-Group @@ -702,7 +702,7 @@ paths: summary: Upsert documents in collection description: Upserts the data of multiple documents into a collection. operationId: vector.v1.vector_endpoints.update_documents - x-sap-cloud-sdk-operation-name: insertOrUpdateDocumentsInCollection + x-sap-cloud-sdk-operation-name: updateDocuments parameters: - in: header name: AI-Resource-Group @@ -751,7 +751,7 @@ paths: summary: Search chunk by vector description: Search chunks operationId: vector.v1.vector_endpoints.search_chunk - x-sap-cloud-sdk-operation-name: vectorSearchByChunk + x-sap-cloud-sdk-operation-name: search requestBody: content: application/json: @@ -778,7 +778,7 @@ paths: summary: Get collection status by ID description: Gets a specific collection status from monitor by ID. operationId: vector.v1.vector_endpoints.get_collection_creation_status - x-sap-cloud-sdk-operation-name: getCollectionStatus + x-sap-cloud-sdk-operation-name: getCollectionCreationStatus parameters: - in: header name: AI-Resource-Group @@ -860,7 +860,7 @@ paths: - $ref: '#/components/parameters/skip' - $ref: '#/components/parameters/count' tags: - - Retrieval + - Retrieval summary: List all DataRepository objects. description: List all Data Repositories operationId: retrieval.v1.retrieval_endpoints.get_data_repositories @@ -877,7 +877,7 @@ paths: "/retrieval/dataRepositories/{repositoryId}": get: tags: - - Retrieval + - Retrieval summary: List single DataRepository object. description: List data repository by id operationId: retrieval.v1.retrieval_endpoints.get_data_repository @@ -929,7 +929,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/SearchInput" + $ref: "#/components/schemas/RetrievalSearchInput" required: true responses: '200': @@ -1186,7 +1186,7 @@ components: pattern: '^$|^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$' example: '2024-02-15T12:45:00.000Z' status: - $ref: '#/components/schemas/PipelineExecutionStatus' + $ref: '#/components/schemas/PipelineExecutionStatus' pipelineId: type: object @@ -1214,7 +1214,7 @@ components: example: uuid status: $ref: '#/components/schemas/PipelineExecutionStatus' - + getPipelineExecutions: type: object properties: @@ -1287,7 +1287,7 @@ components: type: string example: '2024-02-15T12:45:00Z' status: - $ref: '#/components/schemas/DocumentStatus' + $ref: '#/components/schemas/DocumentStatus' Chunk: properties: @@ -1305,8 +1305,8 @@ components: default: [] type: object required: - - id - - content + - id + - content title: Chunk DocumentKeyValueListPair: properties: @@ -1328,13 +1328,13 @@ components: default: ANY anyOf: - enum: - - ANY - - ALL + - ANY + - ALL - {} type: object required: - - key - - value + - key + - value title: DocumentKeyValueListPair HTTPValidationError: properties: @@ -1359,8 +1359,8 @@ components: title: Value type: object required: - - key - - value + - key + - value title: KeyValueListPair Document-Output: properties: @@ -1465,8 +1465,8 @@ components: description: Select mode for search filters type: object required: - - key - - value + - key + - value title: SearchDocumentKeyValueListPair SearchResults: properties: @@ -1474,12 +1474,12 @@ components: type: array items: anyOf: - - $ref: "#/components/schemas/PerFilterSearchResult" + - $ref: "#/components/schemas/PerFilterSearchResult" title: Results description: List of returned results. type: object required: - - results + - results title: SearchResults CollectionsListResponse: @@ -1718,7 +1718,7 @@ components: type: string anyOf: - enum: - - ignoreIfKeyAbsent + - ignoreIfKeyAbsent - {} default: ignoreIfKeyAbsent title: SearchSelectOptionEnum @@ -1837,7 +1837,7 @@ components: title: Datarepositories type: object required: - - resources + - resources title: DataRepositories DataRepository: properties: @@ -1860,9 +1860,9 @@ components: $ref: "#/components/schemas/DataRepositoryType" type: object required: - - id - - title - - type + - id + - title + - type title: DataRepository description: DataRepository schema expected by Retrieval. DataRepositorySearchResult: @@ -1871,14 +1871,14 @@ components: $ref: "#/components/schemas/DataRepositoryWithDocuments" type: object required: - - dataRepository + - dataRepository title: DataRepositorySearchResult DataRepositoryType: type: string anyOf: - enum: - - vector - - help.sap.com + - vector + - help.sap.com - {} title: DataRepositoryType DataRepositoryWithDocuments: @@ -1904,9 +1904,9 @@ components: title: Documents type: object required: - - id - - title - - documents + - id + - title + - documents title: DataRepositoryWithDocuments description: DataRepository schema returned by the Vector search endpoint Document: @@ -1927,8 +1927,8 @@ components: title: Chunks type: object required: - - id - - chunks + - id + - chunks title: Document DataRepositoryPerFilterSearchResult: properties: @@ -1944,7 +1944,7 @@ components: default: [] type: object required: - - filterId + - filterId title: PerFilterSearchResult PerFilterSearchResultError: properties: @@ -1953,7 +1953,7 @@ components: title: Message type: object required: - - message + - message title: PerFilterSearchResultError PerFilterSearchResultWithError: properties: @@ -1967,26 +1967,8 @@ components: message: Unknown Error Occurred type: object required: - - filterId + - filterId title: PerFilterSearchResultWithError - RetrievalSearchConfiguration: - properties: - maxChunkCount: - nullable: true - type: integer - minimum: 0 - exclusiveMinimum: true - title: Maxchunkcount - description: Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. - maxDocumentCount: - nullable: true - type: integer - minimum: 0 - exclusiveMinimum: true - title: Maxdocumentcount - description: "[Only supports 'vector' dataRepositoryType] - Maximum number of documents to be returned. Cannot be used with 'maxChunkCount'. If maxDocumentCount is given, then only one chunk per document is returned." - type: object - title: SearchConfiguration RetrievalSearchFilter: properties: id: @@ -1996,7 +1978,7 @@ components: searchConfiguration: type: object nullable: true - $ref: "#/components/schemas/RetrievalSearchConfiguration" + $ref: "#/components/schemas/SearchConfiguration" default: {} minProperties: 0 maxProperties: 2 @@ -2007,7 +1989,7 @@ components: title: Datarepositories description: Specify ['*'] to search across all DataRepositories or give a specific list of DataRepository ids. default: - - "*" + - "*" dataRepositoryType: type: string $ref: "#/components/schemas/DataRepositoryType" @@ -2035,11 +2017,11 @@ components: default: [] type: object required: - - id - - dataRepositoryType + - id + - dataRepositoryType title: SearchFilter description: Limit scope of search to certain DataRepositories, Documents or Chunks. - SearchInput: + RetrievalSearchInput: properties: query: type: string @@ -2053,8 +2035,8 @@ components: title: Filters type: object required: - - query - - filters + - query + - filters title: SearchInput DataRepositorySearchResults: properties: @@ -2062,13 +2044,13 @@ components: type: array items: anyOf: - - $ref: "#/components/schemas/DataRepositoryPerFilterSearchResult" - - $ref: "#/components/schemas/PerFilterSearchResultWithError" + - $ref: "#/components/schemas/DataRepositoryPerFilterSearchResult" + - $ref: "#/components/schemas/PerFilterSearchResultWithError" title: Results description: List of returned results. type: object required: - - results + - results title: SearchResults ValidationError: properties: @@ -2085,9 +2067,9 @@ components: title: Error Type type: object required: - - loc - - msg - - type + - loc + - msg + - type title: ValidationError ### ### ######################## ### ### @@ -2192,4 +2174,4 @@ components: required: false schema: type: boolean - example: true \ No newline at end of file + example: true diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java index 86580b9a1..71d4f5679 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java @@ -20,9 +20,9 @@ import com.sap.ai.sdk.grounding.model.DocumentWithoutChunks; import com.sap.ai.sdk.grounding.model.EmbeddingConfig; import com.sap.ai.sdk.grounding.model.KeyValueListPair; -import com.sap.ai.sdk.grounding.model.RetrievalSearchConfiguration; import com.sap.ai.sdk.grounding.model.RetrievalSearchFilter; -import com.sap.ai.sdk.grounding.model.SearchInput; +import com.sap.ai.sdk.grounding.model.RetrievalSearchInput; +import com.sap.ai.sdk.grounding.model.SearchConfiguration; import com.sap.ai.sdk.grounding.model.TextOnlyBaseChunk; import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse; import java.time.format.TextStyle; @@ -92,8 +92,8 @@ Object searchInDocuments( .id("question") .dataRepositoryType(DataRepositoryType.VECTOR) .dataRepositories(List.of("*")) - .searchConfiguration(RetrievalSearchConfiguration.create().maxChunkCount(10)); - final var q = SearchInput.create().query("When was the last upload?").filters(filter); + .searchConfiguration(SearchConfiguration.create().maxChunkCount(10)); + final var q = RetrievalSearchInput.create().query("When was the last upload?").filters(filter); final var results = CLIENT_RETRIEVAL.search(RESOURCE_GROUP, q); if ("json".equals(format)) { @@ -127,7 +127,7 @@ Object getAllCollections( Object getDocumentsByCollectionId( @Nonnull @PathVariable("id") final UUID collectionId, @Nullable @RequestParam(value = "format", required = false) final String format) { - final var documents = CLIENT_VECTOR.getDocumentsByCollectionId(RESOURCE_GROUP, collectionId); + final var documents = CLIENT_VECTOR.getAllDocuments(RESOURCE_GROUP, collectionId); if ("json".equals(format)) { return documents; } @@ -162,8 +162,7 @@ Object createDocument( final var docMeta = DocumentKeyValueListPair.create().key("purpose").value("testing"); final var doc = BaseDocument.create().chunks(chunk).metadata(docMeta); final var request = DocumentCreateRequest.create().documents(doc); - final var response = - CLIENT_VECTOR.createCollectionDocuments(RESOURCE_GROUP, collectionId, request); + final var response = CLIENT_VECTOR.createDocuments(RESOURCE_GROUP, collectionId, request); if ("json".equals(format)) { return response; @@ -185,12 +184,12 @@ Object deleteCollection( final var doc = BaseDocument.create().chunks(chunk).metadata(docMeta); final var request = DocumentCreateRequest.create().documents(doc); - final var documents = CLIENT_VECTOR.getDocumentsByCollectionId(RESOURCE_GROUP, collectionId); + final var documents = CLIENT_VECTOR.getAllDocuments(RESOURCE_GROUP, collectionId); final var ids = documents.getResources().stream().map(DocumentWithoutChunks::getId).toList(); log.info("Deleting collection {} with {} documents: {}", collectionId, ids.size(), ids); for (final var documentId : ids) { - final var del = CLIENT_VECTOR.deleteCollectionById(RESOURCE_GROUP, collectionId, documentId); + final var del = CLIENT_VECTOR.deleteDocumentById(RESOURCE_GROUP, collectionId, documentId); if (del.getStatusCode() >= 400) { final var msg = "Document {} could not be deleted, status code [{}], headers: {}"; log.error(msg, documentId, del.getStatusCode(), del.getHeaders()); @@ -210,8 +209,7 @@ Object getDocumentChunksById( @Nonnull @PathVariable("collectionId") final UUID collectionId, @Nonnull @PathVariable("documentId") final UUID documentId, @Nullable @RequestParam(value = "format", required = false) final String format) { - final var document = - CLIENT_VECTOR.getDocumentByIdForCollection(RESOURCE_GROUP, collectionId, documentId); + final var document = CLIENT_VECTOR.getDocumentById(RESOURCE_GROUP, collectionId, documentId); if ("json".equals(format)) { return document; } From 109b1dcc689cc4aa39b2853a589e5c31986f993f Mon Sep 17 00:00:00 2001 From: I538344 Date: Thu, 10 Jul 2025 12:41:37 +0200 Subject: [PATCH 04/10] fixed --- .../com/sap/ai/sdk/grounding/GroundingClientTest.java | 4 ++-- .../com/sap/ai/sdk/app/controllers/GroundingTest.java | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/core-services/document-grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java b/core-services/document-grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java index 4c7b120d9..de8a58431 100644 --- a/core-services/document-grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java +++ b/core-services/document-grounding/src/test/java/com/sap/ai/sdk/grounding/GroundingClientTest.java @@ -61,7 +61,7 @@ void testVector() { }); final UUID collectionId = collections.getResources().get(0).getId(); - final Documents documents = api.getDocumentsByCollectionId("reosurceGroup", collectionId); + final Documents documents = api.getAllDocuments("reosurceGroup", collectionId); assertThat(documents).isNotNull(); final DocumentKeyValueListPair documentMeta = DocumentKeyValueListPair.create() @@ -80,7 +80,7 @@ void testVector() { final UUID documentId = documents.getResources().get(0).getId(); final DocumentResponse document = - api.getDocumentByIdForCollection("reosurceGroup", collectionId, documentId); + api.getDocumentById("reosurceGroup", collectionId, documentId); assertThat(document).isNotNull(); assertThat(document.getId()).isEqualTo(documentId); assertThat(document.getMetadata()).isNotNull().containsExactly(documentMeta); diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java index 89e02259f..69d68b740 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java @@ -6,7 +6,6 @@ import com.sap.ai.sdk.grounding.model.CollectionsListResponse; import com.sap.ai.sdk.grounding.model.DataRepositories; -import com.sap.ai.sdk.grounding.model.DataRepositorySearchResults; import com.sap.ai.sdk.grounding.model.DocumentResponse; import com.sap.ai.sdk.grounding.model.Documents; import com.sap.ai.sdk.grounding.model.DocumentsListResponse; @@ -90,7 +89,7 @@ void testCreateDeleteCollection() { Object search = controller.searchInDocuments(JSON_FORMAT); assertThat(search).isInstanceOf(SearchResults.class); final var dayOfWeek = now().getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.ENGLISH); - this.assertDocumentSearchResult((DataRepositorySearchResults) search, dayOfWeek); + this.assertDocumentSearchResult((SearchResults) search, dayOfWeek); // (5) CLEAN UP Object deletion = controller.deleteCollection(collectionUuid, JSON_FORMAT); @@ -102,14 +101,14 @@ void testCreateDeleteCollection() { .hasMessageContaining("404 Not Found"); } - private void assertDocumentSearchResult(DataRepositorySearchResults search, String dayOfWeek) { + private void assertDocumentSearchResult(SearchResults search, String dayOfWeek) { assertThat(search.getResults()).isNotEmpty(); for (final var resultsByFilter : search.getResults()) { assertThat(resultsByFilter.getFilterId()).isEqualTo("question"); assertThat(resultsByFilter.getResults()).isNotEmpty(); for (final var result : resultsByFilter.getResults()) { - assertThat(result.getDataRepository().getDocuments()).isNotEmpty(); - for (final var document : result.getDataRepository().getDocuments()) { + assertThat(result.getDocuments()).isNotEmpty(); + for (final var document : result.getDocuments()) { assertThat(document.getChunks()).isNotEmpty(); for (final var chunk : document.getChunks()) { assertThat(chunk.getContent()).contains(dayOfWeek); From f08fe04cf1236330b4becbad9f6e14e65e14fb4d Mon Sep 17 00:00:00 2001 From: I538344 Date: Thu, 10 Jul 2025 12:56:32 +0200 Subject: [PATCH 05/10] final --- .../ai/sdk/grounding/client/RetrievalApi.java | 10 +- .../model/DataRepositorySearchResults.java | 14 +- .../ai/sdk/grounding/model/ResultsInner1.java | 62 ++-- .../ai/sdk/grounding/model/ResultsInner2.java | 275 ++++++++++++++++++ .../RetrievalDataRepositorySearchResult.java | 195 +++++++++++++ .../model/RetrievalPerFilterSearchResult.java | 247 ++++++++++++++++ ...trievalPerFilterSearchResultWithError.java | 191 ++++++++++++ .../model/RetrievalSearchResults.java | 213 ++++++++++++++ .../src/main/resources/spec/grounding.yaml | 49 +++- .../app/controllers/GroundingController.java | 2 +- .../ai/sdk/app/controllers/GroundingTest.java | 12 +- 11 files changed, 1225 insertions(+), 45 deletions(-) create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner2.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDataRepositorySearchResult.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalPerFilterSearchResult.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalPerFilterSearchResultWithError.java create mode 100644 core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchResults.java diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/RetrievalApi.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/RetrievalApi.java index 67da074b8..93ca69db2 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/RetrievalApi.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/client/RetrievalApi.java @@ -4,7 +4,7 @@ import com.sap.ai.sdk.grounding.model.DataRepositories; import com.sap.ai.sdk.grounding.model.DataRepository; import com.sap.ai.sdk.grounding.model.RetrievalSearchInput; -import com.sap.ai.sdk.grounding.model.SearchResults; +import com.sap.ai.sdk.grounding.model.RetrievalSearchResults; import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService; @@ -232,11 +232,11 @@ public DataRepository getDataRepositoryById( * * @param aiResourceGroup Resource Group ID * @param retrievalSearchInput The value for the parameter retrievalSearchInput - * @return SearchResults + * @return RetrievalSearchResults * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public SearchResults search( + public RetrievalSearchResults search( @Nonnull final String aiResourceGroup, @Nonnull final RetrievalSearchInput retrievalSearchInput) throws OpenApiRequestException { @@ -273,8 +273,8 @@ public SearchResults search( final String[] localVarAuthNames = new String[] {}; - final ParameterizedTypeReference localVarReturnType = - new ParameterizedTypeReference() {}; + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; return apiClient.invokeAPI( localVarPath, HttpMethod.POST, diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositorySearchResults.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositorySearchResults.java index 392df0da3..a305466e8 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositorySearchResults.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DataRepositorySearchResults.java @@ -32,7 +32,7 @@ public class DataRepositorySearchResults // CHECKSTYLE:ON { @JsonProperty("results") - private List results = new ArrayList<>(); + private List results = new ArrayList<>(); @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -48,7 +48,7 @@ protected DataRepositorySearchResults() {} * @return The same instance of this {@link DataRepositorySearchResults} class */ @Nonnull - public DataRepositorySearchResults results(@Nonnull final List results) { + public DataRepositorySearchResults results(@Nonnull final List results) { this.results = results; return this; } @@ -60,7 +60,7 @@ public DataRepositorySearchResults results(@Nonnull final List re * @return The same instance of type {@link DataRepositorySearchResults} */ @Nonnull - public DataRepositorySearchResults addResultsItem(@Nonnull final ResultsInner1 resultsItem) { + public DataRepositorySearchResults addResultsItem(@Nonnull final ResultsInner2 resultsItem) { if (this.results == null) { this.results = new ArrayList<>(); } @@ -74,7 +74,7 @@ public DataRepositorySearchResults addResultsItem(@Nonnull final ResultsInner1 r * @return results The results of this {@link DataRepositorySearchResults} instance. */ @Nonnull - public List getResults() { + public List getResults() { return results; } @@ -83,7 +83,7 @@ public List getResults() { * * @param results List of returned results. */ - public void setResults(@Nonnull final List results) { + public void setResults(@Nonnull final List results) { this.results = results; } @@ -201,7 +201,7 @@ public interface Builder { * @param results List of returned results. * @return The DataRepositorySearchResults instance. */ - DataRepositorySearchResults results(@Nonnull final List results); + DataRepositorySearchResults results(@Nonnull final List results); /** * Set the results of this {@link DataRepositorySearchResults} instance. @@ -209,7 +209,7 @@ public interface Builder { * @param results List of returned results. * @return The DataRepositorySearchResults instance. */ - default DataRepositorySearchResults results(@Nonnull final ResultsInner1... results) { + default DataRepositorySearchResults results(@Nonnull final ResultsInner2... results) { return results(Arrays.asList(results)); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java index aadf6fd58..af2b069df 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java @@ -34,10 +34,10 @@ public class ResultsInner1 private String filterId; @JsonProperty("results") - private List results = new ArrayList<>(); + private List results = new ArrayList<>(); - @JsonProperty("error") - private PerFilterSearchResultError error; + @JsonProperty("message") + private String message; @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -83,7 +83,7 @@ public void setFilterId(@Nonnull final String filterId) { * @return The same instance of this {@link ResultsInner1} class */ @Nonnull - public ResultsInner1 results(@Nullable final List results) { + public ResultsInner1 results(@Nullable final List results) { this.results = results; return this; } @@ -95,7 +95,8 @@ public ResultsInner1 results(@Nullable final List re * @return The same instance of type {@link ResultsInner1} */ @Nonnull - public ResultsInner1 addResultsItem(@Nonnull final DataRepositorySearchResult resultsItem) { + public ResultsInner1 addResultsItem( + @Nonnull final RetrievalDataRepositorySearchResult resultsItem) { if (this.results == null) { this.results = new ArrayList<>(); } @@ -109,7 +110,7 @@ public ResultsInner1 addResultsItem(@Nonnull final DataRepositorySearchResult re * @return results The results of this {@link ResultsInner1} instance. */ @Nonnull - public List getResults() { + public List getResults() { return results; } @@ -118,39 +119,39 @@ public List getResults() { * * @param results List of returned results. */ - public void setResults(@Nullable final List results) { + public void setResults(@Nullable final List results) { this.results = results; } /** - * Set the error of this {@link ResultsInner1} instance and return the same instance. + * Set the message of this {@link ResultsInner1} instance and return the same instance. * - * @param error The error of this {@link ResultsInner1} + * @param message The message of this {@link ResultsInner1} * @return The same instance of this {@link ResultsInner1} class */ @Nonnull - public ResultsInner1 error(@Nullable final PerFilterSearchResultError error) { - this.error = error; + public ResultsInner1 message(@Nonnull final String message) { + this.message = message; return this; } /** - * Get error + * Get message * - * @return error The error of this {@link ResultsInner1} instance. + * @return message The message of this {@link ResultsInner1} instance. */ @Nonnull - public PerFilterSearchResultError getError() { - return error; + public String getMessage() { + return message; } /** - * Set the error of this {@link ResultsInner1} instance. + * Set the message of this {@link ResultsInner1} instance. * - * @param error The error of this {@link ResultsInner1} + * @param message The message of this {@link ResultsInner1} */ - public void setError(@Nullable final PerFilterSearchResultError error) { - this.error = error; + public void setMessage(@Nonnull final String message) { + this.message = message; } /** @@ -193,7 +194,7 @@ public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); if (filterId != null) declaredFields.put("filterId", filterId); if (results != null) declaredFields.put("results", results); - if (error != null) declaredFields.put("error", error); + if (message != null) declaredFields.put("message", message); return declaredFields; } @@ -221,12 +222,12 @@ public boolean equals(@Nullable final java.lang.Object o) { return Objects.equals(this.cloudSdkCustomFields, resultsInner1.cloudSdkCustomFields) && Objects.equals(this.filterId, resultsInner1.filterId) && Objects.equals(this.results, resultsInner1.results) - && Objects.equals(this.error, resultsInner1.error); + && Objects.equals(this.message, resultsInner1.message); } @Override public int hashCode() { - return Objects.hash(filterId, results, error, cloudSdkCustomFields); + return Objects.hash(filterId, results, message, cloudSdkCustomFields); } @Override @@ -236,7 +237,7 @@ public String toString() { sb.append("class ResultsInner1 {\n"); sb.append(" filterId: ").append(toIndentedString(filterId)).append("\n"); sb.append(" results: ").append(toIndentedString(results)).append("\n"); - sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); @@ -259,7 +260,7 @@ private String toIndentedString(final java.lang.Object o) { * with all required arguments. */ public static Builder create() { - return (filterId) -> new ResultsInner1().filterId(filterId); + return (filterId) -> (message) -> new ResultsInner1().filterId(filterId).message(message); } /** Builder helper class. */ @@ -268,8 +269,19 @@ public interface Builder { * Set the filterId of this {@link ResultsInner1} instance. * * @param filterId The filterId of this {@link ResultsInner1} + * @return The ResultsInner1 builder. + */ + Builder1 filterId(@Nonnull final String filterId); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the message of this {@link ResultsInner1} instance. + * + * @param message The message of this {@link ResultsInner1} * @return The ResultsInner1 instance. */ - ResultsInner1 filterId(@Nonnull final String filterId); + ResultsInner1 message(@Nonnull final String message); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner2.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner2.java new file mode 100644 index 000000000..10e655a61 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner2.java @@ -0,0 +1,275 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** ResultsInner2 */ +// CHECKSTYLE:OFF +public class ResultsInner2 +// CHECKSTYLE:ON +{ + @JsonProperty("filterId") + private String filterId; + + @JsonProperty("results") + private List results = new ArrayList<>(); + + @JsonProperty("error") + private PerFilterSearchResultError error; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ResultsInner2. */ + protected ResultsInner2() {} + + /** + * Set the filterId of this {@link ResultsInner2} instance and return the same instance. + * + * @param filterId The filterId of this {@link ResultsInner2} + * @return The same instance of this {@link ResultsInner2} class + */ + @Nonnull + public ResultsInner2 filterId(@Nonnull final String filterId) { + this.filterId = filterId; + return this; + } + + /** + * Get filterId + * + * @return filterId The filterId of this {@link ResultsInner2} instance. + */ + @Nonnull + public String getFilterId() { + return filterId; + } + + /** + * Set the filterId of this {@link ResultsInner2} instance. + * + * @param filterId The filterId of this {@link ResultsInner2} + */ + public void setFilterId(@Nonnull final String filterId) { + this.filterId = filterId; + } + + /** + * Set the results of this {@link ResultsInner2} instance and return the same instance. + * + * @param results List of returned results. + * @return The same instance of this {@link ResultsInner2} class + */ + @Nonnull + public ResultsInner2 results(@Nullable final List results) { + this.results = results; + return this; + } + + /** + * Add one results instance to this {@link ResultsInner2}. + * + * @param resultsItem The results that should be added + * @return The same instance of type {@link ResultsInner2} + */ + @Nonnull + public ResultsInner2 addResultsItem(@Nonnull final DataRepositorySearchResult resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * List of returned results. + * + * @return results The results of this {@link ResultsInner2} instance. + */ + @Nonnull + public List getResults() { + return results; + } + + /** + * Set the results of this {@link ResultsInner2} instance. + * + * @param results List of returned results. + */ + public void setResults(@Nullable final List results) { + this.results = results; + } + + /** + * Set the error of this {@link ResultsInner2} instance and return the same instance. + * + * @param error The error of this {@link ResultsInner2} + * @return The same instance of this {@link ResultsInner2} class + */ + @Nonnull + public ResultsInner2 error(@Nullable final PerFilterSearchResultError error) { + this.error = error; + return this; + } + + /** + * Get error + * + * @return error The error of this {@link ResultsInner2} instance. + */ + @Nonnull + public PerFilterSearchResultError getError() { + return error; + } + + /** + * Set the error of this {@link ResultsInner2} instance. + * + * @param error The error of this {@link ResultsInner2} + */ + public void setError(@Nullable final PerFilterSearchResultError error) { + this.error = error; + } + + /** + * Get the names of the unrecognizable properties of the {@link ResultsInner2}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ResultsInner2} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("ResultsInner2 has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link ResultsInner2} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filterId != null) declaredFields.put("filterId", filterId); + if (results != null) declaredFields.put("results", results); + if (error != null) declaredFields.put("error", error); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link ResultsInner2} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final ResultsInner2 resultsInner2 = (ResultsInner2) o; + return Objects.equals(this.cloudSdkCustomFields, resultsInner2.cloudSdkCustomFields) + && Objects.equals(this.filterId, resultsInner2.filterId) + && Objects.equals(this.results, resultsInner2.results) + && Objects.equals(this.error, resultsInner2.error); + } + + @Override + public int hashCode() { + return Objects.hash(filterId, results, error, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ResultsInner2 {\n"); + sb.append(" filterId: ").append(toIndentedString(filterId)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link ResultsInner2} instance + * with all required arguments. + */ + public static Builder create() { + return (filterId) -> new ResultsInner2().filterId(filterId); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filterId of this {@link ResultsInner2} instance. + * + * @param filterId The filterId of this {@link ResultsInner2} + * @return The ResultsInner2 instance. + */ + ResultsInner2 filterId(@Nonnull final String filterId); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDataRepositorySearchResult.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDataRepositorySearchResult.java new file mode 100644 index 000000000..311079044 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDataRepositorySearchResult.java @@ -0,0 +1,195 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** RetrievalDataRepositorySearchResult */ +// CHECKSTYLE:OFF +public class RetrievalDataRepositorySearchResult +// CHECKSTYLE:ON +{ + @JsonProperty("dataRepository") + private DataRepositoryWithDocuments dataRepository; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetrievalDataRepositorySearchResult. */ + protected RetrievalDataRepositorySearchResult() {} + + /** + * Set the dataRepository of this {@link RetrievalDataRepositorySearchResult} instance and return + * the same instance. + * + * @param dataRepository The dataRepository of this {@link RetrievalDataRepositorySearchResult} + * @return The same instance of this {@link RetrievalDataRepositorySearchResult} class + */ + @Nonnull + public RetrievalDataRepositorySearchResult dataRepository( + @Nonnull final DataRepositoryWithDocuments dataRepository) { + this.dataRepository = dataRepository; + return this; + } + + /** + * Get dataRepository + * + * @return dataRepository The dataRepository of this {@link RetrievalDataRepositorySearchResult} + * instance. + */ + @Nonnull + public DataRepositoryWithDocuments getDataRepository() { + return dataRepository; + } + + /** + * Set the dataRepository of this {@link RetrievalDataRepositorySearchResult} instance. + * + * @param dataRepository The dataRepository of this {@link RetrievalDataRepositorySearchResult} + */ + public void setDataRepository(@Nonnull final DataRepositoryWithDocuments dataRepository) { + this.dataRepository = dataRepository; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * RetrievalDataRepositorySearchResult}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetrievalDataRepositorySearchResult} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "RetrievalDataRepositorySearchResult has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link RetrievalDataRepositorySearchResult} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (dataRepository != null) declaredFields.put("dataRepository", dataRepository); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link RetrievalDataRepositorySearchResult} instance. If + * the map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetrievalDataRepositorySearchResult retrievalDataRepositorySearchResult = + (RetrievalDataRepositorySearchResult) o; + return Objects.equals( + this.cloudSdkCustomFields, retrievalDataRepositorySearchResult.cloudSdkCustomFields) + && Objects.equals(this.dataRepository, retrievalDataRepositorySearchResult.dataRepository); + } + + @Override + public int hashCode() { + return Objects.hash(dataRepository, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetrievalDataRepositorySearchResult {\n"); + sb.append(" dataRepository: ").append(toIndentedString(dataRepository)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * RetrievalDataRepositorySearchResult} instance with all required arguments. + */ + public static Builder create() { + return (dataRepository) -> + new RetrievalDataRepositorySearchResult().dataRepository(dataRepository); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the dataRepository of this {@link RetrievalDataRepositorySearchResult} instance. + * + * @param dataRepository The dataRepository of this {@link RetrievalDataRepositorySearchResult} + * @return The RetrievalDataRepositorySearchResult instance. + */ + RetrievalDataRepositorySearchResult dataRepository( + @Nonnull final DataRepositoryWithDocuments dataRepository); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalPerFilterSearchResult.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalPerFilterSearchResult.java new file mode 100644 index 000000000..58baa7981 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalPerFilterSearchResult.java @@ -0,0 +1,247 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** RetrievalPerFilterSearchResult */ +// CHECKSTYLE:OFF +public class RetrievalPerFilterSearchResult +// CHECKSTYLE:ON +{ + @JsonProperty("filterId") + private String filterId; + + @JsonProperty("results") + private List results = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetrievalPerFilterSearchResult. */ + protected RetrievalPerFilterSearchResult() {} + + /** + * Set the filterId of this {@link RetrievalPerFilterSearchResult} instance and return the same + * instance. + * + * @param filterId The filterId of this {@link RetrievalPerFilterSearchResult} + * @return The same instance of this {@link RetrievalPerFilterSearchResult} class + */ + @Nonnull + public RetrievalPerFilterSearchResult filterId(@Nonnull final String filterId) { + this.filterId = filterId; + return this; + } + + /** + * Get filterId + * + * @return filterId The filterId of this {@link RetrievalPerFilterSearchResult} instance. + */ + @Nonnull + public String getFilterId() { + return filterId; + } + + /** + * Set the filterId of this {@link RetrievalPerFilterSearchResult} instance. + * + * @param filterId The filterId of this {@link RetrievalPerFilterSearchResult} + */ + public void setFilterId(@Nonnull final String filterId) { + this.filterId = filterId; + } + + /** + * Set the results of this {@link RetrievalPerFilterSearchResult} instance and return the same + * instance. + * + * @param results List of returned results. + * @return The same instance of this {@link RetrievalPerFilterSearchResult} class + */ + @Nonnull + public RetrievalPerFilterSearchResult results( + @Nullable final List results) { + this.results = results; + return this; + } + + /** + * Add one results instance to this {@link RetrievalPerFilterSearchResult}. + * + * @param resultsItem The results that should be added + * @return The same instance of type {@link RetrievalPerFilterSearchResult} + */ + @Nonnull + public RetrievalPerFilterSearchResult addResultsItem( + @Nonnull final RetrievalDataRepositorySearchResult resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * List of returned results. + * + * @return results The results of this {@link RetrievalPerFilterSearchResult} instance. + */ + @Nonnull + public List getResults() { + return results; + } + + /** + * Set the results of this {@link RetrievalPerFilterSearchResult} instance. + * + * @param results List of returned results. + */ + public void setResults(@Nullable final List results) { + this.results = results; + } + + /** + * Get the names of the unrecognizable properties of the {@link RetrievalPerFilterSearchResult}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetrievalPerFilterSearchResult} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "RetrievalPerFilterSearchResult has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link RetrievalPerFilterSearchResult} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filterId != null) declaredFields.put("filterId", filterId); + if (results != null) declaredFields.put("results", results); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link RetrievalPerFilterSearchResult} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetrievalPerFilterSearchResult retrievalPerFilterSearchResult = + (RetrievalPerFilterSearchResult) o; + return Objects.equals( + this.cloudSdkCustomFields, retrievalPerFilterSearchResult.cloudSdkCustomFields) + && Objects.equals(this.filterId, retrievalPerFilterSearchResult.filterId) + && Objects.equals(this.results, retrievalPerFilterSearchResult.results); + } + + @Override + public int hashCode() { + return Objects.hash(filterId, results, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetrievalPerFilterSearchResult {\n"); + sb.append(" filterId: ").append(toIndentedString(filterId)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * RetrievalPerFilterSearchResult} instance with all required arguments. + */ + public static Builder create() { + return (filterId) -> new RetrievalPerFilterSearchResult().filterId(filterId); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filterId of this {@link RetrievalPerFilterSearchResult} instance. + * + * @param filterId The filterId of this {@link RetrievalPerFilterSearchResult} + * @return The RetrievalPerFilterSearchResult instance. + */ + RetrievalPerFilterSearchResult filterId(@Nonnull final String filterId); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalPerFilterSearchResultWithError.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalPerFilterSearchResultWithError.java new file mode 100644 index 000000000..6f61028b6 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalPerFilterSearchResultWithError.java @@ -0,0 +1,191 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** RetrievalPerFilterSearchResultWithError */ +// CHECKSTYLE:OFF +public class RetrievalPerFilterSearchResultWithError +// CHECKSTYLE:ON +{ + @JsonProperty("message") + private String message; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetrievalPerFilterSearchResultWithError. */ + protected RetrievalPerFilterSearchResultWithError() {} + + /** + * Set the message of this {@link RetrievalPerFilterSearchResultWithError} instance and return the + * same instance. + * + * @param message The message of this {@link RetrievalPerFilterSearchResultWithError} + * @return The same instance of this {@link RetrievalPerFilterSearchResultWithError} class + */ + @Nonnull + public RetrievalPerFilterSearchResultWithError message(@Nonnull final String message) { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message The message of this {@link RetrievalPerFilterSearchResultWithError} instance. + */ + @Nonnull + public String getMessage() { + return message; + } + + /** + * Set the message of this {@link RetrievalPerFilterSearchResultWithError} instance. + * + * @param message The message of this {@link RetrievalPerFilterSearchResultWithError} + */ + public void setMessage(@Nonnull final String message) { + this.message = message; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * RetrievalPerFilterSearchResultWithError}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * RetrievalPerFilterSearchResultWithError} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "RetrievalPerFilterSearchResultWithError has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link RetrievalPerFilterSearchResultWithError} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (message != null) declaredFields.put("message", message); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link RetrievalPerFilterSearchResultWithError} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetrievalPerFilterSearchResultWithError retrievalPerFilterSearchResultWithError = + (RetrievalPerFilterSearchResultWithError) o; + return Objects.equals( + this.cloudSdkCustomFields, retrievalPerFilterSearchResultWithError.cloudSdkCustomFields) + && Objects.equals(this.message, retrievalPerFilterSearchResultWithError.message); + } + + @Override + public int hashCode() { + return Objects.hash(message, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetrievalPerFilterSearchResultWithError {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * RetrievalPerFilterSearchResultWithError} instance with all required arguments. + */ + public static Builder create() { + return (message) -> new RetrievalPerFilterSearchResultWithError().message(message); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the message of this {@link RetrievalPerFilterSearchResultWithError} instance. + * + * @param message The message of this {@link RetrievalPerFilterSearchResultWithError} + * @return The RetrievalPerFilterSearchResultWithError instance. + */ + RetrievalPerFilterSearchResultWithError message(@Nonnull final String message); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchResults.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchResults.java new file mode 100644 index 000000000..e29f60da4 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchResults.java @@ -0,0 +1,213 @@ +/* + * Grounding + * Grounding is a service designed to handle data-related tasks, such as grounding and retrieval, using vector databases. It provides specialized data retrieval through these databases, grounding the retrieval process with your own external and context-relevant data. Grounding combines generative AI capabilities with the ability to use real-time, precise data to improve decision-making and business operations for specific AI-driven business solutions. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.grounding.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** RetrievalSearchResults */ +// CHECKSTYLE:OFF +public class RetrievalSearchResults +// CHECKSTYLE:ON +{ + @JsonProperty("results") + private List results = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetrievalSearchResults. */ + protected RetrievalSearchResults() {} + + /** + * Set the results of this {@link RetrievalSearchResults} instance and return the same instance. + * + * @param results List of returned results. + * @return The same instance of this {@link RetrievalSearchResults} class + */ + @Nonnull + public RetrievalSearchResults results(@Nonnull final List results) { + this.results = results; + return this; + } + + /** + * Add one results instance to this {@link RetrievalSearchResults}. + * + * @param resultsItem The results that should be added + * @return The same instance of type {@link RetrievalSearchResults} + */ + @Nonnull + public RetrievalSearchResults addResultsItem(@Nonnull final ResultsInner1 resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * List of returned results. + * + * @return results The results of this {@link RetrievalSearchResults} instance. + */ + @Nonnull + public List getResults() { + return results; + } + + /** + * Set the results of this {@link RetrievalSearchResults} instance. + * + * @param results List of returned results. + */ + public void setResults(@Nonnull final List results) { + this.results = results; + } + + /** + * Get the names of the unrecognizable properties of the {@link RetrievalSearchResults}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetrievalSearchResults} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "RetrievalSearchResults has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link RetrievalSearchResults} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (results != null) declaredFields.put("results", results); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link RetrievalSearchResults} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final RetrievalSearchResults retrievalSearchResults = (RetrievalSearchResults) o; + return Objects.equals(this.cloudSdkCustomFields, retrievalSearchResults.cloudSdkCustomFields) + && Objects.equals(this.results, retrievalSearchResults.results); + } + + @Override + public int hashCode() { + return Objects.hash(results, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetrievalSearchResults {\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link RetrievalSearchResults} + * instance with all required arguments. + */ + public static Builder create() { + return (results) -> new RetrievalSearchResults().results(results); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the results of this {@link RetrievalSearchResults} instance. + * + * @param results List of returned results. + * @return The RetrievalSearchResults instance. + */ + RetrievalSearchResults results(@Nonnull final List results); + + /** + * Set the results of this {@link RetrievalSearchResults} instance. + * + * @param results List of returned results. + * @return The RetrievalSearchResults instance. + */ + default RetrievalSearchResults results(@Nonnull final ResultsInner1... results) { + return results(Arrays.asList(results)); + } + } +} diff --git a/core-services/document-grounding/src/main/resources/spec/grounding.yaml b/core-services/document-grounding/src/main/resources/spec/grounding.yaml index 0378df1a1..a2acbe3d5 100644 --- a/core-services/document-grounding/src/main/resources/spec/grounding.yaml +++ b/core-services/document-grounding/src/main/resources/spec/grounding.yaml @@ -937,7 +937,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/SearchResults" + $ref: "#/components/schemas/RetrievalSearchResults" '400': $ref: '#/components/responses/BadRequest' '422': @@ -2038,6 +2038,53 @@ components: - query - filters title: SearchInput + RetrievalDataRepositorySearchResult: + properties: + dataRepository: + $ref: "#/components/schemas/DataRepositoryWithDocuments" + type: object + required: + - dataRepository + title: DataRepositorySearchResult + RetrievalPerFilterSearchResult: + properties: + filterId: + type: string + title: Filterid + results: + type: array + items: + $ref: "#/components/schemas/RetrievalDataRepositorySearchResult" + title: Results + description: List of returned results. + default: [] + type: object + required: + - filterId + title: PerFilterSearchResult + RetrievalPerFilterSearchResultWithError: + properties: + message: + type: string + title: Message + type: object + required: + - message + title: PerFilterSearchResultError + RetrievalSearchResults: + properties: + results: + type: array + items: + anyOf: + - $ref: "#/components/schemas/RetrievalPerFilterSearchResult" + - $ref: "#/components/schemas/RetrievalPerFilterSearchResultWithError" + title: Results + description: List of returned results. + type: object + required: + - results + title: SearchResults DataRepositorySearchResults: properties: results: diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java index 71d4f5679..69d456f88 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java @@ -102,7 +102,7 @@ Object searchInDocuments( final var messages = results.getResults().stream() .flatMap(resultsInner1 -> resultsInner1.getResults().stream()) - .flatMap(result -> result.getDocuments().stream()) + .flatMap(result -> result.getDataRepository().getDocuments().stream()) .flatMap(dataRepositorySearchResult -> dataRepositorySearchResult.getChunks().stream()) .map(Chunk::getContent) .toList(); diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java index 69d68b740..bc8d5f95d 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java @@ -10,7 +10,7 @@ import com.sap.ai.sdk.grounding.model.Documents; import com.sap.ai.sdk.grounding.model.DocumentsListResponse; import com.sap.ai.sdk.grounding.model.GetPipelines; -import com.sap.ai.sdk.grounding.model.SearchResults; +import com.sap.ai.sdk.grounding.model.RetrievalSearchResults; import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse; import java.time.format.TextStyle; import java.util.Locale; @@ -87,9 +87,9 @@ void testCreateDeleteCollection() { // (4) SEARCH FOR DOCUMENTS Object search = controller.searchInDocuments(JSON_FORMAT); - assertThat(search).isInstanceOf(SearchResults.class); + assertThat(search).isInstanceOf(RetrievalSearchResults.class); final var dayOfWeek = now().getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.ENGLISH); - this.assertDocumentSearchResult((SearchResults) search, dayOfWeek); + this.assertDocumentSearchResult((RetrievalSearchResults) search, dayOfWeek); // (5) CLEAN UP Object deletion = controller.deleteCollection(collectionUuid, JSON_FORMAT); @@ -101,14 +101,14 @@ void testCreateDeleteCollection() { .hasMessageContaining("404 Not Found"); } - private void assertDocumentSearchResult(SearchResults search, String dayOfWeek) { + private void assertDocumentSearchResult(RetrievalSearchResults search, String dayOfWeek) { assertThat(search.getResults()).isNotEmpty(); for (final var resultsByFilter : search.getResults()) { assertThat(resultsByFilter.getFilterId()).isEqualTo("question"); assertThat(resultsByFilter.getResults()).isNotEmpty(); for (final var result : resultsByFilter.getResults()) { - assertThat(result.getDocuments()).isNotEmpty(); - for (final var document : result.getDocuments()) { + assertThat(result.getDataRepository().getDocuments()).isNotEmpty(); + for (final var document : result.getDataRepository().getDocuments()) { assertThat(document.getChunks()).isNotEmpty(); for (final var chunk : document.getChunks()) { assertThat(chunk.getContent()).contains(dayOfWeek); From cef42ef1a459c0c6ec7a7f0ebdb8dc1e1b6563a6 Mon Sep 17 00:00:00 2001 From: SAP Cloud SDK Bot Date: Sun, 13 Jul 2025 00:11:26 +0000 Subject: [PATCH 06/10] Update grounding based on main --- .../src/main/resources/spec/grounding.yaml | 130 +++++++++--------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/core-services/document-grounding/src/main/resources/spec/grounding.yaml b/core-services/document-grounding/src/main/resources/spec/grounding.yaml index a2acbe3d5..0cd714152 100644 --- a/core-services/document-grounding/src/main/resources/spec/grounding.yaml +++ b/core-services/document-grounding/src/main/resources/spec/grounding.yaml @@ -22,19 +22,19 @@ servers: variables: region: enum: - - prod.eu-central-1.aws - - prodeuonly.eu-central-1.aws - - prod.us-east-1.aws - - prod.ap-northeast-1.aws - - prod.ap-southeast-2.aws - - prod-eu20.westeurope.azure - - prod-eu30.europe-west3.gcp - - prod-us21.eastus.azure - - prod-us30.us-central1.gcp - - prod-ap20.australiaeast.az - - prod-ap11.ap-southeast-1.aws + - prod.eu-central-1.aws + - prodeuonly.eu-central-1.aws + - prod.us-east-1.aws + - prod.ap-northeast-1.aws + - prod.ap-southeast-2.aws + - prod-eu20.westeurope.azure + - prod-eu30.europe-west3.gcp + - prod-us21.eastus.azure + - prod-us30.us-central1.gcp + - prod-ap20.australiaeast.az + - prod-ap11.ap-southeast-1.aws default: prod.eu-central-1.aws - service: + service: default: document-grounding paths: "/pipelines": @@ -184,7 +184,7 @@ paths: "/pipelines/{pipelineId}/executions": get: tags: - - Pipelines + - Pipelines operationId: pipeline.v1.pipeline_endpoints.get_pipeline_executions summary: Get Pipeline Executions description: Retrieve all executions for a specific pipeline. Optionally, filter to get only the last execution. @@ -222,7 +222,7 @@ paths: "/pipelines/{pipelineId}/executions/{executionId}": get: tags: - - Pipelines + - Pipelines operationId: pipeline.v1.pipeline_endpoints.get_pipeline_execution_by_id summary: Get Pipeline Execution by ID description: Retrieve details of a specific pipeline execution by its execution ID. @@ -860,7 +860,7 @@ paths: - $ref: '#/components/parameters/skip' - $ref: '#/components/parameters/count' tags: - - Retrieval + - Retrieval summary: List all DataRepository objects. description: List all Data Repositories operationId: retrieval.v1.retrieval_endpoints.get_data_repositories @@ -877,7 +877,7 @@ paths: "/retrieval/dataRepositories/{repositoryId}": get: tags: - - Retrieval + - Retrieval summary: List single DataRepository object. description: List data repository by id operationId: retrieval.v1.retrieval_endpoints.get_data_repository @@ -1186,7 +1186,7 @@ components: pattern: '^$|^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$' example: '2024-02-15T12:45:00.000Z' status: - $ref: '#/components/schemas/PipelineExecutionStatus' + $ref: '#/components/schemas/PipelineExecutionStatus' pipelineId: type: object @@ -1214,7 +1214,7 @@ components: example: uuid status: $ref: '#/components/schemas/PipelineExecutionStatus' - + getPipelineExecutions: type: object properties: @@ -1287,7 +1287,7 @@ components: type: string example: '2024-02-15T12:45:00Z' status: - $ref: '#/components/schemas/DocumentStatus' + $ref: '#/components/schemas/DocumentStatus' Chunk: properties: @@ -1305,8 +1305,8 @@ components: default: [] type: object required: - - id - - content + - id + - content title: Chunk DocumentKeyValueListPair: properties: @@ -1328,13 +1328,13 @@ components: default: ANY anyOf: - enum: - - ANY - - ALL + - ANY + - ALL - {} type: object required: - - key - - value + - key + - value title: DocumentKeyValueListPair HTTPValidationError: properties: @@ -1359,8 +1359,8 @@ components: title: Value type: object required: - - key - - value + - key + - value title: KeyValueListPair Document-Output: properties: @@ -1465,8 +1465,8 @@ components: description: Select mode for search filters type: object required: - - key - - value + - key + - value title: SearchDocumentKeyValueListPair SearchResults: properties: @@ -1474,12 +1474,12 @@ components: type: array items: anyOf: - - $ref: "#/components/schemas/PerFilterSearchResult" + - $ref: "#/components/schemas/PerFilterSearchResult" title: Results description: List of returned results. type: object required: - - results + - results title: SearchResults CollectionsListResponse: @@ -1718,7 +1718,7 @@ components: type: string anyOf: - enum: - - ignoreIfKeyAbsent + - ignoreIfKeyAbsent - {} default: ignoreIfKeyAbsent title: SearchSelectOptionEnum @@ -1837,7 +1837,7 @@ components: title: Datarepositories type: object required: - - resources + - resources title: DataRepositories DataRepository: properties: @@ -1860,9 +1860,9 @@ components: $ref: "#/components/schemas/DataRepositoryType" type: object required: - - id - - title - - type + - id + - title + - type title: DataRepository description: DataRepository schema expected by Retrieval. DataRepositorySearchResult: @@ -1871,14 +1871,14 @@ components: $ref: "#/components/schemas/DataRepositoryWithDocuments" type: object required: - - dataRepository + - dataRepository title: DataRepositorySearchResult DataRepositoryType: type: string anyOf: - enum: - - vector - - help.sap.com + - vector + - help.sap.com - {} title: DataRepositoryType DataRepositoryWithDocuments: @@ -1904,9 +1904,9 @@ components: title: Documents type: object required: - - id - - title - - documents + - id + - title + - documents title: DataRepositoryWithDocuments description: DataRepository schema returned by the Vector search endpoint Document: @@ -1927,8 +1927,8 @@ components: title: Chunks type: object required: - - id - - chunks + - id + - chunks title: Document DataRepositoryPerFilterSearchResult: properties: @@ -1944,7 +1944,7 @@ components: default: [] type: object required: - - filterId + - filterId title: PerFilterSearchResult PerFilterSearchResultError: properties: @@ -1953,7 +1953,7 @@ components: title: Message type: object required: - - message + - message title: PerFilterSearchResultError PerFilterSearchResultWithError: properties: @@ -1967,7 +1967,7 @@ components: message: Unknown Error Occurred type: object required: - - filterId + - filterId title: PerFilterSearchResultWithError RetrievalSearchFilter: properties: @@ -1989,7 +1989,7 @@ components: title: Datarepositories description: Specify ['*'] to search across all DataRepositories or give a specific list of DataRepository ids. default: - - "*" + - "*" dataRepositoryType: type: string $ref: "#/components/schemas/DataRepositoryType" @@ -2017,8 +2017,8 @@ components: default: [] type: object required: - - id - - dataRepositoryType + - id + - dataRepositoryType title: SearchFilter description: Limit scope of search to certain DataRepositories, Documents or Chunks. RetrievalSearchInput: @@ -2035,8 +2035,8 @@ components: title: Filters type: object required: - - query - - filters + - query + - filters title: SearchInput RetrievalDataRepositorySearchResult: properties: @@ -2044,7 +2044,7 @@ components: $ref: "#/components/schemas/DataRepositoryWithDocuments" type: object required: - - dataRepository + - dataRepository title: DataRepositorySearchResult RetrievalPerFilterSearchResult: properties: @@ -2060,7 +2060,7 @@ components: default: [] type: object required: - - filterId + - filterId title: PerFilterSearchResult RetrievalPerFilterSearchResultWithError: properties: @@ -2069,7 +2069,7 @@ components: title: Message type: object required: - - message + - message title: PerFilterSearchResultError RetrievalSearchResults: properties: @@ -2077,13 +2077,13 @@ components: type: array items: anyOf: - - $ref: "#/components/schemas/RetrievalPerFilterSearchResult" - - $ref: "#/components/schemas/RetrievalPerFilterSearchResultWithError" + - $ref: "#/components/schemas/RetrievalPerFilterSearchResult" + - $ref: "#/components/schemas/RetrievalPerFilterSearchResultWithError" title: Results description: List of returned results. type: object required: - - results + - results title: SearchResults DataRepositorySearchResults: properties: @@ -2091,13 +2091,13 @@ components: type: array items: anyOf: - - $ref: "#/components/schemas/DataRepositoryPerFilterSearchResult" - - $ref: "#/components/schemas/PerFilterSearchResultWithError" + - $ref: "#/components/schemas/DataRepositoryPerFilterSearchResult" + - $ref: "#/components/schemas/PerFilterSearchResultWithError" title: Results description: List of returned results. type: object required: - - results + - results title: SearchResults ValidationError: properties: @@ -2114,9 +2114,9 @@ components: title: Error Type type: object required: - - loc - - msg - - type + - loc + - msg + - type title: ValidationError ### ### ######################## ### ### @@ -2221,4 +2221,4 @@ components: required: false schema: type: boolean - example: true + example: true \ No newline at end of file From 431b3a345ed746bf35248de35064fdafc148ab77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Mon, 14 Jul 2025 10:21:43 +0200 Subject: [PATCH 07/10] Address unfixed API change --- .../sdk/app/controllers/GroundingController.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java index 69d456f88..f2f8ff8c0 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java @@ -19,9 +19,13 @@ import com.sap.ai.sdk.grounding.model.DocumentKeyValueListPair; import com.sap.ai.sdk.grounding.model.DocumentWithoutChunks; import com.sap.ai.sdk.grounding.model.EmbeddingConfig; +import com.sap.ai.sdk.grounding.model.GetPipeline; import com.sap.ai.sdk.grounding.model.KeyValueListPair; +import com.sap.ai.sdk.grounding.model.MSSharePointPipelineGetResponse; import com.sap.ai.sdk.grounding.model.RetrievalSearchFilter; import com.sap.ai.sdk.grounding.model.RetrievalSearchInput; +import com.sap.ai.sdk.grounding.model.S3PipelineGetResponse; +import com.sap.ai.sdk.grounding.model.SFTPPipelineGetResponse; import com.sap.ai.sdk.grounding.model.SearchConfiguration; import com.sap.ai.sdk.grounding.model.TextOnlyBaseChunk; import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse; @@ -63,8 +67,15 @@ Object getAllPipelines( if ("json".equals(format)) { return pipelines; } - final var ids = List.of(); - // pipelines.getResources().stream().map(getPipeline::getId).collect(joining(", ")); + final var ids = new ArrayList<>(); + for (GetPipeline resource : pipelines.getResources()) { + switch (resource.getType().toString()) { + case "MSSharePoint" -> ids.add(((MSSharePointPipelineGetResponse) resource).getId()); + case "S3" -> ids.add(((S3PipelineGetResponse) resource).getId()); + case "SFTP" -> ids.add(((SFTPPipelineGetResponse) resource).getId()); + default -> log.warn("Unknown pipeline type: {}", resource.getType()); + } + } return "Found pipelines with ids: " + ids; } From 28db15a6c0f63b060cffd38c5fa31086fed5cc5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20D=C3=BCmont?= Date: Mon, 14 Jul 2025 11:16:03 +0200 Subject: [PATCH 08/10] Fix missing final --- .../com/sap/ai/sdk/app/controllers/GroundingController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java index f2f8ff8c0..9633c7fbf 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java @@ -68,7 +68,7 @@ Object getAllPipelines( return pipelines; } final var ids = new ArrayList<>(); - for (GetPipeline resource : pipelines.getResources()) { + for (final GetPipeline resource : pipelines.getResources()) { switch (resource.getType().toString()) { case "MSSharePoint" -> ids.add(((MSSharePointPipelineGetResponse) resource).getId()); case "S3" -> ids.add(((S3PipelineGetResponse) resource).getId()); From 92119209b37d3f22d63bb623b202efeecf2dbe07 Mon Sep 17 00:00:00 2001 From: I538344 Date: Mon, 14 Jul 2025 14:07:16 +0200 Subject: [PATCH 09/10] finito --- .../app/controllers/GroundingController.java | 8 +++++--- .../src/main/resources/static/index.html | 1 + .../ai/sdk/app/controllers/GroundingTest.java | 20 +++++++++++-------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java index 9633c7fbf..ffda583f5 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/GroundingController.java @@ -54,14 +54,16 @@ class GroundingController { private static final PipelinesApi CLIENT_PIPELINES = new GroundingClient().pipelines(); private static final RetrievalApi CLIENT_RETRIEVAL = new GroundingClient().retrieval(); private static final VectorApi CLIENT_VECTOR = new GroundingClient().vector(); - private static final String RESOURCE_GROUP = "ai-sdk-java-e2e"; + static final String RESOURCE_GROUP = "ai-sdk-java-e2e"; + static final String RESOURCE_GROUP_JS = "ai-sdk-js-e2e"; private static final String COLLECTION_TITLE = "ai-sdk-java-e2e-test"; /** Retrieve (up to 10) grounding pipeline entities. */ @GetMapping("/pipelines/list") Object getAllPipelines( - @Nullable @RequestParam(value = "format", required = false) final String format) { - final var pipelines = CLIENT_PIPELINES.getAllPipelines(RESOURCE_GROUP, 10, 0, true); + @Nullable @RequestParam(value = "format", required = false) final String format, + @Nonnull @RequestParam(value = "resource-group") final String resourceGroup) { + final var pipelines = CLIENT_PIPELINES.getAllPipelines(resourceGroup, 10, 0, true); log.info("Found {} pipelines", pipelines.getResources().size()); if ("json".equals(format)) { diff --git a/sample-code/spring-app/src/main/resources/static/index.html b/sample-code/spring-app/src/main/resources/static/index.html index 17e216c78..1e807a880 100644 --- a/sample-code/spring-app/src/main/resources/static/index.html +++ b/sample-code/spring-app/src/main/resources/static/index.html @@ -833,6 +833,7 @@

Document Grounding