diff --git a/.github/workflows/pr-lint.yaml b/.github/workflows/pr-lint.yaml index cd53b8d6d..eb9922098 100644 --- a/.github/workflows/pr-lint.yaml +++ b/.github/workflows/pr-lint.yaml @@ -24,6 +24,7 @@ jobs: Orchestration DevOps PromptRegistry + Grounding headerPattern: '^(\w.+): (?:\[(\w.+)\] )?(.+)$' headerPatternCorrespondence: type, scope, subject # for available types, check: 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 54377a57a..6c8cc4dc4 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 @@ -8,6 +8,7 @@ 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.ManualPipelineTrigger; import com.sap.ai.sdk.grounding.model.PipelineDocumentResponse; import com.sap.ai.sdk.grounding.model.PipelineId; import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; @@ -1002,4 +1003,72 @@ public GetPipelineStatus getPipelineStatus( localVarAuthNames, localVarReturnType); } + + /** + * Pipeline Trigger + * + *

Manually trigger a pipeline + * + *

202 - Accepted + * + *

400 - The specification of the resource was incorrect + * + * @param aiResourceGroup Resource Group ID + * @param manualPipelineTrigger The value for the parameter manualPipelineTrigger + * @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 manualTriggerPipeline( + @Nonnull final String aiResourceGroup, + @Nonnull final ManualPipelineTrigger manualPipelineTrigger) + throws OpenApiRequestException { + final Object localVarPostBody = manualPipelineTrigger; + + // verify the required parameter 'aiResourceGroup' is set + if (aiResourceGroup == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'aiResourceGroup' when calling manualTriggerPipeline"); + } + + // verify the required parameter 'manualPipelineTrigger' is set + if (manualPipelineTrigger == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'manualPipelineTrigger' when calling pipelineV1PipelineEndpointsTriggerPipeline"); + } + + final String localVarPath = + UriComponentsBuilder.fromPath("/pipelines/trigger").build().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 = {"application/json"}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + final String[] localVarAuthNames = new String[] {}; + + final ParameterizedTypeReference localVarReturnType = + new ParameterizedTypeReference() {}; + apiClient.invokeAPI( + localVarPath, + HttpMethod.POST, + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType); + return new OpenApiResponse(apiClient); + } } 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 085d949c7..3ebebbc31 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 @@ -9,8 +9,8 @@ import com.sap.ai.sdk.grounding.model.DocumentUpdateRequest; import com.sap.ai.sdk.grounding.model.Documents; import com.sap.ai.sdk.grounding.model.DocumentsListResponse; -import com.sap.ai.sdk.grounding.model.SearchResults; import com.sap.ai.sdk.grounding.model.TextSearchRequest; +import com.sap.ai.sdk.grounding.model.VectorSearchResults; import com.sap.ai.sdk.grounding.model.VectorV1VectorEndpointsGetCollectionCreationStatus200Response; import com.sap.ai.sdk.grounding.model.VectorV1VectorEndpointsGetCollectionDeletionStatus200Response; import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; @@ -914,11 +914,11 @@ public DocumentResponse getDocumentById( * * @param aiResourceGroup Resource Group ID * @param textSearchRequest The value for the parameter textSearchRequest - * @return SearchResults + * @return VectorSearchResults * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public SearchResults search( + public VectorSearchResults search( @Nonnull final String aiResourceGroup, @Nonnull final TextSearchRequest textSearchRequest) throws OpenApiRequestException { final Object localVarPostBody = textSearchRequest; @@ -954,8 +954,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/BaseDocument.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/BaseDocument.java index b23bfcf24..2691195fe 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 @@ -35,7 +35,7 @@ public class BaseDocument private List chunks = new ArrayList<>(); @JsonProperty("metadata") - private List metadata = new ArrayList<>(); + private List metadata = new ArrayList<>(); @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -96,7 +96,7 @@ public void setChunks(@Nonnull final List chunks) { * @return The same instance of this {@link BaseDocument} class */ @Nonnull - public BaseDocument metadata(@Nonnull final List metadata) { + public BaseDocument metadata(@Nonnull final List metadata) { this.metadata = metadata; return this; } @@ -108,7 +108,7 @@ public BaseDocument metadata(@Nonnull final List metad * @return The same instance of type {@link BaseDocument} */ @Nonnull - public BaseDocument addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { + public BaseDocument addMetadataItem(@Nonnull final VectorDocumentKeyValueListPair metadataItem) { if (this.metadata == null) { this.metadata = new ArrayList<>(); } @@ -122,7 +122,7 @@ public BaseDocument addMetadataItem(@Nonnull final DocumentKeyValueListPair meta * @return metadata The metadata of this {@link BaseDocument} instance. */ @Nonnull - public List getMetadata() { + public List getMetadata() { return metadata; } @@ -131,7 +131,7 @@ public List getMetadata() { * * @param metadata The metadata of this {@link BaseDocument} */ - public void setMetadata(@Nonnull final List metadata) { + public void setMetadata(@Nonnull final List metadata) { this.metadata = metadata; } @@ -270,7 +270,7 @@ public interface Builder1 { * @param metadata The metadata of this {@link BaseDocument} * @return The BaseDocument instance. */ - BaseDocument metadata(@Nonnull final List metadata); + BaseDocument metadata(@Nonnull final List metadata); /** * Set the metadata of this {@link BaseDocument} instance. @@ -278,7 +278,7 @@ public interface Builder1 { * @param metadata The metadata of this {@link BaseDocument} * @return The BaseDocument instance. */ - default BaseDocument metadata(@Nonnull final DocumentKeyValueListPair... metadata) { + default BaseDocument metadata(@Nonnull final VectorDocumentKeyValueListPair... metadata) { return metadata(Arrays.asList(metadata)); } } 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 e7eab9bed..a8a084385 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 @@ -38,7 +38,7 @@ public class Collection private EmbeddingConfig embeddingConfig; @JsonProperty("metadata") - private List metadata = new ArrayList<>(); + private List metadata = new ArrayList<>(); @JsonProperty("id") private UUID id; @@ -119,7 +119,7 @@ public void setEmbeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig) { * @return The same instance of this {@link Collection} class */ @Nonnull - public Collection metadata(@Nullable final List metadata) { + public Collection metadata(@Nullable final List metadata) { this.metadata = metadata; return this; } @@ -131,7 +131,7 @@ public Collection metadata(@Nullable final List metadata) { * @return The same instance of type {@link Collection} */ @Nonnull - public Collection addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + public Collection addMetadataItem(@Nonnull final VectorKeyValueListPair metadataItem) { if (this.metadata == null) { this.metadata = new ArrayList<>(); } @@ -145,7 +145,7 @@ public Collection addMetadataItem(@Nonnull final KeyValueListPair metadataItem) * @return metadata The metadata of this {@link Collection} instance. */ @Nonnull - public List getMetadata() { + public List getMetadata() { return metadata; } @@ -155,7 +155,7 @@ public List getMetadata() { * @param metadata Metadata attached to collection. Useful to restrict search to a subset of * collections. */ - public void setMetadata(@Nullable final List metadata) { + public void setMetadata(@Nullable final List metadata) { this.metadata = metadata; } 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 8826a7af0..78de8426b 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 @@ -37,7 +37,7 @@ public class CollectionRequest private EmbeddingConfig embeddingConfig; @JsonProperty("metadata") - private List metadata = new ArrayList<>(); + private List metadata = new ArrayList<>(); @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -116,7 +116,7 @@ public void setEmbeddingConfig(@Nonnull final EmbeddingConfig embeddingConfig) { * @return The same instance of this {@link CollectionRequest} class */ @Nonnull - public CollectionRequest metadata(@Nullable final List metadata) { + public CollectionRequest metadata(@Nullable final List metadata) { this.metadata = metadata; return this; } @@ -128,7 +128,7 @@ public CollectionRequest metadata(@Nullable final List metadat * @return The same instance of type {@link CollectionRequest} */ @Nonnull - public CollectionRequest addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + public CollectionRequest addMetadataItem(@Nonnull final VectorKeyValueListPair metadataItem) { if (this.metadata == null) { this.metadata = new ArrayList<>(); } @@ -142,7 +142,7 @@ public CollectionRequest addMetadataItem(@Nonnull final KeyValueListPair metadat * @return metadata The metadata of this {@link CollectionRequest} instance. */ @Nonnull - public List getMetadata() { + public List getMetadata() { return metadata; } @@ -152,7 +152,7 @@ public List getMetadata() { * @param metadata Metadata attached to collection. Useful to restrict search to a subset of * collections. */ - public void setMetadata(@Nullable final List metadata) { + public void setMetadata(@Nullable final List metadata) { this.metadata = metadata; } 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 index 17804cd51..e33734cb1 100644 --- 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 @@ -19,12 +19,18 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = MSSharePointPipelineCreateRequest.class, name = "MSSharePoint"), @JsonSubTypes.Type(value = S3PipelineCreateRequest.class, name = "S3"), + @JsonSubTypes.Type(value = SDMPipelineCreateRequest.class, name = "SDM"), @JsonSubTypes.Type(value = SFTPPipelineCreateRequest.class, name = "SFTP"), + @JsonSubTypes.Type(value = WorkZonePipelineCreateRequest.class, name = "WorkZone"), @JsonSubTypes.Type( value = MSSharePointPipelineCreateRequest.class, name = "MSSharePointPipelineCreateRequest"), @JsonSubTypes.Type(value = S3PipelineCreateRequest.class, name = "S3PipelineCreateRequest"), + @JsonSubTypes.Type(value = SDMPipelineCreateRequest.class, name = "SDMPipelineCreateRequest"), @JsonSubTypes.Type(value = SFTPPipelineCreateRequest.class, name = "SFTPPipelineCreateRequest"), + @JsonSubTypes.Type( + value = WorkZonePipelineCreateRequest.class, + name = "WorkZonePipelineCreateRequest"), }) public interface CreatePipeline { Object getType(); 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 a6e60689b..c1c195443 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 @@ -38,7 +38,7 @@ public class DataRepository private String title; @JsonProperty("metadata") - private List metadata = new ArrayList<>(); + private List metadata = new ArrayList<>(); @JsonProperty("type") private DataRepositoryType type; @@ -119,7 +119,7 @@ public void setTitle(@Nonnull final String title) { * @return The same instance of this {@link DataRepository} class */ @Nonnull - public DataRepository metadata(@Nullable final List metadata) { + public DataRepository metadata(@Nullable final List metadata) { this.metadata = metadata; return this; } @@ -131,7 +131,7 @@ public DataRepository metadata(@Nullable final List metadata) * @return The same instance of type {@link DataRepository} */ @Nonnull - public DataRepository addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + public DataRepository addMetadataItem(@Nonnull final RetrievalKeyValueListPair metadataItem) { if (this.metadata == null) { this.metadata = new ArrayList<>(); } @@ -146,7 +146,7 @@ public DataRepository addMetadataItem(@Nonnull final KeyValueListPair metadataIt * @return metadata The metadata of this {@link DataRepository} instance. */ @Nonnull - public List getMetadata() { + public List getMetadata() { return metadata; } @@ -156,7 +156,7 @@ public List getMetadata() { * @param metadata Metadata attached to DataRepository. Useful to later limit search to a subset * of DataRepositories. */ - public void setMetadata(@Nullable final List metadata) { + public void setMetadata(@Nullable final List metadata) { this.metadata = metadata; } 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 a305466e8..60e8049c7 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 ResultsInner2 resultsItem) { + public DataRepositorySearchResults addResultsItem(@Nonnull final ResultsInner3 resultsItem) { if (this.results == null) { this.results = new ArrayList<>(); } @@ -74,7 +74,7 @@ public DataRepositorySearchResults addResultsItem(@Nonnull final ResultsInner2 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 ResultsInner2... results) { + default DataRepositorySearchResults results(@Nonnull final ResultsInner3... results) { return results(Arrays.asList(results)); } } 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 b2dbc8cec..df951886e 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 @@ -39,7 +39,7 @@ public class DataRepositoryWithDocuments private String title; @JsonProperty("metadata") - private List metadata = new ArrayList<>(); + private List metadata = new ArrayList<>(); @JsonProperty("documents") private List documents = new ArrayList<>(); @@ -122,7 +122,8 @@ public void setTitle(@Nonnull final String title) { * @return The same instance of this {@link DataRepositoryWithDocuments} class */ @Nonnull - public DataRepositoryWithDocuments metadata(@Nullable final List metadata) { + public DataRepositoryWithDocuments metadata( + @Nullable final List metadata) { this.metadata = metadata; return this; } @@ -134,7 +135,8 @@ public DataRepositoryWithDocuments metadata(@Nullable final List(); } @@ -149,7 +151,7 @@ public DataRepositoryWithDocuments addMetadataItem(@Nonnull final KeyValueListPa * @return metadata The metadata of this {@link DataRepositoryWithDocuments} instance. */ @Nonnull - public List getMetadata() { + public List getMetadata() { return metadata; } @@ -159,7 +161,7 @@ public List getMetadata() { * @param metadata Metadata attached to DataRepository. Useful to later limit search to a subset * of DataRepositories. */ - public void setMetadata(@Nullable final List metadata) { + public void setMetadata(@Nullable final List metadata) { this.metadata = metadata; } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Document.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Document.java index f60c56b31..46bac5d58 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Document.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/Document.java @@ -35,10 +35,10 @@ public class Document private String id; @JsonProperty("metadata") - private List metadata = new ArrayList<>(); + private List metadata = new ArrayList<>(); @JsonProperty("chunks") - private List chunks = new ArrayList<>(); + private List chunks = new ArrayList<>(); @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -84,7 +84,7 @@ public void setId(@Nonnull final String id) { * @return The same instance of this {@link Document} class */ @Nonnull - public Document metadata(@Nullable final List metadata) { + public Document metadata(@Nullable final List metadata) { this.metadata = metadata; return this; } @@ -96,7 +96,7 @@ public Document metadata(@Nullable final List metadata * @return The same instance of type {@link Document} */ @Nonnull - public Document addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { + public Document addMetadataItem(@Nonnull final RetrievalDocumentKeyValueListPair metadataItem) { if (this.metadata == null) { this.metadata = new ArrayList<>(); } @@ -110,7 +110,7 @@ public Document addMetadataItem(@Nonnull final DocumentKeyValueListPair metadata * @return metadata The metadata of this {@link Document} instance. */ @Nonnull - public List getMetadata() { + public List getMetadata() { return metadata; } @@ -119,7 +119,7 @@ public List getMetadata() { * * @param metadata The metadata of this {@link Document} */ - public void setMetadata(@Nullable final List metadata) { + public void setMetadata(@Nullable final List metadata) { this.metadata = metadata; } @@ -130,7 +130,7 @@ public void setMetadata(@Nullable final List metadata) * @return The same instance of this {@link Document} class */ @Nonnull - public Document chunks(@Nonnull final List chunks) { + public Document chunks(@Nonnull final List chunks) { this.chunks = chunks; return this; } @@ -142,7 +142,7 @@ public Document chunks(@Nonnull final List chunks) { * @return The same instance of type {@link Document} */ @Nonnull - public Document addChunksItem(@Nonnull final Chunk chunksItem) { + public Document addChunksItem(@Nonnull final RetrievalChunk chunksItem) { if (this.chunks == null) { this.chunks = new ArrayList<>(); } @@ -156,7 +156,7 @@ public Document addChunksItem(@Nonnull final Chunk chunksItem) { * @return chunks The chunks of this {@link Document} instance. */ @Nonnull - public List getChunks() { + public List getChunks() { return chunks; } @@ -165,7 +165,7 @@ public List getChunks() { * * @param chunks The chunks of this {@link Document} */ - public void setChunks(@Nonnull final List chunks) { + public void setChunks(@Nonnull final List chunks) { this.chunks = chunks; } @@ -297,7 +297,7 @@ public interface Builder1 { * @param chunks The chunks of this {@link Document} * @return The Document instance. */ - Document chunks(@Nonnull final List chunks); + Document chunks(@Nonnull final List chunks); /** * Set the chunks of this {@link Document} instance. @@ -305,7 +305,7 @@ public interface Builder1 { * @param chunks The chunks of this {@link Document} * @return The Document instance. */ - default Document chunks(@Nonnull final Chunk... chunks) { + default Document chunks(@Nonnull final RetrievalChunk... chunks) { return chunks(Arrays.asList(chunks)); } } 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 95a55a1c2..e8d8937e6 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 @@ -36,7 +36,7 @@ public class DocumentInput private List chunks = new ArrayList<>(); @JsonProperty("metadata") - private List metadata = new ArrayList<>(); + private List metadata = new ArrayList<>(); @JsonProperty("id") private UUID id; @@ -100,7 +100,7 @@ public void setChunks(@Nonnull final List chunks) { * @return The same instance of this {@link DocumentInput} class */ @Nonnull - public DocumentInput metadata(@Nonnull final List metadata) { + public DocumentInput metadata(@Nonnull final List metadata) { this.metadata = metadata; return this; } @@ -112,7 +112,7 @@ public DocumentInput metadata(@Nonnull final List meta * @return The same instance of type {@link DocumentInput} */ @Nonnull - public DocumentInput addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { + public DocumentInput addMetadataItem(@Nonnull final VectorDocumentKeyValueListPair metadataItem) { if (this.metadata == null) { this.metadata = new ArrayList<>(); } @@ -126,7 +126,7 @@ public DocumentInput addMetadataItem(@Nonnull final DocumentKeyValueListPair met * @return metadata The metadata of this {@link DocumentInput} instance. */ @Nonnull - public List getMetadata() { + public List getMetadata() { return metadata; } @@ -135,7 +135,7 @@ public List getMetadata() { * * @param metadata The metadata of this {@link DocumentInput} */ - public void setMetadata(@Nonnull final List metadata) { + public void setMetadata(@Nonnull final List metadata) { this.metadata = metadata; } @@ -309,7 +309,7 @@ public interface Builder1 { * @param metadata The metadata of this {@link DocumentInput} * @return The DocumentInput builder. */ - Builder2 metadata(@Nonnull final List metadata); + Builder2 metadata(@Nonnull final List metadata); /** * Set the metadata of this {@link DocumentInput} instance. @@ -317,7 +317,7 @@ public interface Builder1 { * @param metadata The metadata of this {@link DocumentInput} * @return The DocumentInput builder. */ - default Builder2 metadata(@Nonnull final DocumentKeyValueListPair... metadata) { + default Builder2 metadata(@Nonnull final VectorDocumentKeyValueListPair... metadata) { return metadata(Arrays.asList(metadata)); } } 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 972994555..c651c03c6 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 @@ -36,10 +36,10 @@ public class DocumentOutput private UUID id; @JsonProperty("metadata") - private List metadata = new ArrayList<>(); + private List metadata = new ArrayList<>(); @JsonProperty("chunks") - private List chunks = new ArrayList<>(); + private List chunks = new ArrayList<>(); @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -85,7 +85,7 @@ public void setId(@Nonnull final UUID id) { * @return The same instance of this {@link DocumentOutput} class */ @Nonnull - public DocumentOutput metadata(@Nullable final List metadata) { + public DocumentOutput metadata(@Nullable final List metadata) { this.metadata = metadata; return this; } @@ -97,7 +97,8 @@ public DocumentOutput metadata(@Nullable final List me * @return The same instance of type {@link DocumentOutput} */ @Nonnull - public DocumentOutput addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { + public DocumentOutput addMetadataItem( + @Nonnull final VectorDocumentKeyValueListPair metadataItem) { if (this.metadata == null) { this.metadata = new ArrayList<>(); } @@ -111,7 +112,7 @@ public DocumentOutput addMetadataItem(@Nonnull final DocumentKeyValueListPair me * @return metadata The metadata of this {@link DocumentOutput} instance. */ @Nonnull - public List getMetadata() { + public List getMetadata() { return metadata; } @@ -120,7 +121,7 @@ public List getMetadata() { * * @param metadata The metadata of this {@link DocumentOutput} */ - public void setMetadata(@Nullable final List metadata) { + public void setMetadata(@Nullable final List metadata) { this.metadata = metadata; } @@ -131,7 +132,7 @@ public void setMetadata(@Nullable final List metadata) * @return The same instance of this {@link DocumentOutput} class */ @Nonnull - public DocumentOutput chunks(@Nonnull final List chunks) { + public DocumentOutput chunks(@Nonnull final List chunks) { this.chunks = chunks; return this; } @@ -143,7 +144,7 @@ public DocumentOutput chunks(@Nonnull final List chunks) { * @return The same instance of type {@link DocumentOutput} */ @Nonnull - public DocumentOutput addChunksItem(@Nonnull final Chunk chunksItem) { + public DocumentOutput addChunksItem(@Nonnull final VectorChunk chunksItem) { if (this.chunks == null) { this.chunks = new ArrayList<>(); } @@ -157,7 +158,7 @@ public DocumentOutput addChunksItem(@Nonnull final Chunk chunksItem) { * @return chunks The chunks of this {@link DocumentOutput} instance. */ @Nonnull - public List getChunks() { + public List getChunks() { return chunks; } @@ -166,7 +167,7 @@ public List getChunks() { * * @param chunks The chunks of this {@link DocumentOutput} */ - public void setChunks(@Nonnull final List chunks) { + public void setChunks(@Nonnull final List chunks) { this.chunks = chunks; } @@ -298,7 +299,7 @@ public interface Builder1 { * @param chunks The chunks of this {@link DocumentOutput} * @return The DocumentOutput instance. */ - DocumentOutput chunks(@Nonnull final List chunks); + DocumentOutput chunks(@Nonnull final List chunks); /** * Set the chunks of this {@link DocumentOutput} instance. @@ -306,7 +307,7 @@ public interface Builder1 { * @param chunks The chunks of this {@link DocumentOutput} * @return The DocumentOutput instance. */ - default DocumentOutput chunks(@Nonnull final Chunk... chunks) { + default DocumentOutput chunks(@Nonnull final VectorChunk... chunks) { return chunks(Arrays.asList(chunks)); } } 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 6c27f1ec8..6cad13430 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 @@ -36,7 +36,7 @@ public class DocumentResponse private List chunks = new ArrayList<>(); @JsonProperty("metadata") - private List metadata = new ArrayList<>(); + private List metadata = new ArrayList<>(); @JsonProperty("id") private UUID id; @@ -100,7 +100,7 @@ public void setChunks(@Nonnull final List chunks) { * @return The same instance of this {@link DocumentResponse} class */ @Nonnull - public DocumentResponse metadata(@Nonnull final List metadata) { + public DocumentResponse metadata(@Nonnull final List metadata) { this.metadata = metadata; return this; } @@ -112,7 +112,8 @@ public DocumentResponse metadata(@Nonnull final List m * @return The same instance of type {@link DocumentResponse} */ @Nonnull - public DocumentResponse addMetadataItem(@Nonnull final DocumentKeyValueListPair metadataItem) { + public DocumentResponse addMetadataItem( + @Nonnull final VectorDocumentKeyValueListPair metadataItem) { if (this.metadata == null) { this.metadata = new ArrayList<>(); } @@ -126,7 +127,7 @@ public DocumentResponse addMetadataItem(@Nonnull final DocumentKeyValueListPair * @return metadata The metadata of this {@link DocumentResponse} instance. */ @Nonnull - public List getMetadata() { + public List getMetadata() { return metadata; } @@ -135,7 +136,7 @@ public List getMetadata() { * * @param metadata The metadata of this {@link DocumentResponse} */ - public void setMetadata(@Nonnull final List metadata) { + public void setMetadata(@Nonnull final List metadata) { this.metadata = metadata; } @@ -309,7 +310,7 @@ public interface Builder1 { * @param metadata The metadata of this {@link DocumentResponse} * @return The DocumentResponse builder. */ - Builder2 metadata(@Nonnull final List metadata); + Builder2 metadata(@Nonnull final List metadata); /** * Set the metadata of this {@link DocumentResponse} instance. @@ -317,7 +318,7 @@ public interface Builder1 { * @param metadata The metadata of this {@link DocumentResponse} * @return The DocumentResponse builder. */ - default Builder2 metadata(@Nonnull final DocumentKeyValueListPair... metadata) { + default Builder2 metadata(@Nonnull final VectorDocumentKeyValueListPair... metadata) { return metadata(Arrays.asList(metadata)); } } 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 index cfbb1235c..b332a84c7 100644 --- 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 @@ -29,6 +29,8 @@ public enum DocumentStatus { FAILED_TO_BE_RETRIED("FAILED_TO_BE_RETRIED"), + TO_BE_SCHEDULED("TO_BE_SCHEDULED"), + 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/DocumentWithoutChunks.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/DocumentWithoutChunks.java index 524d54dbd..32a3f6401 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 @@ -33,7 +33,7 @@ public class DocumentWithoutChunks // CHECKSTYLE:ON { @JsonProperty("metadata") - private List metadata = new ArrayList<>(); + private List metadata = new ArrayList<>(); @JsonProperty("id") private UUID id; @@ -51,7 +51,8 @@ protected DocumentWithoutChunks() {} * @return The same instance of this {@link DocumentWithoutChunks} class */ @Nonnull - public DocumentWithoutChunks metadata(@Nonnull final List metadata) { + public DocumentWithoutChunks metadata( + @Nonnull final List metadata) { this.metadata = metadata; return this; } @@ -64,7 +65,7 @@ public DocumentWithoutChunks metadata(@Nonnull final List(); } @@ -78,7 +79,7 @@ public DocumentWithoutChunks addMetadataItem( * @return metadata The metadata of this {@link DocumentWithoutChunks} instance. */ @Nonnull - public List getMetadata() { + public List getMetadata() { return metadata; } @@ -87,7 +88,7 @@ public List getMetadata() { * * @param metadata The metadata of this {@link DocumentWithoutChunks} */ - public void setMetadata(@Nonnull final List metadata) { + public void setMetadata(@Nonnull final List metadata) { this.metadata = metadata; } @@ -237,7 +238,7 @@ public interface Builder { * @param metadata The metadata of this {@link DocumentWithoutChunks} * @return The DocumentWithoutChunks builder. */ - Builder1 metadata(@Nonnull final List metadata); + Builder1 metadata(@Nonnull final List metadata); /** * Set the metadata of this {@link DocumentWithoutChunks} instance. @@ -245,7 +246,7 @@ public interface Builder { * @param metadata The metadata of this {@link DocumentWithoutChunks} * @return The DocumentWithoutChunks builder. */ - default Builder1 metadata(@Nonnull final DocumentKeyValueListPair... metadata) { + default Builder1 metadata(@Nonnull final VectorDocumentKeyValueListPair... metadata) { return metadata(Arrays.asList(metadata)); } } 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 b79c0c891..aa5494086 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 @@ -39,7 +39,7 @@ public class DocumentsChunk private String title; @JsonProperty("metadata") - private List metadata = new ArrayList<>(); + private List metadata = new ArrayList<>(); @JsonProperty("documents") private List documents = new ArrayList<>(); @@ -119,7 +119,7 @@ public void setTitle(@Nonnull final String title) { * @return The same instance of this {@link DocumentsChunk} class */ @Nonnull - public DocumentsChunk metadata(@Nullable final List metadata) { + public DocumentsChunk metadata(@Nullable final List metadata) { this.metadata = metadata; return this; } @@ -131,7 +131,7 @@ public DocumentsChunk metadata(@Nullable final List metadata) * @return The same instance of type {@link DocumentsChunk} */ @Nonnull - public DocumentsChunk addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + public DocumentsChunk addMetadataItem(@Nonnull final VectorKeyValueListPair metadataItem) { if (this.metadata == null) { this.metadata = new ArrayList<>(); } @@ -145,7 +145,7 @@ public DocumentsChunk addMetadataItem(@Nonnull final KeyValueListPair metadataIt * @return metadata The metadata of this {@link DocumentsChunk} instance. */ @Nonnull - public List getMetadata() { + public List getMetadata() { return metadata; } @@ -154,7 +154,7 @@ public List getMetadata() { * * @param metadata The metadata of this {@link DocumentsChunk} */ - public void setMetadata(@Nullable final List metadata) { + public void setMetadata(@Nullable final List metadata) { this.metadata = metadata; } 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 index 5c9a182e1..f8ad868f2 100644 --- 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 @@ -34,6 +34,27 @@ public class DocumentsStatusResponseResourcesInner @JsonProperty("status") private DocumentStatus status; + @JsonProperty("viewLocation") + private String viewLocation; + + @JsonProperty("downloadLocation") + private String downloadLocation; + + @JsonProperty("absoluteUrl") + private String absoluteUrl; + + @JsonProperty("title") + private String title; + + @JsonProperty("metadataId") + private String metadataId; + + @JsonProperty("createdTimestamp") + private String createdTimestamp; + + @JsonProperty("lastUpdatedTimestamp") + private String lastUpdatedTimestamp; + @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -104,6 +125,245 @@ public void setStatus(@Nullable final DocumentStatus status) { this.status = status; } + /** + * Set the viewLocation of this {@link DocumentsStatusResponseResourcesInner} instance and return + * the same instance. + * + * @param viewLocation The viewLocation of this {@link DocumentsStatusResponseResourcesInner} + * @return The same instance of this {@link DocumentsStatusResponseResourcesInner} class + */ + @Nonnull + public DocumentsStatusResponseResourcesInner viewLocation(@Nullable final String viewLocation) { + this.viewLocation = viewLocation; + return this; + } + + /** + * Get viewLocation + * + * @return viewLocation The viewLocation of this {@link DocumentsStatusResponseResourcesInner} + * instance. + */ + @Nullable + public String getViewLocation() { + return viewLocation; + } + + /** + * Set the viewLocation of this {@link DocumentsStatusResponseResourcesInner} instance. + * + * @param viewLocation The viewLocation of this {@link DocumentsStatusResponseResourcesInner} + */ + public void setViewLocation(@Nullable final String viewLocation) { + this.viewLocation = viewLocation; + } + + /** + * Set the downloadLocation of this {@link DocumentsStatusResponseResourcesInner} instance and + * return the same instance. + * + * @param downloadLocation The downloadLocation of this {@link + * DocumentsStatusResponseResourcesInner} + * @return The same instance of this {@link DocumentsStatusResponseResourcesInner} class + */ + @Nonnull + public DocumentsStatusResponseResourcesInner downloadLocation( + @Nullable final String downloadLocation) { + this.downloadLocation = downloadLocation; + return this; + } + + /** + * Get downloadLocation + * + * @return downloadLocation The downloadLocation of this {@link + * DocumentsStatusResponseResourcesInner} instance. + */ + @Nullable + public String getDownloadLocation() { + return downloadLocation; + } + + /** + * Set the downloadLocation of this {@link DocumentsStatusResponseResourcesInner} instance. + * + * @param downloadLocation The downloadLocation of this {@link + * DocumentsStatusResponseResourcesInner} + */ + public void setDownloadLocation(@Nullable final String downloadLocation) { + this.downloadLocation = downloadLocation; + } + + /** + * Set the absoluteUrl of this {@link DocumentsStatusResponseResourcesInner} instance and return + * the same instance. + * + * @param absoluteUrl The absoluteUrl of this {@link DocumentsStatusResponseResourcesInner} + * @return The same instance of this {@link DocumentsStatusResponseResourcesInner} class + */ + @Nonnull + public DocumentsStatusResponseResourcesInner absoluteUrl(@Nullable final String absoluteUrl) { + this.absoluteUrl = absoluteUrl; + return this; + } + + /** + * Get absoluteUrl + * + * @return absoluteUrl The absoluteUrl of this {@link DocumentsStatusResponseResourcesInner} + * instance. + */ + @Nullable + public String getAbsoluteUrl() { + return absoluteUrl; + } + + /** + * Set the absoluteUrl of this {@link DocumentsStatusResponseResourcesInner} instance. + * + * @param absoluteUrl The absoluteUrl of this {@link DocumentsStatusResponseResourcesInner} + */ + public void setAbsoluteUrl(@Nullable final String absoluteUrl) { + this.absoluteUrl = absoluteUrl; + } + + /** + * Set the title of this {@link DocumentsStatusResponseResourcesInner} instance and return the + * same instance. + * + * @param title The title of this {@link DocumentsStatusResponseResourcesInner} + * @return The same instance of this {@link DocumentsStatusResponseResourcesInner} class + */ + @Nonnull + public DocumentsStatusResponseResourcesInner title(@Nullable final String title) { + this.title = title; + return this; + } + + /** + * Get title + * + * @return title The title of this {@link DocumentsStatusResponseResourcesInner} instance. + */ + @Nullable + public String getTitle() { + return title; + } + + /** + * Set the title of this {@link DocumentsStatusResponseResourcesInner} instance. + * + * @param title The title of this {@link DocumentsStatusResponseResourcesInner} + */ + public void setTitle(@Nullable final String title) { + this.title = title; + } + + /** + * Set the metadataId of this {@link DocumentsStatusResponseResourcesInner} instance and return + * the same instance. + * + * @param metadataId The metadataId of this {@link DocumentsStatusResponseResourcesInner} + * @return The same instance of this {@link DocumentsStatusResponseResourcesInner} class + */ + @Nonnull + public DocumentsStatusResponseResourcesInner metadataId(@Nullable final String metadataId) { + this.metadataId = metadataId; + return this; + } + + /** + * Get metadataId + * + * @return metadataId The metadataId of this {@link DocumentsStatusResponseResourcesInner} + * instance. + */ + @Nullable + public String getMetadataId() { + return metadataId; + } + + /** + * Set the metadataId of this {@link DocumentsStatusResponseResourcesInner} instance. + * + * @param metadataId The metadataId of this {@link DocumentsStatusResponseResourcesInner} + */ + public void setMetadataId(@Nullable final String metadataId) { + this.metadataId = metadataId; + } + + /** + * Set the createdTimestamp of this {@link DocumentsStatusResponseResourcesInner} instance and + * return the same instance. + * + * @param createdTimestamp The createdTimestamp of this {@link + * DocumentsStatusResponseResourcesInner} + * @return The same instance of this {@link DocumentsStatusResponseResourcesInner} class + */ + @Nonnull + public DocumentsStatusResponseResourcesInner createdTimestamp( + @Nullable final String createdTimestamp) { + this.createdTimestamp = createdTimestamp; + return this; + } + + /** + * Get createdTimestamp + * + * @return createdTimestamp The createdTimestamp of this {@link + * DocumentsStatusResponseResourcesInner} instance. + */ + @Nonnull + public String getCreatedTimestamp() { + return createdTimestamp; + } + + /** + * Set the createdTimestamp of this {@link DocumentsStatusResponseResourcesInner} instance. + * + * @param createdTimestamp The createdTimestamp of this {@link + * DocumentsStatusResponseResourcesInner} + */ + public void setCreatedTimestamp(@Nullable final String createdTimestamp) { + this.createdTimestamp = createdTimestamp; + } + + /** + * Set the lastUpdatedTimestamp of this {@link DocumentsStatusResponseResourcesInner} instance and + * return the same instance. + * + * @param lastUpdatedTimestamp The lastUpdatedTimestamp of this {@link + * DocumentsStatusResponseResourcesInner} + * @return The same instance of this {@link DocumentsStatusResponseResourcesInner} class + */ + @Nonnull + public DocumentsStatusResponseResourcesInner lastUpdatedTimestamp( + @Nullable final String lastUpdatedTimestamp) { + this.lastUpdatedTimestamp = lastUpdatedTimestamp; + return this; + } + + /** + * Get lastUpdatedTimestamp + * + * @return lastUpdatedTimestamp The lastUpdatedTimestamp of this {@link + * DocumentsStatusResponseResourcesInner} instance. + */ + @Nonnull + public String getLastUpdatedTimestamp() { + return lastUpdatedTimestamp; + } + + /** + * Set the lastUpdatedTimestamp of this {@link DocumentsStatusResponseResourcesInner} instance. + * + * @param lastUpdatedTimestamp The lastUpdatedTimestamp of this {@link + * DocumentsStatusResponseResourcesInner} + */ + public void setLastUpdatedTimestamp(@Nullable final String lastUpdatedTimestamp) { + this.lastUpdatedTimestamp = lastUpdatedTimestamp; + } + /** * Get the names of the unrecognizable properties of the {@link * DocumentsStatusResponseResourcesInner}. @@ -147,6 +407,14 @@ public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); if (id != null) declaredFields.put("id", id); if (status != null) declaredFields.put("status", status); + if (viewLocation != null) declaredFields.put("viewLocation", viewLocation); + if (downloadLocation != null) declaredFields.put("downloadLocation", downloadLocation); + if (absoluteUrl != null) declaredFields.put("absoluteUrl", absoluteUrl); + if (title != null) declaredFields.put("title", title); + if (metadataId != null) declaredFields.put("metadataId", metadataId); + if (createdTimestamp != null) declaredFields.put("createdTimestamp", createdTimestamp); + if (lastUpdatedTimestamp != null) + declaredFields.put("lastUpdatedTimestamp", lastUpdatedTimestamp); return declaredFields; } @@ -176,12 +444,32 @@ public boolean equals(@Nullable final java.lang.Object o) { return Objects.equals( this.cloudSdkCustomFields, documentsStatusResponseResourcesInner.cloudSdkCustomFields) && Objects.equals(this.id, documentsStatusResponseResourcesInner.id) - && Objects.equals(this.status, documentsStatusResponseResourcesInner.status); + && Objects.equals(this.status, documentsStatusResponseResourcesInner.status) + && Objects.equals(this.viewLocation, documentsStatusResponseResourcesInner.viewLocation) + && Objects.equals( + this.downloadLocation, documentsStatusResponseResourcesInner.downloadLocation) + && Objects.equals(this.absoluteUrl, documentsStatusResponseResourcesInner.absoluteUrl) + && Objects.equals(this.title, documentsStatusResponseResourcesInner.title) + && Objects.equals(this.metadataId, documentsStatusResponseResourcesInner.metadataId) + && Objects.equals( + this.createdTimestamp, documentsStatusResponseResourcesInner.createdTimestamp) + && Objects.equals( + this.lastUpdatedTimestamp, documentsStatusResponseResourcesInner.lastUpdatedTimestamp); } @Override public int hashCode() { - return Objects.hash(id, status, cloudSdkCustomFields); + return Objects.hash( + id, + status, + viewLocation, + downloadLocation, + absoluteUrl, + title, + metadataId, + createdTimestamp, + lastUpdatedTimestamp, + cloudSdkCustomFields); } @Override @@ -191,6 +479,15 @@ public String toString() { sb.append("class DocumentsStatusResponseResourcesInner {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" viewLocation: ").append(toIndentedString(viewLocation)).append("\n"); + sb.append(" downloadLocation: ").append(toIndentedString(downloadLocation)).append("\n"); + sb.append(" absoluteUrl: ").append(toIndentedString(absoluteUrl)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" metadataId: ").append(toIndentedString(metadataId)).append("\n"); + sb.append(" createdTimestamp: ").append(toIndentedString(createdTimestamp)).append("\n"); + sb.append(" lastUpdatedTimestamp: ") + .append(toIndentedString(lastUpdatedTimestamp)) + .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/GetPipeline.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/GetPipeline.java index 8eb624ce7..d4ff3f099 100644 --- 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 @@ -19,12 +19,18 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = MSSharePointPipelineGetResponse.class, name = "MSSharePoint"), @JsonSubTypes.Type(value = S3PipelineGetResponse.class, name = "S3"), + @JsonSubTypes.Type(value = SDMPipelineGetResponse.class, name = "SDM"), @JsonSubTypes.Type(value = SFTPPipelineGetResponse.class, name = "SFTP"), + @JsonSubTypes.Type(value = WorkZonePipelineGetResponse.class, name = "WorkZone"), @JsonSubTypes.Type( value = MSSharePointPipelineGetResponse.class, name = "MSSharePointPipelineGetResponse"), @JsonSubTypes.Type(value = S3PipelineGetResponse.class, name = "S3PipelineGetResponse"), + @JsonSubTypes.Type(value = SDMPipelineGetResponse.class, name = "SDMPipelineGetResponse"), @JsonSubTypes.Type(value = SFTPPipelineGetResponse.class, name = "SFTPPipelineGetResponse"), + @JsonSubTypes.Type( + value = WorkZonePipelineGetResponse.class, + name = "WorkZonePipelineGetResponse"), }) public interface GetPipeline { Object getType(); 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 index fb54a8ccf..bbd250c3b 100644 --- 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 @@ -31,6 +31,12 @@ public class GetPipelineStatus @JsonProperty("lastStarted") private String lastStarted; + @JsonProperty("createdAt") + private String createdAt; + + @JsonProperty("lastCompletedAt") + private String lastCompletedAt; + @JsonProperty("status") private PipelineExecutionStatus status; @@ -71,6 +77,69 @@ public void setLastStarted(@Nullable final String lastStarted) { this.lastStarted = lastStarted; } + /** + * Set the createdAt of this {@link GetPipelineStatus} instance and return the same instance. + * + * @param createdAt The createdAt of this {@link GetPipelineStatus} + * @return The same instance of this {@link GetPipelineStatus} class + */ + @Nonnull + public GetPipelineStatus createdAt(@Nullable final String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * + * @return createdAt The createdAt of this {@link GetPipelineStatus} instance. + */ + @Nullable + public String getCreatedAt() { + return createdAt; + } + + /** + * Set the createdAt of this {@link GetPipelineStatus} instance. + * + * @param createdAt The createdAt of this {@link GetPipelineStatus} + */ + public void setCreatedAt(@Nullable final String createdAt) { + this.createdAt = createdAt; + } + + /** + * Set the lastCompletedAt of this {@link GetPipelineStatus} instance and return the same + * instance. + * + * @param lastCompletedAt The lastCompletedAt of this {@link GetPipelineStatus} + * @return The same instance of this {@link GetPipelineStatus} class + */ + @Nonnull + public GetPipelineStatus lastCompletedAt(@Nullable final String lastCompletedAt) { + this.lastCompletedAt = lastCompletedAt; + return this; + } + + /** + * Get lastCompletedAt + * + * @return lastCompletedAt The lastCompletedAt of this {@link GetPipelineStatus} instance. + */ + @Nullable + public String getLastCompletedAt() { + return lastCompletedAt; + } + + /** + * Set the lastCompletedAt of this {@link GetPipelineStatus} instance. + * + * @param lastCompletedAt The lastCompletedAt of this {@link GetPipelineStatus} + */ + public void setLastCompletedAt(@Nullable final String lastCompletedAt) { + this.lastCompletedAt = lastCompletedAt; + } + /** * Set the status of this {@link GetPipelineStatus} instance and return the same instance. * @@ -141,6 +210,8 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); if (lastStarted != null) declaredFields.put("lastStarted", lastStarted); + if (createdAt != null) declaredFields.put("createdAt", createdAt); + if (lastCompletedAt != null) declaredFields.put("lastCompletedAt", lastCompletedAt); if (status != null) declaredFields.put("status", status); return declaredFields; } @@ -168,12 +239,14 @@ public boolean equals(@Nullable final java.lang.Object o) { final GetPipelineStatus getPipelineStatus = (GetPipelineStatus) o; return Objects.equals(this.cloudSdkCustomFields, getPipelineStatus.cloudSdkCustomFields) && Objects.equals(this.lastStarted, getPipelineStatus.lastStarted) + && Objects.equals(this.createdAt, getPipelineStatus.createdAt) + && Objects.equals(this.lastCompletedAt, getPipelineStatus.lastCompletedAt) && Objects.equals(this.status, getPipelineStatus.status); } @Override public int hashCode() { - return Objects.hash(lastStarted, status, cloudSdkCustomFields); + return Objects.hash(lastStarted, createdAt, lastCompletedAt, status, cloudSdkCustomFields); } @Override @@ -182,6 +255,8 @@ public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class GetPipelineStatus {\n"); sb.append(" lastStarted: ").append(toIndentedString(lastStarted)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" lastCompletedAt: ").append(toIndentedString(lastCompletedAt)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ManualPipelineTrigger.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ManualPipelineTrigger.java new file mode 100644 index 000000000..696c3e563 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ManualPipelineTrigger.java @@ -0,0 +1,171 @@ +/* + * 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; + +/** ManualPipelineTrigger */ +// CHECKSTYLE:OFF +public class ManualPipelineTrigger +// CHECKSTYLE:ON +{ + @JsonProperty("pipelineId") + private String pipelineId; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ManualPipelineTrigger. */ + protected ManualPipelineTrigger() {} + + /** + * Set the pipelineId of this {@link ManualPipelineTrigger} instance and return the same instance. + * + * @param pipelineId The pipelineId of this {@link ManualPipelineTrigger} + * @return The same instance of this {@link ManualPipelineTrigger} class + */ + @Nonnull + public ManualPipelineTrigger pipelineId(@Nullable final String pipelineId) { + this.pipelineId = pipelineId; + return this; + } + + /** + * Get pipelineId + * + * @return pipelineId The pipelineId of this {@link ManualPipelineTrigger} instance. + */ + @Nonnull + public String getPipelineId() { + return pipelineId; + } + + /** + * Set the pipelineId of this {@link ManualPipelineTrigger} instance. + * + * @param pipelineId The pipelineId of this {@link ManualPipelineTrigger} + */ + public void setPipelineId(@Nullable final String pipelineId) { + this.pipelineId = pipelineId; + } + + /** + * Get the names of the unrecognizable properties of the {@link ManualPipelineTrigger}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ManualPipelineTrigger} 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( + "ManualPipelineTrigger has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link ManualPipelineTrigger} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (pipelineId != null) declaredFields.put("pipelineId", pipelineId); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link ManualPipelineTrigger} 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 ManualPipelineTrigger manualPipelineTrigger = (ManualPipelineTrigger) o; + return Objects.equals(this.cloudSdkCustomFields, manualPipelineTrigger.cloudSdkCustomFields) + && Objects.equals(this.pipelineId, manualPipelineTrigger.pipelineId); + } + + @Override + public int hashCode() { + return Objects.hash(pipelineId, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ManualPipelineTrigger {\n"); + sb.append(" pipelineId: ").append(toIndentedString(pipelineId)).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 ManualPipelineTrigger} instance. No arguments are required. */ + public static ManualPipelineTrigger create() { + return new ManualPipelineTrigger(); + } +} 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 index 61fb9653c..2456089fa 100644 --- 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 @@ -31,18 +31,30 @@ public class PipelineDocumentResponse @JsonProperty("id") private String id; + @JsonProperty("status") + private DocumentStatus status; + @JsonProperty("viewLocation") private String viewLocation; @JsonProperty("downloadLocation") private String downloadLocation; + @JsonProperty("absoluteUrl") + private String absoluteUrl; + + @JsonProperty("title") + private String title; + + @JsonProperty("metadataId") + private String metadataId; + + @JsonProperty("createdTimestamp") + private String createdTimestamp; + @JsonProperty("lastUpdatedTimestamp") private String lastUpdatedTimestamp; - @JsonProperty("status") - private DocumentStatus status; - @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -80,6 +92,37 @@ public void setId(@Nullable final String id) { this.id = id; } + /** + * 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; + } + /** * Set the viewLocation of this {@link PipelineDocumentResponse} instance and return the same * instance. @@ -146,68 +189,165 @@ public void setDownloadLocation(@Nullable final String downloadLocation) { } /** - * Set the lastUpdatedTimestamp of this {@link PipelineDocumentResponse} instance and return the - * same instance. + * Set the absoluteUrl of this {@link PipelineDocumentResponse} instance and return the same + * instance. * - * @param lastUpdatedTimestamp The lastUpdatedTimestamp of this {@link PipelineDocumentResponse} + * @param absoluteUrl The absoluteUrl of this {@link PipelineDocumentResponse} * @return The same instance of this {@link PipelineDocumentResponse} class */ @Nonnull - public PipelineDocumentResponse lastUpdatedTimestamp( - @Nullable final String lastUpdatedTimestamp) { - this.lastUpdatedTimestamp = lastUpdatedTimestamp; + public PipelineDocumentResponse absoluteUrl(@Nullable final String absoluteUrl) { + this.absoluteUrl = absoluteUrl; return this; } /** - * Get lastUpdatedTimestamp + * Get absoluteUrl * - * @return lastUpdatedTimestamp The lastUpdatedTimestamp of this {@link PipelineDocumentResponse} + * @return absoluteUrl The absoluteUrl of this {@link PipelineDocumentResponse} instance. + */ + @Nullable + public String getAbsoluteUrl() { + return absoluteUrl; + } + + /** + * Set the absoluteUrl of this {@link PipelineDocumentResponse} instance. + * + * @param absoluteUrl The absoluteUrl of this {@link PipelineDocumentResponse} + */ + public void setAbsoluteUrl(@Nullable final String absoluteUrl) { + this.absoluteUrl = absoluteUrl; + } + + /** + * Set the title of this {@link PipelineDocumentResponse} instance and return the same instance. + * + * @param title The title of this {@link PipelineDocumentResponse} + * @return The same instance of this {@link PipelineDocumentResponse} class + */ + @Nonnull + public PipelineDocumentResponse title(@Nullable final String title) { + this.title = title; + return this; + } + + /** + * Get title + * + * @return title The title of this {@link PipelineDocumentResponse} instance. + */ + @Nullable + public String getTitle() { + return title; + } + + /** + * Set the title of this {@link PipelineDocumentResponse} instance. + * + * @param title The title of this {@link PipelineDocumentResponse} + */ + public void setTitle(@Nullable final String title) { + this.title = title; + } + + /** + * Set the metadataId of this {@link PipelineDocumentResponse} instance and return the same + * instance. + * + * @param metadataId The metadataId of this {@link PipelineDocumentResponse} + * @return The same instance of this {@link PipelineDocumentResponse} class + */ + @Nonnull + public PipelineDocumentResponse metadataId(@Nullable final String metadataId) { + this.metadataId = metadataId; + return this; + } + + /** + * Get metadataId + * + * @return metadataId The metadataId of this {@link PipelineDocumentResponse} instance. + */ + @Nullable + public String getMetadataId() { + return metadataId; + } + + /** + * Set the metadataId of this {@link PipelineDocumentResponse} instance. + * + * @param metadataId The metadataId of this {@link PipelineDocumentResponse} + */ + public void setMetadataId(@Nullable final String metadataId) { + this.metadataId = metadataId; + } + + /** + * Set the createdTimestamp of this {@link PipelineDocumentResponse} instance and return the same + * instance. + * + * @param createdTimestamp The createdTimestamp of this {@link PipelineDocumentResponse} + * @return The same instance of this {@link PipelineDocumentResponse} class + */ + @Nonnull + public PipelineDocumentResponse createdTimestamp(@Nullable final String createdTimestamp) { + this.createdTimestamp = createdTimestamp; + return this; + } + + /** + * Get createdTimestamp + * + * @return createdTimestamp The createdTimestamp of this {@link PipelineDocumentResponse} * instance. */ @Nonnull - public String getLastUpdatedTimestamp() { - return lastUpdatedTimestamp; + public String getCreatedTimestamp() { + return createdTimestamp; } /** - * Set the lastUpdatedTimestamp of this {@link PipelineDocumentResponse} instance. + * Set the createdTimestamp of this {@link PipelineDocumentResponse} instance. * - * @param lastUpdatedTimestamp The lastUpdatedTimestamp of this {@link PipelineDocumentResponse} + * @param createdTimestamp The createdTimestamp of this {@link PipelineDocumentResponse} */ - public void setLastUpdatedTimestamp(@Nullable final String lastUpdatedTimestamp) { - this.lastUpdatedTimestamp = lastUpdatedTimestamp; + public void setCreatedTimestamp(@Nullable final String createdTimestamp) { + this.createdTimestamp = createdTimestamp; } /** - * Set the status of this {@link PipelineDocumentResponse} instance and return the same instance. + * Set the lastUpdatedTimestamp of this {@link PipelineDocumentResponse} instance and return the + * same instance. * - * @param status The status of this {@link PipelineDocumentResponse} + * @param lastUpdatedTimestamp The lastUpdatedTimestamp of this {@link PipelineDocumentResponse} * @return The same instance of this {@link PipelineDocumentResponse} class */ @Nonnull - public PipelineDocumentResponse status(@Nullable final DocumentStatus status) { - this.status = status; + public PipelineDocumentResponse lastUpdatedTimestamp( + @Nullable final String lastUpdatedTimestamp) { + this.lastUpdatedTimestamp = lastUpdatedTimestamp; return this; } /** - * Get status + * Get lastUpdatedTimestamp * - * @return status The status of this {@link PipelineDocumentResponse} instance. + * @return lastUpdatedTimestamp The lastUpdatedTimestamp of this {@link PipelineDocumentResponse} + * instance. */ @Nonnull - public DocumentStatus getStatus() { - return status; + public String getLastUpdatedTimestamp() { + return lastUpdatedTimestamp; } /** - * Set the status of this {@link PipelineDocumentResponse} instance. + * Set the lastUpdatedTimestamp of this {@link PipelineDocumentResponse} instance. * - * @param status The status of this {@link PipelineDocumentResponse} + * @param lastUpdatedTimestamp The lastUpdatedTimestamp of this {@link PipelineDocumentResponse} */ - public void setStatus(@Nullable final DocumentStatus status) { - this.status = status; + public void setLastUpdatedTimestamp(@Nullable final String lastUpdatedTimestamp) { + this.lastUpdatedTimestamp = lastUpdatedTimestamp; } /** @@ -250,11 +390,15 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); if (id != null) declaredFields.put("id", id); + if (status != null) declaredFields.put("status", status); if (viewLocation != null) declaredFields.put("viewLocation", viewLocation); if (downloadLocation != null) declaredFields.put("downloadLocation", downloadLocation); + if (absoluteUrl != null) declaredFields.put("absoluteUrl", absoluteUrl); + if (title != null) declaredFields.put("title", title); + if (metadataId != null) declaredFields.put("metadataId", metadataId); + if (createdTimestamp != null) declaredFields.put("createdTimestamp", createdTimestamp); if (lastUpdatedTimestamp != null) declaredFields.put("lastUpdatedTimestamp", lastUpdatedTimestamp); - if (status != null) declaredFields.put("status", status); return declaredFields; } @@ -281,16 +425,29 @@ public boolean equals(@Nullable final java.lang.Object o) { final PipelineDocumentResponse pipelineDocumentResponse = (PipelineDocumentResponse) o; return Objects.equals(this.cloudSdkCustomFields, pipelineDocumentResponse.cloudSdkCustomFields) && Objects.equals(this.id, pipelineDocumentResponse.id) + && Objects.equals(this.status, pipelineDocumentResponse.status) && Objects.equals(this.viewLocation, pipelineDocumentResponse.viewLocation) && Objects.equals(this.downloadLocation, pipelineDocumentResponse.downloadLocation) - && Objects.equals(this.lastUpdatedTimestamp, pipelineDocumentResponse.lastUpdatedTimestamp) - && Objects.equals(this.status, pipelineDocumentResponse.status); + && Objects.equals(this.absoluteUrl, pipelineDocumentResponse.absoluteUrl) + && Objects.equals(this.title, pipelineDocumentResponse.title) + && Objects.equals(this.metadataId, pipelineDocumentResponse.metadataId) + && Objects.equals(this.createdTimestamp, pipelineDocumentResponse.createdTimestamp) + && Objects.equals(this.lastUpdatedTimestamp, pipelineDocumentResponse.lastUpdatedTimestamp); } @Override public int hashCode() { return Objects.hash( - id, viewLocation, downloadLocation, lastUpdatedTimestamp, status, cloudSdkCustomFields); + id, + status, + viewLocation, + downloadLocation, + absoluteUrl, + title, + metadataId, + createdTimestamp, + lastUpdatedTimestamp, + cloudSdkCustomFields); } @Override @@ -299,12 +456,16 @@ public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class PipelineDocumentResponse {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" viewLocation: ").append(toIndentedString(viewLocation)).append("\n"); sb.append(" downloadLocation: ").append(toIndentedString(downloadLocation)).append("\n"); + sb.append(" absoluteUrl: ").append(toIndentedString(absoluteUrl)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" metadataId: ").append(toIndentedString(metadataId)).append("\n"); + sb.append(" createdTimestamp: ").append(toIndentedString(createdTimestamp)).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")); 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 index 195ea2f82..38f8724d6 100644 --- 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 @@ -34,6 +34,12 @@ public class PipelineExecutionData @JsonProperty("status") private PipelineExecutionStatus status; + @JsonProperty("createdAt") + private String createdAt; + + @JsonProperty("modifiedAt") + private String modifiedAt; + @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -102,6 +108,68 @@ public void setStatus(@Nullable final PipelineExecutionStatus status) { this.status = status; } + /** + * Set the createdAt of this {@link PipelineExecutionData} instance and return the same instance. + * + * @param createdAt The createdAt of this {@link PipelineExecutionData} + * @return The same instance of this {@link PipelineExecutionData} class + */ + @Nonnull + public PipelineExecutionData createdAt(@Nullable final String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * + * @return createdAt The createdAt of this {@link PipelineExecutionData} instance. + */ + @Nullable + public String getCreatedAt() { + return createdAt; + } + + /** + * Set the createdAt of this {@link PipelineExecutionData} instance. + * + * @param createdAt The createdAt of this {@link PipelineExecutionData} + */ + public void setCreatedAt(@Nullable final String createdAt) { + this.createdAt = createdAt; + } + + /** + * Set the modifiedAt of this {@link PipelineExecutionData} instance and return the same instance. + * + * @param modifiedAt The modifiedAt of this {@link PipelineExecutionData} + * @return The same instance of this {@link PipelineExecutionData} class + */ + @Nonnull + public PipelineExecutionData modifiedAt(@Nullable final String modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Get modifiedAt + * + * @return modifiedAt The modifiedAt of this {@link PipelineExecutionData} instance. + */ + @Nullable + public String getModifiedAt() { + return modifiedAt; + } + + /** + * Set the modifiedAt of this {@link PipelineExecutionData} instance. + * + * @param modifiedAt The modifiedAt of this {@link PipelineExecutionData} + */ + public void setModifiedAt(@Nullable final String modifiedAt) { + this.modifiedAt = modifiedAt; + } + /** * Get the names of the unrecognizable properties of the {@link PipelineExecutionData}. * @@ -143,6 +211,8 @@ public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); if (id != null) declaredFields.put("id", id); if (status != null) declaredFields.put("status", status); + if (createdAt != null) declaredFields.put("createdAt", createdAt); + if (modifiedAt != null) declaredFields.put("modifiedAt", modifiedAt); return declaredFields; } @@ -169,12 +239,14 @@ public boolean equals(@Nullable final java.lang.Object o) { final PipelineExecutionData pipelineExecutionData = (PipelineExecutionData) o; return Objects.equals(this.cloudSdkCustomFields, pipelineExecutionData.cloudSdkCustomFields) && Objects.equals(this.id, pipelineExecutionData.id) - && Objects.equals(this.status, pipelineExecutionData.status); + && Objects.equals(this.status, pipelineExecutionData.status) + && Objects.equals(this.createdAt, pipelineExecutionData.createdAt) + && Objects.equals(this.modifiedAt, pipelineExecutionData.modifiedAt); } @Override public int hashCode() { - return Objects.hash(id, status, cloudSdkCustomFields); + return Objects.hash(id, status, createdAt, modifiedAt, cloudSdkCustomFields); } @Override @@ -184,6 +256,8 @@ public String toString() { sb.append("class PipelineExecutionData {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).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/ResultsInner1.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner1.java index af2b069df..530a118f4 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 @@ -16,6 +16,7 @@ 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; @@ -34,10 +35,7 @@ public class ResultsInner1 private String filterId; @JsonProperty("results") - private List results = new ArrayList<>(); - - @JsonProperty("message") - private String message; + private List results = new ArrayList<>(); @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -79,11 +77,11 @@ public void setFilterId(@Nonnull final String filterId) { /** * Set the results of this {@link ResultsInner1} instance and return the same instance. * - * @param results List of returned results. + * @param results The results of this {@link ResultsInner1} * @return The same instance of this {@link ResultsInner1} class */ @Nonnull - public ResultsInner1 results(@Nullable final List results) { + public ResultsInner1 results(@Nonnull final List results) { this.results = results; return this; } @@ -95,8 +93,7 @@ public ResultsInner1 results(@Nullable final List(); } @@ -105,55 +102,24 @@ public ResultsInner1 addResultsItem( } /** - * List of returned results. + * Get results * * @return results The results of this {@link ResultsInner1} instance. */ @Nonnull - public List getResults() { + public List getResults() { return results; } /** * Set the results of this {@link ResultsInner1} instance. * - * @param results List of returned results. + * @param results The results of this {@link ResultsInner1} */ - public void setResults(@Nullable final List results) { + public void setResults(@Nonnull final List results) { this.results = results; } - /** - * Set the message of this {@link ResultsInner1} instance and return the same instance. - * - * @param message The message of this {@link ResultsInner1} - * @return The same instance of this {@link ResultsInner1} class - */ - @Nonnull - public ResultsInner1 message(@Nonnull final String message) { - this.message = message; - return this; - } - - /** - * Get message - * - * @return message The message of this {@link ResultsInner1} instance. - */ - @Nonnull - public String getMessage() { - return message; - } - - /** - * Set the message of this {@link ResultsInner1} instance. - * - * @param message The message of this {@link ResultsInner1} - */ - public void setMessage(@Nonnull final String message) { - this.message = message; - } - /** * Get the names of the unrecognizable properties of the {@link ResultsInner1}. * @@ -194,7 +160,6 @@ 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); return declaredFields; } @@ -221,13 +186,12 @@ public boolean equals(@Nullable final java.lang.Object o) { final ResultsInner1 resultsInner1 = (ResultsInner1) 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.results, resultsInner1.results); } @Override public int hashCode() { - return Objects.hash(filterId, results, message, cloudSdkCustomFields); + return Objects.hash(filterId, results, cloudSdkCustomFields); } @Override @@ -237,7 +201,6 @@ 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"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); @@ -260,7 +223,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) -> (results) -> new ResultsInner1().filterId(filterId).results(results); } /** Builder helper class. */ @@ -277,11 +240,21 @@ public interface Builder { /** Builder helper class. */ public interface Builder1 { /** - * Set the message of this {@link ResultsInner1} instance. + * Set the results of this {@link ResultsInner1} instance. * - * @param message The message of this {@link ResultsInner1} + * @param results The results of this {@link ResultsInner1} * @return The ResultsInner1 instance. */ - ResultsInner1 message(@Nonnull final String message); + ResultsInner1 results(@Nonnull final List results); + + /** + * Set the results of this {@link ResultsInner1} instance. + * + * @param results The results of this {@link ResultsInner1} + * @return The ResultsInner1 instance. + */ + default ResultsInner1 results(@Nonnull final DocumentsChunk... results) { + return results(Arrays.asList(results)); + } } } 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 index 10e655a61..57d91deec 100644 --- 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 @@ -34,10 +34,10 @@ public class ResultsInner2 private String filterId; @JsonProperty("results") - private List results = new ArrayList<>(); + private List results = new ArrayList<>(); @JsonProperty("error") - private PerFilterSearchResultError error; + private RetrievalPerFilterSearchResultError 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 ResultsInner2} class */ @Nonnull - public ResultsInner2 results(@Nullable final List results) { + public ResultsInner2 results(@Nullable final List results) { this.results = results; return this; } @@ -95,7 +95,8 @@ public ResultsInner2 results(@Nullable final List re * @return The same instance of type {@link ResultsInner2} */ @Nonnull - public ResultsInner2 addResultsItem(@Nonnull final DataRepositorySearchResult resultsItem) { + public ResultsInner2 addResultsItem( + @Nonnull final RetrievalDataRepositorySearchResult resultsItem) { if (this.results == null) { this.results = new ArrayList<>(); } @@ -109,7 +110,7 @@ public ResultsInner2 addResultsItem(@Nonnull final DataRepositorySearchResult re * @return results The results of this {@link ResultsInner2} instance. */ @Nonnull - public List getResults() { + public List getResults() { return results; } @@ -118,7 +119,7 @@ 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; } @@ -129,7 +130,7 @@ public void setResults(@Nullable final List results) * @return The same instance of this {@link ResultsInner2} class */ @Nonnull - public ResultsInner2 error(@Nullable final PerFilterSearchResultError error) { + public ResultsInner2 error(@Nullable final RetrievalPerFilterSearchResultError error) { this.error = error; return this; } @@ -140,7 +141,7 @@ public ResultsInner2 error(@Nullable final PerFilterSearchResultError error) { * @return error The error of this {@link ResultsInner2} instance. */ @Nonnull - public PerFilterSearchResultError getError() { + public RetrievalPerFilterSearchResultError getError() { return error; } @@ -149,7 +150,7 @@ public PerFilterSearchResultError getError() { * * @param error The error of this {@link ResultsInner2} */ - public void setError(@Nullable final PerFilterSearchResultError error) { + public void setError(@Nullable final RetrievalPerFilterSearchResultError error) { this.error = error; } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner3.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner3.java new file mode 100644 index 000000000..d6c0cf558 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/ResultsInner3.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; + +/** ResultsInner3 */ +// CHECKSTYLE:OFF +public class ResultsInner3 +// 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 ResultsInner3. */ + protected ResultsInner3() {} + + /** + * Set the filterId of this {@link ResultsInner3} instance and return the same instance. + * + * @param filterId The filterId of this {@link ResultsInner3} + * @return The same instance of this {@link ResultsInner3} class + */ + @Nonnull + public ResultsInner3 filterId(@Nonnull final String filterId) { + this.filterId = filterId; + return this; + } + + /** + * Get filterId + * + * @return filterId The filterId of this {@link ResultsInner3} instance. + */ + @Nonnull + public String getFilterId() { + return filterId; + } + + /** + * Set the filterId of this {@link ResultsInner3} instance. + * + * @param filterId The filterId of this {@link ResultsInner3} + */ + public void setFilterId(@Nonnull final String filterId) { + this.filterId = filterId; + } + + /** + * Set the results of this {@link ResultsInner3} instance and return the same instance. + * + * @param results List of returned results. + * @return The same instance of this {@link ResultsInner3} class + */ + @Nonnull + public ResultsInner3 results(@Nullable final List results) { + this.results = results; + return this; + } + + /** + * Add one results instance to this {@link ResultsInner3}. + * + * @param resultsItem The results that should be added + * @return The same instance of type {@link ResultsInner3} + */ + @Nonnull + public ResultsInner3 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 ResultsInner3} instance. + */ + @Nonnull + public List getResults() { + return results; + } + + /** + * Set the results of this {@link ResultsInner3} instance. + * + * @param results List of returned results. + */ + public void setResults(@Nullable final List results) { + this.results = results; + } + + /** + * Set the error of this {@link ResultsInner3} instance and return the same instance. + * + * @param error The error of this {@link ResultsInner3} + * @return The same instance of this {@link ResultsInner3} class + */ + @Nonnull + public ResultsInner3 error(@Nullable final PerFilterSearchResultError error) { + this.error = error; + return this; + } + + /** + * Get error + * + * @return error The error of this {@link ResultsInner3} instance. + */ + @Nonnull + public PerFilterSearchResultError getError() { + return error; + } + + /** + * Set the error of this {@link ResultsInner3} instance. + * + * @param error The error of this {@link ResultsInner3} + */ + public void setError(@Nullable final PerFilterSearchResultError error) { + this.error = error; + } + + /** + * Get the names of the unrecognizable properties of the {@link ResultsInner3}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ResultsInner3} 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("ResultsInner3 has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link ResultsInner3} 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 ResultsInner3} 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 ResultsInner3 resultsInner3 = (ResultsInner3) o; + return Objects.equals(this.cloudSdkCustomFields, resultsInner3.cloudSdkCustomFields) + && Objects.equals(this.filterId, resultsInner3.filterId) + && Objects.equals(this.results, resultsInner3.results) + && Objects.equals(this.error, resultsInner3.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 ResultsInner3 {\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 ResultsInner3} instance + * with all required arguments. + */ + public static Builder create() { + return (filterId) -> new ResultsInner3().filterId(filterId); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filterId of this {@link ResultsInner3} instance. + * + * @param filterId The filterId of this {@link ResultsInner3} + * @return The ResultsInner3 instance. + */ + ResultsInner3 filterId(@Nonnull final String filterId); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalChunk.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalChunk.java new file mode 100644 index 000000000..96f6093f7 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalChunk.java @@ -0,0 +1,286 @@ +/* + * 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; + +/** RetrievalChunk */ +// CHECKSTYLE:OFF +public class RetrievalChunk +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("content") + private String content; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetrievalChunk. */ + protected RetrievalChunk() {} + + /** + * Set the id of this {@link RetrievalChunk} instance and return the same instance. + * + * @param id The id of this {@link RetrievalChunk} + * @return The same instance of this {@link RetrievalChunk} class + */ + @Nonnull + public RetrievalChunk id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link RetrievalChunk} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link RetrievalChunk} instance. + * + * @param id The id of this {@link RetrievalChunk} + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the content of this {@link RetrievalChunk} instance and return the same instance. + * + * @param content The content of this {@link RetrievalChunk} + * @return The same instance of this {@link RetrievalChunk} class + */ + @Nonnull + public RetrievalChunk content(@Nonnull final String content) { + this.content = content; + return this; + } + + /** + * Get content + * + * @return content The content of this {@link RetrievalChunk} instance. + */ + @Nonnull + public String getContent() { + return content; + } + + /** + * Set the content of this {@link RetrievalChunk} instance. + * + * @param content The content of this {@link RetrievalChunk} + */ + public void setContent(@Nonnull final String content) { + this.content = content; + } + + /** + * Set the metadata of this {@link RetrievalChunk} instance and return the same instance. + * + * @param metadata The metadata of this {@link RetrievalChunk} + * @return The same instance of this {@link RetrievalChunk} class + */ + @Nonnull + public RetrievalChunk metadata(@Nullable final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link RetrievalChunk}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link RetrievalChunk} + */ + @Nonnull + public RetrievalChunk addMetadataItem(@Nonnull final RetrievalKeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link RetrievalChunk} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link RetrievalChunk} instance. + * + * @param metadata The metadata of this {@link RetrievalChunk} + */ + public void setMetadata(@Nullable final List metadata) { + this.metadata = metadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link RetrievalChunk}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetrievalChunk} 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("RetrievalChunk has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link RetrievalChunk} 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 (content != null) declaredFields.put("content", content); + if (metadata != null) declaredFields.put("metadata", metadata); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link RetrievalChunk} 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 RetrievalChunk retrievalChunk = (RetrievalChunk) o; + return Objects.equals(this.cloudSdkCustomFields, retrievalChunk.cloudSdkCustomFields) + && Objects.equals(this.id, retrievalChunk.id) + && Objects.equals(this.content, retrievalChunk.content) + && Objects.equals(this.metadata, retrievalChunk.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(id, content, metadata, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetrievalChunk {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).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 RetrievalChunk} + * instance with all required arguments. + */ + public static Builder create() { + return (id) -> (content) -> new RetrievalChunk().id(id).content(content); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link RetrievalChunk} instance. + * + * @param id The id of this {@link RetrievalChunk} + * @return The RetrievalChunk builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the content of this {@link RetrievalChunk} instance. + * + * @param content The content of this {@link RetrievalChunk} + * @return The RetrievalChunk instance. + */ + RetrievalChunk content(@Nonnull final String content); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDocumentKeyValueListPair.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDocumentKeyValueListPair.java new file mode 100644 index 000000000..958f23b02 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalDocumentKeyValueListPair.java @@ -0,0 +1,365 @@ +/* + * 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.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; + +/** RetrievalDocumentKeyValueListPair */ +// CHECKSTYLE:OFF +public class RetrievalDocumentKeyValueListPair +// CHECKSTYLE:ON +{ + @JsonProperty("key") + private String key; + + @JsonProperty("value") + private List value = new ArrayList<>(); + + /** Gets or Sets matchMode */ + public enum MatchModeEnum { + /** The ANY option of this RetrievalDocumentKeyValueListPair */ + ANY("ANY"), + + /** The ALL option of this RetrievalDocumentKeyValueListPair */ + ALL("ALL"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this RetrievalDocumentKeyValueListPair */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + MatchModeEnum(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 RetrievalDocumentKeyValueListPair + */ + @JsonCreator + @Nullable + public static MatchModeEnum fromValue(@Nonnull final String value) { + for (MatchModeEnum b : MatchModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + } + + @JsonProperty("matchMode") + private MatchModeEnum matchMode; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetrievalDocumentKeyValueListPair. */ + protected RetrievalDocumentKeyValueListPair() {} + + /** + * Set the key of this {@link RetrievalDocumentKeyValueListPair} instance and return the same + * instance. + * + * @param key The key of this {@link RetrievalDocumentKeyValueListPair} + * @return The same instance of this {@link RetrievalDocumentKeyValueListPair} class + */ + @Nonnull + public RetrievalDocumentKeyValueListPair key(@Nonnull final String key) { + this.key = key; + return this; + } + + /** + * Get key + * + * @return key The key of this {@link RetrievalDocumentKeyValueListPair} instance. + */ + @Nonnull + public String getKey() { + return key; + } + + /** + * Set the key of this {@link RetrievalDocumentKeyValueListPair} instance. + * + * @param key The key of this {@link RetrievalDocumentKeyValueListPair} + */ + public void setKey(@Nonnull final String key) { + this.key = key; + } + + /** + * Set the value of this {@link RetrievalDocumentKeyValueListPair} instance and return the same + * instance. + * + * @param value The value of this {@link RetrievalDocumentKeyValueListPair} + * @return The same instance of this {@link RetrievalDocumentKeyValueListPair} class + */ + @Nonnull + public RetrievalDocumentKeyValueListPair value(@Nonnull final List value) { + this.value = value; + return this; + } + + /** + * Add one value instance to this {@link RetrievalDocumentKeyValueListPair}. + * + * @param valueItem The value that should be added + * @return The same instance of type {@link RetrievalDocumentKeyValueListPair} + */ + @Nonnull + public RetrievalDocumentKeyValueListPair addValueItem(@Nonnull final String valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * + * @return value The value of this {@link RetrievalDocumentKeyValueListPair} instance. + */ + @Nonnull + public List getValue() { + return value; + } + + /** + * Set the value of this {@link RetrievalDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link RetrievalDocumentKeyValueListPair} + */ + public void setValue(@Nonnull final List value) { + this.value = value; + } + + /** + * Set the matchMode of this {@link RetrievalDocumentKeyValueListPair} instance and return the + * same instance. + * + * @param matchMode The matchMode of this {@link RetrievalDocumentKeyValueListPair} + * @return The same instance of this {@link RetrievalDocumentKeyValueListPair} class + */ + @Nonnull + public RetrievalDocumentKeyValueListPair matchMode(@Nullable final MatchModeEnum matchMode) { + this.matchMode = matchMode; + return this; + } + + /** + * Get matchMode + * + * @return matchMode The matchMode of this {@link RetrievalDocumentKeyValueListPair} instance. + */ + @Nullable + public MatchModeEnum getMatchMode() { + return matchMode; + } + + /** + * Set the matchMode of this {@link RetrievalDocumentKeyValueListPair} instance. + * + * @param matchMode The matchMode of this {@link RetrievalDocumentKeyValueListPair} + */ + public void setMatchMode(@Nullable final MatchModeEnum matchMode) { + this.matchMode = matchMode; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * RetrievalDocumentKeyValueListPair}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetrievalDocumentKeyValueListPair} + * 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( + "RetrievalDocumentKeyValueListPair has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link RetrievalDocumentKeyValueListPair} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (key != null) declaredFields.put("key", key); + if (value != null) declaredFields.put("value", value); + if (matchMode != null) declaredFields.put("matchMode", matchMode); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link RetrievalDocumentKeyValueListPair} 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 RetrievalDocumentKeyValueListPair retrievalDocumentKeyValueListPair = + (RetrievalDocumentKeyValueListPair) o; + return Objects.equals( + this.cloudSdkCustomFields, retrievalDocumentKeyValueListPair.cloudSdkCustomFields) + && Objects.equals(this.key, retrievalDocumentKeyValueListPair.key) + && Objects.equals(this.value, retrievalDocumentKeyValueListPair.value) + && Objects.equals(this.matchMode, retrievalDocumentKeyValueListPair.matchMode); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, matchMode, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetrievalDocumentKeyValueListPair {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" matchMode: ").append(toIndentedString(matchMode)).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 + * RetrievalDocumentKeyValueListPair} instance with all required arguments. + */ + public static Builder create() { + return (key) -> (value) -> new RetrievalDocumentKeyValueListPair().key(key).value(value); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the key of this {@link RetrievalDocumentKeyValueListPair} instance. + * + * @param key The key of this {@link RetrievalDocumentKeyValueListPair} + * @return The RetrievalDocumentKeyValueListPair builder. + */ + Builder1 key(@Nonnull final String key); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the value of this {@link RetrievalDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link RetrievalDocumentKeyValueListPair} + * @return The RetrievalDocumentKeyValueListPair instance. + */ + RetrievalDocumentKeyValueListPair value(@Nonnull final List value); + + /** + * Set the value of this {@link RetrievalDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link RetrievalDocumentKeyValueListPair} + * @return The RetrievalDocumentKeyValueListPair instance. + */ + default RetrievalDocumentKeyValueListPair value(@Nonnull final String... value) { + return value(Arrays.asList(value)); + } + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalKeyValueListPair.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalKeyValueListPair.java new file mode 100644 index 000000000..9b3ba466b --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalKeyValueListPair.java @@ -0,0 +1,261 @@ +/* + * 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; + +/** RetrievalKeyValueListPair */ +// CHECKSTYLE:OFF +public class RetrievalKeyValueListPair +// CHECKSTYLE:ON +{ + @JsonProperty("key") + private String key; + + @JsonProperty("value") + private List value = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetrievalKeyValueListPair. */ + protected RetrievalKeyValueListPair() {} + + /** + * Set the key of this {@link RetrievalKeyValueListPair} instance and return the same instance. + * + * @param key The key of this {@link RetrievalKeyValueListPair} + * @return The same instance of this {@link RetrievalKeyValueListPair} class + */ + @Nonnull + public RetrievalKeyValueListPair key(@Nonnull final String key) { + this.key = key; + return this; + } + + /** + * Get key + * + * @return key The key of this {@link RetrievalKeyValueListPair} instance. + */ + @Nonnull + public String getKey() { + return key; + } + + /** + * Set the key of this {@link RetrievalKeyValueListPair} instance. + * + * @param key The key of this {@link RetrievalKeyValueListPair} + */ + public void setKey(@Nonnull final String key) { + this.key = key; + } + + /** + * Set the value of this {@link RetrievalKeyValueListPair} instance and return the same instance. + * + * @param value The value of this {@link RetrievalKeyValueListPair} + * @return The same instance of this {@link RetrievalKeyValueListPair} class + */ + @Nonnull + public RetrievalKeyValueListPair value(@Nonnull final List value) { + this.value = value; + return this; + } + + /** + * Add one value instance to this {@link RetrievalKeyValueListPair}. + * + * @param valueItem The value that should be added + * @return The same instance of type {@link RetrievalKeyValueListPair} + */ + @Nonnull + public RetrievalKeyValueListPair addValueItem(@Nonnull final String valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * + * @return value The value of this {@link RetrievalKeyValueListPair} instance. + */ + @Nonnull + public List getValue() { + return value; + } + + /** + * Set the value of this {@link RetrievalKeyValueListPair} instance. + * + * @param value The value of this {@link RetrievalKeyValueListPair} + */ + public void setValue(@Nonnull final List value) { + this.value = value; + } + + /** + * Get the names of the unrecognizable properties of the {@link RetrievalKeyValueListPair}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetrievalKeyValueListPair} 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( + "RetrievalKeyValueListPair has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link RetrievalKeyValueListPair} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (key != null) declaredFields.put("key", key); + if (value != null) declaredFields.put("value", value); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link RetrievalKeyValueListPair} 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 RetrievalKeyValueListPair retrievalKeyValueListPair = (RetrievalKeyValueListPair) o; + return Objects.equals(this.cloudSdkCustomFields, retrievalKeyValueListPair.cloudSdkCustomFields) + && Objects.equals(this.key, retrievalKeyValueListPair.key) + && Objects.equals(this.value, retrievalKeyValueListPair.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetrievalKeyValueListPair {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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 + * RetrievalKeyValueListPair} instance with all required arguments. + */ + public static Builder create() { + return (key) -> (value) -> new RetrievalKeyValueListPair().key(key).value(value); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the key of this {@link RetrievalKeyValueListPair} instance. + * + * @param key The key of this {@link RetrievalKeyValueListPair} + * @return The RetrievalKeyValueListPair builder. + */ + Builder1 key(@Nonnull final String key); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the value of this {@link RetrievalKeyValueListPair} instance. + * + * @param value The value of this {@link RetrievalKeyValueListPair} + * @return The RetrievalKeyValueListPair instance. + */ + RetrievalKeyValueListPair value(@Nonnull final List value); + + /** + * Set the value of this {@link RetrievalKeyValueListPair} instance. + * + * @param value The value of this {@link RetrievalKeyValueListPair} + * @return The RetrievalKeyValueListPair instance. + */ + default RetrievalKeyValueListPair value(@Nonnull final String... value) { + return value(Arrays.asList(value)); + } + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalPerFilterSearchResultError.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalPerFilterSearchResultError.java new file mode 100644 index 000000000..233c90487 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalPerFilterSearchResultError.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; + +/** RetrievalPerFilterSearchResultError */ +// CHECKSTYLE:OFF +public class RetrievalPerFilterSearchResultError +// CHECKSTYLE:ON +{ + @JsonProperty("message") + private String message; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetrievalPerFilterSearchResultError. */ + protected RetrievalPerFilterSearchResultError() {} + + /** + * Set the message of this {@link RetrievalPerFilterSearchResultError} instance and return the + * same instance. + * + * @param message The message of this {@link RetrievalPerFilterSearchResultError} + * @return The same instance of this {@link RetrievalPerFilterSearchResultError} class + */ + @Nonnull + public RetrievalPerFilterSearchResultError message(@Nonnull final String message) { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message The message of this {@link RetrievalPerFilterSearchResultError} instance. + */ + @Nonnull + public String getMessage() { + return message; + } + + /** + * Set the message of this {@link RetrievalPerFilterSearchResultError} instance. + * + * @param message The message of this {@link RetrievalPerFilterSearchResultError} + */ + public void setMessage(@Nonnull final String message) { + this.message = message; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * RetrievalPerFilterSearchResultError}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link RetrievalPerFilterSearchResultError} + * 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( + "RetrievalPerFilterSearchResultError has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link RetrievalPerFilterSearchResultError} 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 RetrievalPerFilterSearchResultError} 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 RetrievalPerFilterSearchResultError retrievalPerFilterSearchResultError = + (RetrievalPerFilterSearchResultError) o; + return Objects.equals( + this.cloudSdkCustomFields, retrievalPerFilterSearchResultError.cloudSdkCustomFields) + && Objects.equals(this.message, retrievalPerFilterSearchResultError.message); + } + + @Override + public int hashCode() { + return Objects.hash(message, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetrievalPerFilterSearchResultError {\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 + * RetrievalPerFilterSearchResultError} instance with all required arguments. + */ + public static Builder create() { + return (message) -> new RetrievalPerFilterSearchResultError().message(message); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the message of this {@link RetrievalPerFilterSearchResultError} instance. + * + * @param message The message of this {@link RetrievalPerFilterSearchResultError} + * @return The RetrievalPerFilterSearchResultError instance. + */ + RetrievalPerFilterSearchResultError message(@Nonnull final String message); + } +} 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 index 6f61028b6..cc79d670e 100644 --- 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 @@ -28,8 +28,11 @@ public class RetrievalPerFilterSearchResultWithError // CHECKSTYLE:ON { - @JsonProperty("message") - private String message; + @JsonProperty("filterId") + private String filterId; + + @JsonProperty("error") + private RetrievalPerFilterSearchResultError error; @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -38,35 +41,68 @@ public class RetrievalPerFilterSearchResultWithError protected RetrievalPerFilterSearchResultWithError() {} /** - * Set the message of this {@link RetrievalPerFilterSearchResultWithError} instance and return the + * Set the filterId of this {@link RetrievalPerFilterSearchResultWithError} instance and return + * the same instance. + * + * @param filterId The filterId of this {@link RetrievalPerFilterSearchResultWithError} + * @return The same instance of this {@link RetrievalPerFilterSearchResultWithError} class + */ + @Nonnull + public RetrievalPerFilterSearchResultWithError filterId(@Nonnull final String filterId) { + this.filterId = filterId; + return this; + } + + /** + * Get filterId + * + * @return filterId The filterId of this {@link RetrievalPerFilterSearchResultWithError} instance. + */ + @Nonnull + public String getFilterId() { + return filterId; + } + + /** + * Set the filterId of this {@link RetrievalPerFilterSearchResultWithError} instance. + * + * @param filterId The filterId of this {@link RetrievalPerFilterSearchResultWithError} + */ + public void setFilterId(@Nonnull final String filterId) { + this.filterId = filterId; + } + + /** + * Set the error of this {@link RetrievalPerFilterSearchResultWithError} instance and return the * same instance. * - * @param message The message of this {@link RetrievalPerFilterSearchResultWithError} + * @param error The error of this {@link RetrievalPerFilterSearchResultWithError} * @return The same instance of this {@link RetrievalPerFilterSearchResultWithError} class */ @Nonnull - public RetrievalPerFilterSearchResultWithError message(@Nonnull final String message) { - this.message = message; + public RetrievalPerFilterSearchResultWithError error( + @Nullable final RetrievalPerFilterSearchResultError error) { + this.error = error; return this; } /** - * Get message + * Get error * - * @return message The message of this {@link RetrievalPerFilterSearchResultWithError} instance. + * @return error The error of this {@link RetrievalPerFilterSearchResultWithError} instance. */ @Nonnull - public String getMessage() { - return message; + public RetrievalPerFilterSearchResultError getError() { + return error; } /** - * Set the message of this {@link RetrievalPerFilterSearchResultWithError} instance. + * Set the error of this {@link RetrievalPerFilterSearchResultWithError} instance. * - * @param message The message of this {@link RetrievalPerFilterSearchResultWithError} + * @param error The error of this {@link RetrievalPerFilterSearchResultWithError} */ - public void setMessage(@Nonnull final String message) { - this.message = message; + public void setError(@Nullable final RetrievalPerFilterSearchResultError error) { + this.error = error; } /** @@ -110,7 +146,8 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc @Nonnull public Map toMap() { final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (message != null) declaredFields.put("message", message); + if (filterId != null) declaredFields.put("filterId", filterId); + if (error != null) declaredFields.put("error", error); return declaredFields; } @@ -139,12 +176,13 @@ public boolean equals(@Nullable final java.lang.Object o) { (RetrievalPerFilterSearchResultWithError) o; return Objects.equals( this.cloudSdkCustomFields, retrievalPerFilterSearchResultWithError.cloudSdkCustomFields) - && Objects.equals(this.message, retrievalPerFilterSearchResultWithError.message); + && Objects.equals(this.filterId, retrievalPerFilterSearchResultWithError.filterId) + && Objects.equals(this.error, retrievalPerFilterSearchResultWithError.error); } @Override public int hashCode() { - return Objects.hash(message, cloudSdkCustomFields); + return Objects.hash(filterId, error, cloudSdkCustomFields); } @Override @@ -152,7 +190,8 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class RetrievalPerFilterSearchResultWithError {\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\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")); @@ -175,17 +214,17 @@ private String toIndentedString(final java.lang.Object o) { * RetrievalPerFilterSearchResultWithError} instance with all required arguments. */ public static Builder create() { - return (message) -> new RetrievalPerFilterSearchResultWithError().message(message); + return (filterId) -> new RetrievalPerFilterSearchResultWithError().filterId(filterId); } /** Builder helper class. */ public interface Builder { /** - * Set the message of this {@link RetrievalPerFilterSearchResultWithError} instance. + * Set the filterId of this {@link RetrievalPerFilterSearchResultWithError} instance. * - * @param message The message of this {@link RetrievalPerFilterSearchResultWithError} + * @param filterId The filterId of this {@link RetrievalPerFilterSearchResultWithError} * @return The RetrievalPerFilterSearchResultWithError instance. */ - RetrievalPerFilterSearchResultWithError message(@Nonnull final String message); + RetrievalPerFilterSearchResultWithError 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/RetrievalSearchDocumentKeyValueListPair.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchDocumentKeyValueListPair.java new file mode 100644 index 000000000..9df948a7f --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchDocumentKeyValueListPair.java @@ -0,0 +1,324 @@ +/* + * 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; + +/** RetrievalSearchDocumentKeyValueListPair */ +// CHECKSTYLE:OFF +public class RetrievalSearchDocumentKeyValueListPair +// CHECKSTYLE:ON +{ + @JsonProperty("key") + private String key; + + @JsonProperty("value") + private List value = new ArrayList<>(); + + @JsonProperty("selectMode") + private List selectMode = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for RetrievalSearchDocumentKeyValueListPair. */ + protected RetrievalSearchDocumentKeyValueListPair() {} + + /** + * Set the key of this {@link RetrievalSearchDocumentKeyValueListPair} instance and return the + * same instance. + * + * @param key The key of this {@link RetrievalSearchDocumentKeyValueListPair} + * @return The same instance of this {@link RetrievalSearchDocumentKeyValueListPair} class + */ + @Nonnull + public RetrievalSearchDocumentKeyValueListPair key(@Nonnull final String key) { + this.key = key; + return this; + } + + /** + * Get key + * + * @return key The key of this {@link RetrievalSearchDocumentKeyValueListPair} instance. + */ + @Nonnull + public String getKey() { + return key; + } + + /** + * Set the key of this {@link RetrievalSearchDocumentKeyValueListPair} instance. + * + * @param key The key of this {@link RetrievalSearchDocumentKeyValueListPair} + */ + public void setKey(@Nonnull final String key) { + this.key = key; + } + + /** + * Set the value of this {@link RetrievalSearchDocumentKeyValueListPair} instance and return the + * same instance. + * + * @param value The value of this {@link RetrievalSearchDocumentKeyValueListPair} + * @return The same instance of this {@link RetrievalSearchDocumentKeyValueListPair} class + */ + @Nonnull + public RetrievalSearchDocumentKeyValueListPair value(@Nonnull final List value) { + this.value = value; + return this; + } + + /** + * Add one value instance to this {@link RetrievalSearchDocumentKeyValueListPair}. + * + * @param valueItem The value that should be added + * @return The same instance of type {@link RetrievalSearchDocumentKeyValueListPair} + */ + @Nonnull + public RetrievalSearchDocumentKeyValueListPair addValueItem(@Nonnull final String valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * + * @return value The value of this {@link RetrievalSearchDocumentKeyValueListPair} instance. + */ + @Nonnull + public List getValue() { + return value; + } + + /** + * Set the value of this {@link RetrievalSearchDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link RetrievalSearchDocumentKeyValueListPair} + */ + public void setValue(@Nonnull final List value) { + this.value = value; + } + + /** + * Set the selectMode of this {@link RetrievalSearchDocumentKeyValueListPair} instance and return + * the same instance. + * + * @param selectMode Select mode for search filters + * @return The same instance of this {@link RetrievalSearchDocumentKeyValueListPair} class + */ + @Nonnull + public RetrievalSearchDocumentKeyValueListPair selectMode( + @Nullable final List selectMode) { + this.selectMode = selectMode; + return this; + } + + /** + * Add one selectMode instance to this {@link RetrievalSearchDocumentKeyValueListPair}. + * + * @param selectModeItem The selectMode that should be added + * @return The same instance of type {@link RetrievalSearchDocumentKeyValueListPair} + */ + @Nonnull + public RetrievalSearchDocumentKeyValueListPair addSelectModeItem( + @Nonnull final RetrievalSearchSelectOptionEnum selectModeItem) { + if (this.selectMode == null) { + this.selectMode = new ArrayList<>(); + } + this.selectMode.add(selectModeItem); + return this; + } + + /** + * Select mode for search filters + * + * @return selectMode The selectMode of this {@link RetrievalSearchDocumentKeyValueListPair} + * instance. + */ + @Nonnull + public List getSelectMode() { + return selectMode; + } + + /** + * Set the selectMode of this {@link RetrievalSearchDocumentKeyValueListPair} instance. + * + * @param selectMode Select mode for search filters + */ + public void setSelectMode(@Nullable final List selectMode) { + this.selectMode = selectMode; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * RetrievalSearchDocumentKeyValueListPair}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * RetrievalSearchDocumentKeyValueListPair} 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( + "RetrievalSearchDocumentKeyValueListPair has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link RetrievalSearchDocumentKeyValueListPair} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (key != null) declaredFields.put("key", key); + if (value != null) declaredFields.put("value", value); + if (selectMode != null) declaredFields.put("selectMode", selectMode); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link RetrievalSearchDocumentKeyValueListPair} + * 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 RetrievalSearchDocumentKeyValueListPair retrievalSearchDocumentKeyValueListPair = + (RetrievalSearchDocumentKeyValueListPair) o; + return Objects.equals( + this.cloudSdkCustomFields, retrievalSearchDocumentKeyValueListPair.cloudSdkCustomFields) + && Objects.equals(this.key, retrievalSearchDocumentKeyValueListPair.key) + && Objects.equals(this.value, retrievalSearchDocumentKeyValueListPair.value) + && Objects.equals(this.selectMode, retrievalSearchDocumentKeyValueListPair.selectMode); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, selectMode, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class RetrievalSearchDocumentKeyValueListPair {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" selectMode: ").append(toIndentedString(selectMode)).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 + * RetrievalSearchDocumentKeyValueListPair} instance with all required arguments. + */ + public static Builder create() { + return (key) -> (value) -> new RetrievalSearchDocumentKeyValueListPair().key(key).value(value); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the key of this {@link RetrievalSearchDocumentKeyValueListPair} instance. + * + * @param key The key of this {@link RetrievalSearchDocumentKeyValueListPair} + * @return The RetrievalSearchDocumentKeyValueListPair builder. + */ + Builder1 key(@Nonnull final String key); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the value of this {@link RetrievalSearchDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link RetrievalSearchDocumentKeyValueListPair} + * @return The RetrievalSearchDocumentKeyValueListPair instance. + */ + RetrievalSearchDocumentKeyValueListPair value(@Nonnull final List value); + + /** + * Set the value of this {@link RetrievalSearchDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link RetrievalSearchDocumentKeyValueListPair} + * @return The RetrievalSearchDocumentKeyValueListPair instance. + */ + default RetrievalSearchDocumentKeyValueListPair value(@Nonnull final String... value) { + return value(Arrays.asList(value)); + } + } +} 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 a823f8258..f32b33aee 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 SearchConfiguration searchConfiguration; + private RetrievalSearchConfiguration searchConfiguration; @JsonProperty("dataRepositories") private List dataRepositories = new ArrayList<>(Arrays.asList("*")); @@ -44,13 +44,13 @@ public class RetrievalSearchFilter private DataRepositoryType dataRepositoryType; @JsonProperty("dataRepositoryMetadata") - private List dataRepositoryMetadata = new ArrayList<>(); + private List dataRepositoryMetadata = new ArrayList<>(); @JsonProperty("documentMetadata") - private List documentMetadata = new ArrayList<>(); + private List documentMetadata = new ArrayList<>(); @JsonProperty("chunkMetadata") - private List chunkMetadata = new ArrayList<>(); + private List chunkMetadata = new ArrayList<>(); @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -61,7 +61,7 @@ protected RetrievalSearchFilter() {} /** * Set the id of this {@link RetrievalSearchFilter} instance and return the same instance. * - * @param id Identifier of this SearchFilter - unique per request. + * @param id Identifier of this RetrievalSearchFilter - unique per request. * @return The same instance of this {@link RetrievalSearchFilter} class */ @Nonnull @@ -71,7 +71,7 @@ public RetrievalSearchFilter id(@Nonnull final String id) { } /** - * Identifier of this SearchFilter - unique per request. + * Identifier of this RetrievalSearchFilter - unique per request. * * @return id The id of this {@link RetrievalSearchFilter} instance. */ @@ -83,7 +83,7 @@ public String getId() { /** * Set the id of this {@link RetrievalSearchFilter} instance. * - * @param id Identifier of this SearchFilter - unique per request. + * @param id Identifier of this RetrievalSearchFilter - unique per request. */ public void setId(@Nonnull final String id) { this.id = id; @@ -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; } @@ -218,7 +219,7 @@ public void setDataRepositoryType(@Nullable final DataRepositoryType dataReposit */ @Nonnull public RetrievalSearchFilter dataRepositoryMetadata( - @Nullable final List dataRepositoryMetadata) { + @Nullable final List dataRepositoryMetadata) { this.dataRepositoryMetadata = dataRepositoryMetadata; return this; } @@ -231,7 +232,7 @@ public RetrievalSearchFilter dataRepositoryMetadata( */ @Nonnull public RetrievalSearchFilter addDataRepositoryMetadataItem( - @Nonnull final KeyValueListPair dataRepositoryMetadataItem) { + @Nonnull final RetrievalKeyValueListPair dataRepositoryMetadataItem) { if (this.dataRepositoryMetadata == null) { this.dataRepositoryMetadata = new ArrayList<>(); } @@ -247,7 +248,7 @@ public RetrievalSearchFilter addDataRepositoryMetadataItem( * instance. */ @Nonnull - public List getDataRepositoryMetadata() { + public List getDataRepositoryMetadata() { return dataRepositoryMetadata; } @@ -259,7 +260,7 @@ public List getDataRepositoryMetadata() { * dataRepositories=['*'] */ public void setDataRepositoryMetadata( - @Nullable final List dataRepositoryMetadata) { + @Nullable final List dataRepositoryMetadata) { this.dataRepositoryMetadata = dataRepositoryMetadata; } @@ -273,7 +274,7 @@ public void setDataRepositoryMetadata( */ @Nonnull public RetrievalSearchFilter documentMetadata( - @Nullable final List documentMetadata) { + @Nullable final List documentMetadata) { this.documentMetadata = documentMetadata; return this; } @@ -286,7 +287,7 @@ public RetrievalSearchFilter documentMetadata( */ @Nonnull public RetrievalSearchFilter addDocumentMetadataItem( - @Nonnull final SearchDocumentKeyValueListPair documentMetadataItem) { + @Nonnull final RetrievalSearchDocumentKeyValueListPair documentMetadataItem) { if (this.documentMetadata == null) { this.documentMetadata = new ArrayList<>(); } @@ -300,7 +301,7 @@ public RetrievalSearchFilter addDocumentMetadataItem( * @return documentMetadata The documentMetadata of this {@link RetrievalSearchFilter} instance. */ @Nonnull - public List getDocumentMetadata() { + public List getDocumentMetadata() { return documentMetadata; } @@ -311,7 +312,7 @@ public List getDocumentMetadata() { * given metadata. */ public void setDocumentMetadata( - @Nullable final List documentMetadata) { + @Nullable final List documentMetadata) { this.documentMetadata = documentMetadata; } @@ -323,7 +324,8 @@ public void setDocumentMetadata( * @return The same instance of this {@link RetrievalSearchFilter} class */ @Nonnull - public RetrievalSearchFilter chunkMetadata(@Nullable final List chunkMetadata) { + public RetrievalSearchFilter chunkMetadata( + @Nullable final List chunkMetadata) { this.chunkMetadata = chunkMetadata; return this; } @@ -336,7 +338,7 @@ public RetrievalSearchFilter chunkMetadata(@Nullable final List(); } @@ -350,7 +352,7 @@ public RetrievalSearchFilter addChunkMetadataItem( * @return chunkMetadata The chunkMetadata of this {@link RetrievalSearchFilter} instance. */ @Nonnull - public List getChunkMetadata() { + public List getChunkMetadata() { return chunkMetadata; } @@ -359,7 +361,7 @@ public List getChunkMetadata() { * * @param chunkMetadata Restrict chunks considered during search to those with the given metadata. */ - public void setChunkMetadata(@Nullable final List chunkMetadata) { + public void setChunkMetadata(@Nullable final List chunkMetadata) { this.chunkMetadata = chunkMetadata; } @@ -505,7 +507,7 @@ public interface Builder { /** * Set the id of this {@link RetrievalSearchFilter} instance. * - * @param id Identifier of this SearchFilter - unique per request. + * @param id Identifier of this RetrievalSearchFilter - unique per request. * @return The RetrievalSearchFilter builder. */ Builder1 id(@Nonnull final String id); 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 index e29f60da4..dcbf507cf 100644 --- 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 @@ -32,7 +32,7 @@ public class RetrievalSearchResults // CHECKSTYLE:ON { @JsonProperty("results") - private List results = new ArrayList<>(); + private List results = new ArrayList<>(); @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -47,7 +47,7 @@ protected RetrievalSearchResults() {} * @return The same instance of this {@link RetrievalSearchResults} class */ @Nonnull - public RetrievalSearchResults results(@Nonnull final List results) { + public RetrievalSearchResults results(@Nonnull final List results) { this.results = results; return this; } @@ -59,7 +59,7 @@ public RetrievalSearchResults results(@Nonnull final List results * @return The same instance of type {@link RetrievalSearchResults} */ @Nonnull - public RetrievalSearchResults addResultsItem(@Nonnull final ResultsInner1 resultsItem) { + public RetrievalSearchResults addResultsItem(@Nonnull final ResultsInner2 resultsItem) { if (this.results == null) { this.results = new ArrayList<>(); } @@ -73,7 +73,7 @@ public RetrievalSearchResults addResultsItem(@Nonnull final ResultsInner1 result * @return results The results of this {@link RetrievalSearchResults} instance. */ @Nonnull - public List getResults() { + public List getResults() { return results; } @@ -82,7 +82,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; } @@ -198,7 +198,7 @@ public interface Builder { * @param results List of returned results. * @return The RetrievalSearchResults instance. */ - RetrievalSearchResults results(@Nonnull final List results); + RetrievalSearchResults results(@Nonnull final List results); /** * Set the results of this {@link RetrievalSearchResults} instance. @@ -206,7 +206,7 @@ public interface Builder { * @param results List of returned results. * @return The RetrievalSearchResults instance. */ - default RetrievalSearchResults results(@Nonnull final ResultsInner1... results) { + default RetrievalSearchResults 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/RetrievalSearchSelectOptionEnum.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchSelectOptionEnum.java new file mode 100644 index 000000000..6794adcc4 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/RetrievalSearchSelectOptionEnum.java @@ -0,0 +1,62 @@ +/* + * 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 RetrievalSearchSelectOptionEnum */ +public enum RetrievalSearchSelectOptionEnum { + IGNORE_IF_KEY_ABSENT("ignoreIfKeyAbsent"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + RetrievalSearchSelectOptionEnum(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 RetrievalSearchSelectOptionEnum fromValue(@Nonnull final String value) { + for (final RetrievalSearchSelectOptionEnum b : RetrievalSearchSelectOptionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/S3Configuration.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/S3Configuration.java new file mode 100644 index 000000000..0958fd75b --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/S3Configuration.java @@ -0,0 +1,221 @@ +/* + * 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; + +/** S3Configuration */ +// CHECKSTYLE:OFF +public class S3Configuration +// CHECKSTYLE:ON +{ + @JsonProperty("destination") + private String destination; + + @JsonProperty("s3") + private SFTPConfigurationSftp s3; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for S3Configuration. */ + protected S3Configuration() {} + + /** + * Set the destination of this {@link S3Configuration} instance and return the same instance. + * + * @param destination The destination of this {@link S3Configuration} + * @return The same instance of this {@link S3Configuration} class + */ + @Nonnull + public S3Configuration destination(@Nonnull final String destination) { + this.destination = destination; + return this; + } + + /** + * Get destination + * + * @return destination The destination of this {@link S3Configuration} instance. + */ + @Nonnull + public String getDestination() { + return destination; + } + + /** + * Set the destination of this {@link S3Configuration} instance. + * + * @param destination The destination of this {@link S3Configuration} + */ + public void setDestination(@Nonnull final String destination) { + this.destination = destination; + } + + /** + * Set the s3 of this {@link S3Configuration} instance and return the same instance. + * + * @param s3 The s3 of this {@link S3Configuration} + * @return The same instance of this {@link S3Configuration} class + */ + @Nonnull + public S3Configuration s3(@Nullable final SFTPConfigurationSftp s3) { + this.s3 = s3; + return this; + } + + /** + * Get s3 + * + * @return s3 The s3 of this {@link S3Configuration} instance. + */ + @Nonnull + public SFTPConfigurationSftp getS3() { + return s3; + } + + /** + * Set the s3 of this {@link S3Configuration} instance. + * + * @param s3 The s3 of this {@link S3Configuration} + */ + public void setS3(@Nullable final SFTPConfigurationSftp s3) { + this.s3 = s3; + } + + /** + * Get the names of the unrecognizable properties of the {@link S3Configuration}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link S3Configuration} 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("S3Configuration has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link S3Configuration} 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 (s3 != null) declaredFields.put("s3", s3); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link S3Configuration} 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 S3Configuration s3Configuration = (S3Configuration) o; + return Objects.equals(this.cloudSdkCustomFields, s3Configuration.cloudSdkCustomFields) + && Objects.equals(this.destination, s3Configuration.destination) + && Objects.equals(this.s3, s3Configuration.s3); + } + + @Override + public int hashCode() { + return Objects.hash(destination, s3, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class S3Configuration {\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" s3: ").append(toIndentedString(s3)).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 S3Configuration} + * instance with all required arguments. + */ + public static Builder create() { + return (destination) -> new S3Configuration().destination(destination); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the destination of this {@link S3Configuration} instance. + * + * @param destination The destination of this {@link S3Configuration} + * @return The S3Configuration instance. + */ + S3Configuration destination(@Nonnull final String destination); + } +} 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 index 7218939b1..33018523c 100644 --- 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 @@ -88,7 +88,7 @@ public static TypeEnum fromValue(@Nonnull final String value) { private TypeEnum type; @JsonProperty("configuration") - private CommonConfiguration _configuration; + private S3Configuration _configuration; @JsonProperty("metadata") private MetaData metadata; @@ -138,7 +138,7 @@ public void setType(@Nonnull final TypeEnum type) { * @return The same instance of this {@link S3PipelineCreateRequest} class */ @Nonnull - public S3PipelineCreateRequest _configuration(@Nonnull final CommonConfiguration _configuration) { + public S3PipelineCreateRequest _configuration(@Nonnull final S3Configuration _configuration) { this._configuration = _configuration; return this; } @@ -149,7 +149,7 @@ public S3PipelineCreateRequest _configuration(@Nonnull final CommonConfiguration * @return _configuration The _configuration of this {@link S3PipelineCreateRequest} instance. */ @Nonnull - public CommonConfiguration getConfiguration() { + public S3Configuration getConfiguration() { return _configuration; } @@ -158,7 +158,7 @@ public CommonConfiguration getConfiguration() { * * @param _configuration The _configuration of this {@link S3PipelineCreateRequest} */ - public void setConfiguration(@Nonnull final CommonConfiguration _configuration) { + public void setConfiguration(@Nonnull final S3Configuration _configuration) { this._configuration = _configuration; } @@ -323,6 +323,6 @@ public interface Builder1 { * @param _configuration The _configuration of this {@link S3PipelineCreateRequest} * @return The S3PipelineCreateRequest instance. */ - S3PipelineCreateRequest _configuration(@Nonnull final CommonConfiguration _configuration); + S3PipelineCreateRequest _configuration(@Nonnull final S3Configuration _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 index d204da19d..3692d33c3 100644 --- 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 @@ -94,7 +94,7 @@ public static TypeEnum fromValue(@Nonnull final String value) { private MetaData metadata; @JsonProperty("configuration") - private CommonConfiguration _configuration; + private S3Configuration _configuration; @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -203,7 +203,7 @@ public void setMetadata(@Nullable final MetaData metadata) { * @return The same instance of this {@link S3PipelineGetResponse} class */ @Nonnull - public S3PipelineGetResponse _configuration(@Nonnull final CommonConfiguration _configuration) { + public S3PipelineGetResponse _configuration(@Nonnull final S3Configuration _configuration) { this._configuration = _configuration; return this; } @@ -214,7 +214,7 @@ public S3PipelineGetResponse _configuration(@Nonnull final CommonConfiguration _ * @return _configuration The _configuration of this {@link S3PipelineGetResponse} instance. */ @Nonnull - public CommonConfiguration getConfiguration() { + public S3Configuration getConfiguration() { return _configuration; } @@ -223,7 +223,7 @@ public CommonConfiguration getConfiguration() { * * @param _configuration The _configuration of this {@link S3PipelineGetResponse} */ - public void setConfiguration(@Nonnull final CommonConfiguration _configuration) { + public void setConfiguration(@Nonnull final S3Configuration _configuration) { this._configuration = _configuration; } @@ -373,6 +373,6 @@ public interface Builder2 { * @param _configuration The _configuration of this {@link S3PipelineGetResponse} * @return The S3PipelineGetResponse instance. */ - S3PipelineGetResponse _configuration(@Nonnull final CommonConfiguration _configuration); + S3PipelineGetResponse _configuration(@Nonnull final S3Configuration _configuration); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SDMPipelineCreateRequest.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SDMPipelineCreateRequest.java new file mode 100644 index 000000000..61d9278fa --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SDMPipelineCreateRequest.java @@ -0,0 +1,290 @@ +/* + * 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; + +/** SDMPipelineCreateRequest */ +// CHECKSTYLE:OFF +public class SDMPipelineCreateRequest implements CreatePipeline +// CHECKSTYLE:ON +{ + /** Gets or Sets type */ + public enum TypeEnum { + /** The SDM option of this SDMPipelineCreateRequest */ + SDM("SDM"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this SDMPipelineCreateRequest */ + 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 SDMPipelineCreateRequest + */ + @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; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SDMPipelineCreateRequest. */ + protected SDMPipelineCreateRequest() {} + + /** + * Set the type of this {@link SDMPipelineCreateRequest} instance and return the same instance. + * + * @param type The type of this {@link SDMPipelineCreateRequest} + * @return The same instance of this {@link SDMPipelineCreateRequest} class + */ + @Nonnull + public SDMPipelineCreateRequest type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link SDMPipelineCreateRequest} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link SDMPipelineCreateRequest} instance. + * + * @param type The type of this {@link SDMPipelineCreateRequest} + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the metadata of this {@link SDMPipelineCreateRequest} instance and return the same + * instance. + * + * @param metadata The metadata of this {@link SDMPipelineCreateRequest} + * @return The same instance of this {@link SDMPipelineCreateRequest} class + */ + @Nonnull + public SDMPipelineCreateRequest metadata(@Nonnull final MetaData metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link SDMPipelineCreateRequest} instance. + */ + @Nonnull + public MetaData getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link SDMPipelineCreateRequest} instance. + * + * @param metadata The metadata of this {@link SDMPipelineCreateRequest} + */ + public void setMetadata(@Nonnull final MetaData metadata) { + this.metadata = metadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link SDMPipelineCreateRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SDMPipelineCreateRequest} 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( + "SDMPipelineCreateRequest has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link SDMPipelineCreateRequest} 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 (metadata != null) declaredFields.put("metadata", metadata); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link SDMPipelineCreateRequest} 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 SDMPipelineCreateRequest sdMPipelineCreateRequest = (SDMPipelineCreateRequest) o; + return Objects.equals(this.cloudSdkCustomFields, sdMPipelineCreateRequest.cloudSdkCustomFields) + && Objects.equals(this.type, sdMPipelineCreateRequest.type) + && Objects.equals(this.metadata, sdMPipelineCreateRequest.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(type, metadata, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class SDMPipelineCreateRequest {\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 + * SDMPipelineCreateRequest} instance with all required arguments. + */ + public static Builder create() { + return (type) -> (metadata) -> new SDMPipelineCreateRequest().type(type).metadata(metadata); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link SDMPipelineCreateRequest} instance. + * + * @param type The type of this {@link SDMPipelineCreateRequest} + * @return The SDMPipelineCreateRequest builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the metadata of this {@link SDMPipelineCreateRequest} instance. + * + * @param metadata The metadata of this {@link SDMPipelineCreateRequest} + * @return The SDMPipelineCreateRequest instance. + */ + SDMPipelineCreateRequest metadata(@Nonnull final MetaData metadata); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SDMPipelineGetResponse.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SDMPipelineGetResponse.java new file mode 100644 index 000000000..c07aeee66 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SDMPipelineGetResponse.java @@ -0,0 +1,338 @@ +/* + * 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; + +/** SDMPipelineGetResponse */ +// CHECKSTYLE:OFF +public class SDMPipelineGetResponse implements GetPipeline +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + /** Gets or Sets type */ + public enum TypeEnum { + /** The SDM option of this SDMPipelineGetResponse */ + SDM("SDM"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this SDMPipelineGetResponse */ + 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 SDMPipelineGetResponse + */ + @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; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SDMPipelineGetResponse. */ + protected SDMPipelineGetResponse() {} + + /** + * Set the id of this {@link SDMPipelineGetResponse} instance and return the same instance. + * + * @param id The id of this {@link SDMPipelineGetResponse} + * @return The same instance of this {@link SDMPipelineGetResponse} class + */ + @Nonnull + public SDMPipelineGetResponse id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link SDMPipelineGetResponse} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link SDMPipelineGetResponse} instance. + * + * @param id The id of this {@link SDMPipelineGetResponse} + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the type of this {@link SDMPipelineGetResponse} instance and return the same instance. + * + * @param type The type of this {@link SDMPipelineGetResponse} + * @return The same instance of this {@link SDMPipelineGetResponse} class + */ + @Nonnull + public SDMPipelineGetResponse type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link SDMPipelineGetResponse} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link SDMPipelineGetResponse} instance. + * + * @param type The type of this {@link SDMPipelineGetResponse} + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the metadata of this {@link SDMPipelineGetResponse} instance and return the same instance. + * + * @param metadata The metadata of this {@link SDMPipelineGetResponse} + * @return The same instance of this {@link SDMPipelineGetResponse} class + */ + @Nonnull + public SDMPipelineGetResponse metadata(@Nonnull final MetaData metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link SDMPipelineGetResponse} instance. + */ + @Nonnull + public MetaData getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link SDMPipelineGetResponse} instance. + * + * @param metadata The metadata of this {@link SDMPipelineGetResponse} + */ + public void setMetadata(@Nonnull final MetaData metadata) { + this.metadata = metadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link SDMPipelineGetResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SDMPipelineGetResponse} 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( + "SDMPipelineGetResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link SDMPipelineGetResponse} 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 SDMPipelineGetResponse} 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 SDMPipelineGetResponse sdMPipelineGetResponse = (SDMPipelineGetResponse) o; + return Objects.equals(this.cloudSdkCustomFields, sdMPipelineGetResponse.cloudSdkCustomFields) + && Objects.equals(this.id, sdMPipelineGetResponse.id) + && Objects.equals(this.type, sdMPipelineGetResponse.type) + && Objects.equals(this.metadata, sdMPipelineGetResponse.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 SDMPipelineGetResponse {\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 SDMPipelineGetResponse} + * instance with all required arguments. + */ + public static Builder create() { + return (id) -> + (type) -> (metadata) -> new SDMPipelineGetResponse().id(id).type(type).metadata(metadata); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link SDMPipelineGetResponse} instance. + * + * @param id The id of this {@link SDMPipelineGetResponse} + * @return The SDMPipelineGetResponse builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the type of this {@link SDMPipelineGetResponse} instance. + * + * @param type The type of this {@link SDMPipelineGetResponse} + * @return The SDMPipelineGetResponse builder. + */ + Builder2 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the metadata of this {@link SDMPipelineGetResponse} instance. + * + * @param metadata The metadata of this {@link SDMPipelineGetResponse} + * @return The SDMPipelineGetResponse instance. + */ + SDMPipelineGetResponse metadata(@Nonnull final MetaData metadata); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CommonConfiguration.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SFTPConfiguration.java similarity index 61% rename from core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CommonConfiguration.java rename to core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SFTPConfiguration.java index 2d07db9f7..f08226ee2 100644 --- a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/CommonConfiguration.java +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SFTPConfiguration.java @@ -23,28 +23,31 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -/** CommonConfiguration */ +/** SFTPConfiguration */ // CHECKSTYLE:OFF -public class CommonConfiguration +public class SFTPConfiguration // CHECKSTYLE:ON { @JsonProperty("destination") private String destination; + @JsonProperty("sftp") + private SFTPConfigurationSftp sftp; + @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for CommonConfiguration. */ - protected CommonConfiguration() {} + /** Default constructor for SFTPConfiguration. */ + protected SFTPConfiguration() {} /** - * Set the destination of this {@link CommonConfiguration} instance and return the same instance. + * Set the destination of this {@link SFTPConfiguration} instance and return the same instance. * - * @param destination The destination of this {@link CommonConfiguration} - * @return The same instance of this {@link CommonConfiguration} class + * @param destination The destination of this {@link SFTPConfiguration} + * @return The same instance of this {@link SFTPConfiguration} class */ @Nonnull - public CommonConfiguration destination(@Nonnull final String destination) { + public SFTPConfiguration destination(@Nonnull final String destination) { this.destination = destination; return this; } @@ -52,7 +55,7 @@ public CommonConfiguration destination(@Nonnull final String destination) { /** * Get destination * - * @return destination The destination of this {@link CommonConfiguration} instance. + * @return destination The destination of this {@link SFTPConfiguration} instance. */ @Nonnull public String getDestination() { @@ -60,16 +63,47 @@ public String getDestination() { } /** - * Set the destination of this {@link CommonConfiguration} instance. + * Set the destination of this {@link SFTPConfiguration} instance. * - * @param destination The destination of this {@link CommonConfiguration} + * @param destination The destination of this {@link SFTPConfiguration} */ public void setDestination(@Nonnull final String destination) { this.destination = destination; } /** - * Get the names of the unrecognizable properties of the {@link CommonConfiguration}. + * Set the sftp of this {@link SFTPConfiguration} instance and return the same instance. + * + * @param sftp The sftp of this {@link SFTPConfiguration} + * @return The same instance of this {@link SFTPConfiguration} class + */ + @Nonnull + public SFTPConfiguration sftp(@Nullable final SFTPConfigurationSftp sftp) { + this.sftp = sftp; + return this; + } + + /** + * Get sftp + * + * @return sftp The sftp of this {@link SFTPConfiguration} instance. + */ + @Nonnull + public SFTPConfigurationSftp getSftp() { + return sftp; + } + + /** + * Set the sftp of this {@link SFTPConfiguration} instance. + * + * @param sftp The sftp of this {@link SFTPConfiguration} + */ + public void setSftp(@Nullable final SFTPConfigurationSftp sftp) { + this.sftp = sftp; + } + + /** + * Get the names of the unrecognizable properties of the {@link SFTPConfiguration}. * * @return The set of properties names */ @@ -80,7 +114,7 @@ public Set getCustomFieldNames() { } /** - * Get the value of an unrecognizable property of this {@link CommonConfiguration} instance. + * Get the value of an unrecognizable property of this {@link SFTPConfiguration} instance. * * @deprecated Use {@link #toMap()} instead. * @param name The name of the property @@ -91,14 +125,13 @@ public Set getCustomFieldNames() { @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "CommonConfiguration has no field with name '" + name + "'."); + throw new NoSuchElementException("SFTPConfiguration has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link CommonConfiguration} instance including + * Get the value of all properties of this {@link SFTPConfiguration} instance including * unrecognized properties. * * @return The map of all properties @@ -108,11 +141,12 @@ 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 (sftp != null) declaredFields.put("sftp", sftp); return declaredFields; } /** - * Set an unrecognizable property of this {@link CommonConfiguration} instance. If the map + * Set an unrecognizable property of this {@link SFTPConfiguration} 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 +165,24 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final CommonConfiguration commonConfiguration = (CommonConfiguration) o; - return Objects.equals(this.cloudSdkCustomFields, commonConfiguration.cloudSdkCustomFields) - && Objects.equals(this.destination, commonConfiguration.destination); + final SFTPConfiguration sfTPConfiguration = (SFTPConfiguration) o; + return Objects.equals(this.cloudSdkCustomFields, sfTPConfiguration.cloudSdkCustomFields) + && Objects.equals(this.destination, sfTPConfiguration.destination) + && Objects.equals(this.sftp, sfTPConfiguration.sftp); } @Override public int hashCode() { - return Objects.hash(destination, cloudSdkCustomFields); + return Objects.hash(destination, sftp, cloudSdkCustomFields); } @Override @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class CommonConfiguration {\n"); + sb.append("class SFTPConfiguration {\n"); sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" sftp: ").append(toIndentedString(sftp)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); @@ -165,21 +201,21 @@ private String toIndentedString(final java.lang.Object o) { } /** - * Create a type-safe, fluent-api builder object to construct a new {@link CommonConfiguration} + * Create a type-safe, fluent-api builder object to construct a new {@link SFTPConfiguration} * instance with all required arguments. */ public static Builder create() { - return (destination) -> new CommonConfiguration().destination(destination); + return (destination) -> new SFTPConfiguration().destination(destination); } /** Builder helper class. */ public interface Builder { /** - * Set the destination of this {@link CommonConfiguration} instance. + * Set the destination of this {@link SFTPConfiguration} instance. * - * @param destination The destination of this {@link CommonConfiguration} - * @return The CommonConfiguration instance. + * @param destination The destination of this {@link SFTPConfiguration} + * @return The SFTPConfiguration instance. */ - CommonConfiguration destination(@Nonnull final String destination); + SFTPConfiguration destination(@Nonnull final String destination); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SFTPConfigurationSftp.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SFTPConfigurationSftp.java new file mode 100644 index 000000000..d46db0b3d --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/SFTPConfigurationSftp.java @@ -0,0 +1,189 @@ +/* + * 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; + +/** SFTPConfigurationSftp */ +// CHECKSTYLE:OFF +public class SFTPConfigurationSftp +// CHECKSTYLE:ON +{ + @JsonProperty("includePaths") + private List includePaths = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SFTPConfigurationSftp. */ + protected SFTPConfigurationSftp() {} + + /** + * Set the includePaths of this {@link SFTPConfigurationSftp} instance and return the same + * instance. + * + * @param includePaths The includePaths of this {@link SFTPConfigurationSftp} + * @return The same instance of this {@link SFTPConfigurationSftp} class + */ + @Nonnull + public SFTPConfigurationSftp includePaths(@Nullable final List includePaths) { + this.includePaths = includePaths; + return this; + } + + /** + * Add one includePaths instance to this {@link SFTPConfigurationSftp}. + * + * @param includePathsItem The includePaths that should be added + * @return The same instance of type {@link SFTPConfigurationSftp} + */ + @Nonnull + public SFTPConfigurationSftp addIncludePathsItem(@Nonnull final String includePathsItem) { + if (this.includePaths == null) { + this.includePaths = new ArrayList<>(); + } + this.includePaths.add(includePathsItem); + return this; + } + + /** + * Get includePaths + * + * @return includePaths The includePaths of this {@link SFTPConfigurationSftp} instance. + */ + @Nonnull + public List getIncludePaths() { + return includePaths; + } + + /** + * Set the includePaths of this {@link SFTPConfigurationSftp} instance. + * + * @param includePaths The includePaths of this {@link SFTPConfigurationSftp} + */ + public void setIncludePaths(@Nullable final List includePaths) { + this.includePaths = includePaths; + } + + /** + * Get the names of the unrecognizable properties of the {@link SFTPConfigurationSftp}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SFTPConfigurationSftp} 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( + "SFTPConfigurationSftp has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link SFTPConfigurationSftp} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (includePaths != null) declaredFields.put("includePaths", includePaths); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link SFTPConfigurationSftp} 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 SFTPConfigurationSftp sfTPConfigurationSftp = (SFTPConfigurationSftp) o; + return Objects.equals(this.cloudSdkCustomFields, sfTPConfigurationSftp.cloudSdkCustomFields) + && Objects.equals(this.includePaths, sfTPConfigurationSftp.includePaths); + } + + @Override + public int hashCode() { + return Objects.hash(includePaths, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class SFTPConfigurationSftp {\n"); + sb.append(" includePaths: ").append(toIndentedString(includePaths)).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 SFTPConfigurationSftp} instance. No arguments are required. */ + public static SFTPConfigurationSftp create() { + return new SFTPConfigurationSftp(); + } +} 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 index 265a362da..3b3462b09 100644 --- 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 @@ -88,7 +88,7 @@ public static TypeEnum fromValue(@Nonnull final String value) { private TypeEnum type; @JsonProperty("configuration") - private CommonConfiguration _configuration; + private SFTPConfiguration _configuration; @JsonProperty("metadata") private MetaData metadata; @@ -138,8 +138,7 @@ public void setType(@Nonnull final TypeEnum type) { * @return The same instance of this {@link SFTPPipelineCreateRequest} class */ @Nonnull - public SFTPPipelineCreateRequest _configuration( - @Nonnull final CommonConfiguration _configuration) { + public SFTPPipelineCreateRequest _configuration(@Nonnull final SFTPConfiguration _configuration) { this._configuration = _configuration; return this; } @@ -150,7 +149,7 @@ public SFTPPipelineCreateRequest _configuration( * @return _configuration The _configuration of this {@link SFTPPipelineCreateRequest} instance. */ @Nonnull - public CommonConfiguration getConfiguration() { + public SFTPConfiguration getConfiguration() { return _configuration; } @@ -159,7 +158,7 @@ public CommonConfiguration getConfiguration() { * * @param _configuration The _configuration of this {@link SFTPPipelineCreateRequest} */ - public void setConfiguration(@Nonnull final CommonConfiguration _configuration) { + public void setConfiguration(@Nonnull final SFTPConfiguration _configuration) { this._configuration = _configuration; } @@ -326,6 +325,6 @@ public interface Builder1 { * @param _configuration The _configuration of this {@link SFTPPipelineCreateRequest} * @return The SFTPPipelineCreateRequest instance. */ - SFTPPipelineCreateRequest _configuration(@Nonnull final CommonConfiguration _configuration); + SFTPPipelineCreateRequest _configuration(@Nonnull final SFTPConfiguration _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 index 6fe5e0324..6a3f01df4 100644 --- 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 @@ -94,7 +94,7 @@ public static TypeEnum fromValue(@Nonnull final String value) { private MetaData metadata; @JsonProperty("configuration") - private CommonConfiguration _configuration; + private SFTPConfiguration _configuration; @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -203,7 +203,7 @@ public void setMetadata(@Nullable final MetaData metadata) { * @return The same instance of this {@link SFTPPipelineGetResponse} class */ @Nonnull - public SFTPPipelineGetResponse _configuration(@Nonnull final CommonConfiguration _configuration) { + public SFTPPipelineGetResponse _configuration(@Nonnull final SFTPConfiguration _configuration) { this._configuration = _configuration; return this; } @@ -214,7 +214,7 @@ public SFTPPipelineGetResponse _configuration(@Nonnull final CommonConfiguration * @return _configuration The _configuration of this {@link SFTPPipelineGetResponse} instance. */ @Nonnull - public CommonConfiguration getConfiguration() { + public SFTPConfiguration getConfiguration() { return _configuration; } @@ -223,7 +223,7 @@ public CommonConfiguration getConfiguration() { * * @param _configuration The _configuration of this {@link SFTPPipelineGetResponse} */ - public void setConfiguration(@Nonnull final CommonConfiguration _configuration) { + public void setConfiguration(@Nonnull final SFTPConfiguration _configuration) { this._configuration = _configuration; } @@ -373,6 +373,6 @@ public interface Builder2 { * @param _configuration The _configuration of this {@link SFTPPipelineGetResponse} * @return The SFTPPipelineGetResponse instance. */ - SFTPPipelineGetResponse _configuration(@Nonnull final CommonConfiguration _configuration); + SFTPPipelineGetResponse _configuration(@Nonnull final SFTPConfiguration _configuration); } } 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 e027733b1..98c9775ce 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 @@ -35,7 +35,7 @@ public class TextOnlyBaseChunk private String content; @JsonProperty("metadata") - private List metadata = new ArrayList<>(); + private List metadata = new ArrayList<>(); @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -81,7 +81,7 @@ public void setContent(@Nonnull final String content) { * @return The same instance of this {@link TextOnlyBaseChunk} class */ @Nonnull - public TextOnlyBaseChunk metadata(@Nonnull final List metadata) { + public TextOnlyBaseChunk metadata(@Nonnull final List metadata) { this.metadata = metadata; return this; } @@ -93,7 +93,7 @@ public TextOnlyBaseChunk metadata(@Nonnull final List metadata * @return The same instance of type {@link TextOnlyBaseChunk} */ @Nonnull - public TextOnlyBaseChunk addMetadataItem(@Nonnull final KeyValueListPair metadataItem) { + public TextOnlyBaseChunk addMetadataItem(@Nonnull final VectorKeyValueListPair metadataItem) { if (this.metadata == null) { this.metadata = new ArrayList<>(); } @@ -107,7 +107,7 @@ public TextOnlyBaseChunk addMetadataItem(@Nonnull final KeyValueListPair metadat * @return metadata The metadata of this {@link TextOnlyBaseChunk} instance. */ @Nonnull - public List getMetadata() { + public List getMetadata() { return metadata; } @@ -116,7 +116,7 @@ public List getMetadata() { * * @param metadata The metadata of this {@link TextOnlyBaseChunk} */ - public void setMetadata(@Nonnull final List metadata) { + public void setMetadata(@Nonnull final List metadata) { this.metadata = metadata; } @@ -245,7 +245,7 @@ public interface Builder1 { * @param metadata The metadata of this {@link TextOnlyBaseChunk} * @return The TextOnlyBaseChunk instance. */ - TextOnlyBaseChunk metadata(@Nonnull final List metadata); + TextOnlyBaseChunk metadata(@Nonnull final List metadata); /** * Set the metadata of this {@link TextOnlyBaseChunk} instance. @@ -253,7 +253,7 @@ public interface Builder1 { * @param metadata The metadata of this {@link TextOnlyBaseChunk} * @return The TextOnlyBaseChunk instance. */ - default TextOnlyBaseChunk metadata(@Nonnull final KeyValueListPair... metadata) { + default TextOnlyBaseChunk metadata(@Nonnull final VectorKeyValueListPair... metadata) { return metadata(Arrays.asList(metadata)); } } 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 7ecd57f07..d4b6781db 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 @@ -35,7 +35,7 @@ public class TextSearchRequest private String query; @JsonProperty("filters") - private List filters = new ArrayList<>(); + private List filters = new ArrayList<>(); @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -81,7 +81,7 @@ public void setQuery(@Nonnull final String query) { * @return The same instance of this {@link TextSearchRequest} class */ @Nonnull - public TextSearchRequest filters(@Nonnull final List filters) { + public TextSearchRequest filters(@Nonnull final List filters) { this.filters = filters; return this; } @@ -93,7 +93,7 @@ public TextSearchRequest filters(@Nonnull final List filters) { * @return The same instance of type {@link TextSearchRequest} */ @Nonnull - public TextSearchRequest addFiltersItem(@Nonnull final SearchFilter filtersItem) { + public TextSearchRequest addFiltersItem(@Nonnull final VectorSearchFilter filtersItem) { if (this.filters == null) { this.filters = new ArrayList<>(); } @@ -107,7 +107,7 @@ public TextSearchRequest addFiltersItem(@Nonnull final SearchFilter filtersItem) * @return filters The filters of this {@link TextSearchRequest} instance. */ @Nonnull - public List getFilters() { + public List getFilters() { return filters; } @@ -116,7 +116,7 @@ public List getFilters() { * * @param filters The filters of this {@link TextSearchRequest} */ - public void setFilters(@Nonnull final List filters) { + public void setFilters(@Nonnull final List filters) { this.filters = filters; } @@ -245,7 +245,7 @@ public interface Builder1 { * @param filters The filters of this {@link TextSearchRequest} * @return The TextSearchRequest instance. */ - TextSearchRequest filters(@Nonnull final List filters); + TextSearchRequest filters(@Nonnull final List filters); /** * Set the filters of this {@link TextSearchRequest} instance. @@ -253,7 +253,7 @@ public interface Builder1 { * @param filters The filters of this {@link TextSearchRequest} * @return The TextSearchRequest instance. */ - default TextSearchRequest filters(@Nonnull final SearchFilter... filters) { + default TextSearchRequest filters(@Nonnull final VectorSearchFilter... filters) { return filters(Arrays.asList(filters)); } } diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorChunk.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorChunk.java new file mode 100644 index 000000000..02953481f --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorChunk.java @@ -0,0 +1,286 @@ +/* + * 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; + +/** VectorChunk */ +// CHECKSTYLE:OFF +public class VectorChunk +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("content") + private String content; + + @JsonProperty("metadata") + private List metadata = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for VectorChunk. */ + protected VectorChunk() {} + + /** + * Set the id of this {@link VectorChunk} instance and return the same instance. + * + * @param id The id of this {@link VectorChunk} + * @return The same instance of this {@link VectorChunk} class + */ + @Nonnull + public VectorChunk id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link VectorChunk} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link VectorChunk} instance. + * + * @param id The id of this {@link VectorChunk} + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the content of this {@link VectorChunk} instance and return the same instance. + * + * @param content The content of this {@link VectorChunk} + * @return The same instance of this {@link VectorChunk} class + */ + @Nonnull + public VectorChunk content(@Nonnull final String content) { + this.content = content; + return this; + } + + /** + * Get content + * + * @return content The content of this {@link VectorChunk} instance. + */ + @Nonnull + public String getContent() { + return content; + } + + /** + * Set the content of this {@link VectorChunk} instance. + * + * @param content The content of this {@link VectorChunk} + */ + public void setContent(@Nonnull final String content) { + this.content = content; + } + + /** + * Set the metadata of this {@link VectorChunk} instance and return the same instance. + * + * @param metadata The metadata of this {@link VectorChunk} + * @return The same instance of this {@link VectorChunk} class + */ + @Nonnull + public VectorChunk metadata(@Nullable final List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Add one metadata instance to this {@link VectorChunk}. + * + * @param metadataItem The metadata that should be added + * @return The same instance of type {@link VectorChunk} + */ + @Nonnull + public VectorChunk addMetadataItem(@Nonnull final VectorKeyValueListPair metadataItem) { + if (this.metadata == null) { + this.metadata = new ArrayList<>(); + } + this.metadata.add(metadataItem); + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link VectorChunk} instance. + */ + @Nonnull + public List getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link VectorChunk} instance. + * + * @param metadata The metadata of this {@link VectorChunk} + */ + public void setMetadata(@Nullable final List metadata) { + this.metadata = metadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link VectorChunk}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link VectorChunk} 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("VectorChunk has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link VectorChunk} 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 (content != null) declaredFields.put("content", content); + if (metadata != null) declaredFields.put("metadata", metadata); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link VectorChunk} 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 VectorChunk vectorChunk = (VectorChunk) o; + return Objects.equals(this.cloudSdkCustomFields, vectorChunk.cloudSdkCustomFields) + && Objects.equals(this.id, vectorChunk.id) + && Objects.equals(this.content, vectorChunk.content) + && Objects.equals(this.metadata, vectorChunk.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(id, content, metadata, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class VectorChunk {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).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 VectorChunk} instance + * with all required arguments. + */ + public static Builder create() { + return (id) -> (content) -> new VectorChunk().id(id).content(content); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link VectorChunk} instance. + * + * @param id The id of this {@link VectorChunk} + * @return The VectorChunk builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the content of this {@link VectorChunk} instance. + * + * @param content The content of this {@link VectorChunk} + * @return The VectorChunk instance. + */ + VectorChunk content(@Nonnull final String content); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorDocumentKeyValueListPair.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorDocumentKeyValueListPair.java new file mode 100644 index 000000000..933540a5b --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorDocumentKeyValueListPair.java @@ -0,0 +1,364 @@ +/* + * 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.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; + +/** VectorDocumentKeyValueListPair */ +// CHECKSTYLE:OFF +public class VectorDocumentKeyValueListPair +// CHECKSTYLE:ON +{ + @JsonProperty("key") + private String key; + + @JsonProperty("value") + private List value = new ArrayList<>(); + + /** Gets or Sets matchMode */ + public enum MatchModeEnum { + /** The ANY option of this VectorDocumentKeyValueListPair */ + ANY("ANY"), + + /** The ALL option of this VectorDocumentKeyValueListPair */ + ALL("ALL"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this VectorDocumentKeyValueListPair */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + MatchModeEnum(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 VectorDocumentKeyValueListPair + */ + @JsonCreator + @Nullable + public static MatchModeEnum fromValue(@Nonnull final String value) { + for (MatchModeEnum b : MatchModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + } + + @JsonProperty("matchMode") + private MatchModeEnum matchMode; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for VectorDocumentKeyValueListPair. */ + protected VectorDocumentKeyValueListPair() {} + + /** + * Set the key of this {@link VectorDocumentKeyValueListPair} instance and return the same + * instance. + * + * @param key The key of this {@link VectorDocumentKeyValueListPair} + * @return The same instance of this {@link VectorDocumentKeyValueListPair} class + */ + @Nonnull + public VectorDocumentKeyValueListPair key(@Nonnull final String key) { + this.key = key; + return this; + } + + /** + * Get key + * + * @return key The key of this {@link VectorDocumentKeyValueListPair} instance. + */ + @Nonnull + public String getKey() { + return key; + } + + /** + * Set the key of this {@link VectorDocumentKeyValueListPair} instance. + * + * @param key The key of this {@link VectorDocumentKeyValueListPair} + */ + public void setKey(@Nonnull final String key) { + this.key = key; + } + + /** + * Set the value of this {@link VectorDocumentKeyValueListPair} instance and return the same + * instance. + * + * @param value The value of this {@link VectorDocumentKeyValueListPair} + * @return The same instance of this {@link VectorDocumentKeyValueListPair} class + */ + @Nonnull + public VectorDocumentKeyValueListPair value(@Nonnull final List value) { + this.value = value; + return this; + } + + /** + * Add one value instance to this {@link VectorDocumentKeyValueListPair}. + * + * @param valueItem The value that should be added + * @return The same instance of type {@link VectorDocumentKeyValueListPair} + */ + @Nonnull + public VectorDocumentKeyValueListPair addValueItem(@Nonnull final String valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * + * @return value The value of this {@link VectorDocumentKeyValueListPair} instance. + */ + @Nonnull + public List getValue() { + return value; + } + + /** + * Set the value of this {@link VectorDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link VectorDocumentKeyValueListPair} + */ + public void setValue(@Nonnull final List value) { + this.value = value; + } + + /** + * Set the matchMode of this {@link VectorDocumentKeyValueListPair} instance and return the same + * instance. + * + * @param matchMode The matchMode of this {@link VectorDocumentKeyValueListPair} + * @return The same instance of this {@link VectorDocumentKeyValueListPair} class + */ + @Nonnull + public VectorDocumentKeyValueListPair matchMode(@Nullable final MatchModeEnum matchMode) { + this.matchMode = matchMode; + return this; + } + + /** + * Get matchMode + * + * @return matchMode The matchMode of this {@link VectorDocumentKeyValueListPair} instance. + */ + @Nullable + public MatchModeEnum getMatchMode() { + return matchMode; + } + + /** + * Set the matchMode of this {@link VectorDocumentKeyValueListPair} instance. + * + * @param matchMode The matchMode of this {@link VectorDocumentKeyValueListPair} + */ + public void setMatchMode(@Nullable final MatchModeEnum matchMode) { + this.matchMode = matchMode; + } + + /** + * Get the names of the unrecognizable properties of the {@link VectorDocumentKeyValueListPair}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link VectorDocumentKeyValueListPair} + * 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( + "VectorDocumentKeyValueListPair has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link VectorDocumentKeyValueListPair} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (key != null) declaredFields.put("key", key); + if (value != null) declaredFields.put("value", value); + if (matchMode != null) declaredFields.put("matchMode", matchMode); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link VectorDocumentKeyValueListPair} 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 VectorDocumentKeyValueListPair vectorDocumentKeyValueListPair = + (VectorDocumentKeyValueListPair) o; + return Objects.equals( + this.cloudSdkCustomFields, vectorDocumentKeyValueListPair.cloudSdkCustomFields) + && Objects.equals(this.key, vectorDocumentKeyValueListPair.key) + && Objects.equals(this.value, vectorDocumentKeyValueListPair.value) + && Objects.equals(this.matchMode, vectorDocumentKeyValueListPair.matchMode); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, matchMode, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class VectorDocumentKeyValueListPair {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" matchMode: ").append(toIndentedString(matchMode)).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 + * VectorDocumentKeyValueListPair} instance with all required arguments. + */ + public static Builder create() { + return (key) -> (value) -> new VectorDocumentKeyValueListPair().key(key).value(value); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the key of this {@link VectorDocumentKeyValueListPair} instance. + * + * @param key The key of this {@link VectorDocumentKeyValueListPair} + * @return The VectorDocumentKeyValueListPair builder. + */ + Builder1 key(@Nonnull final String key); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the value of this {@link VectorDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link VectorDocumentKeyValueListPair} + * @return The VectorDocumentKeyValueListPair instance. + */ + VectorDocumentKeyValueListPair value(@Nonnull final List value); + + /** + * Set the value of this {@link VectorDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link VectorDocumentKeyValueListPair} + * @return The VectorDocumentKeyValueListPair instance. + */ + default VectorDocumentKeyValueListPair value(@Nonnull final String... value) { + return value(Arrays.asList(value)); + } + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorKeyValueListPair.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorKeyValueListPair.java new file mode 100644 index 000000000..2cbd0b162 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorKeyValueListPair.java @@ -0,0 +1,261 @@ +/* + * 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; + +/** VectorKeyValueListPair */ +// CHECKSTYLE:OFF +public class VectorKeyValueListPair +// CHECKSTYLE:ON +{ + @JsonProperty("key") + private String key; + + @JsonProperty("value") + private List value = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for VectorKeyValueListPair. */ + protected VectorKeyValueListPair() {} + + /** + * Set the key of this {@link VectorKeyValueListPair} instance and return the same instance. + * + * @param key The key of this {@link VectorKeyValueListPair} + * @return The same instance of this {@link VectorKeyValueListPair} class + */ + @Nonnull + public VectorKeyValueListPair key(@Nonnull final String key) { + this.key = key; + return this; + } + + /** + * Get key + * + * @return key The key of this {@link VectorKeyValueListPair} instance. + */ + @Nonnull + public String getKey() { + return key; + } + + /** + * Set the key of this {@link VectorKeyValueListPair} instance. + * + * @param key The key of this {@link VectorKeyValueListPair} + */ + public void setKey(@Nonnull final String key) { + this.key = key; + } + + /** + * Set the value of this {@link VectorKeyValueListPair} instance and return the same instance. + * + * @param value The value of this {@link VectorKeyValueListPair} + * @return The same instance of this {@link VectorKeyValueListPair} class + */ + @Nonnull + public VectorKeyValueListPair value(@Nonnull final List value) { + this.value = value; + return this; + } + + /** + * Add one value instance to this {@link VectorKeyValueListPair}. + * + * @param valueItem The value that should be added + * @return The same instance of type {@link VectorKeyValueListPair} + */ + @Nonnull + public VectorKeyValueListPair addValueItem(@Nonnull final String valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * + * @return value The value of this {@link VectorKeyValueListPair} instance. + */ + @Nonnull + public List getValue() { + return value; + } + + /** + * Set the value of this {@link VectorKeyValueListPair} instance. + * + * @param value The value of this {@link VectorKeyValueListPair} + */ + public void setValue(@Nonnull final List value) { + this.value = value; + } + + /** + * Get the names of the unrecognizable properties of the {@link VectorKeyValueListPair}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link VectorKeyValueListPair} 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( + "VectorKeyValueListPair has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link VectorKeyValueListPair} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (key != null) declaredFields.put("key", key); + if (value != null) declaredFields.put("value", value); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link VectorKeyValueListPair} 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 VectorKeyValueListPair vectorKeyValueListPair = (VectorKeyValueListPair) o; + return Objects.equals(this.cloudSdkCustomFields, vectorKeyValueListPair.cloudSdkCustomFields) + && Objects.equals(this.key, vectorKeyValueListPair.key) + && Objects.equals(this.value, vectorKeyValueListPair.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class VectorKeyValueListPair {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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 VectorKeyValueListPair} + * instance with all required arguments. + */ + public static Builder create() { + return (key) -> (value) -> new VectorKeyValueListPair().key(key).value(value); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the key of this {@link VectorKeyValueListPair} instance. + * + * @param key The key of this {@link VectorKeyValueListPair} + * @return The VectorKeyValueListPair builder. + */ + Builder1 key(@Nonnull final String key); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the value of this {@link VectorKeyValueListPair} instance. + * + * @param value The value of this {@link VectorKeyValueListPair} + * @return The VectorKeyValueListPair instance. + */ + VectorKeyValueListPair value(@Nonnull final List value); + + /** + * Set the value of this {@link VectorKeyValueListPair} instance. + * + * @param value The value of this {@link VectorKeyValueListPair} + * @return The VectorKeyValueListPair instance. + */ + default VectorKeyValueListPair value(@Nonnull final String... value) { + return value(Arrays.asList(value)); + } + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorPerFilterSearchResult.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorPerFilterSearchResult.java new file mode 100644 index 000000000..a735824c9 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorPerFilterSearchResult.java @@ -0,0 +1,266 @@ +/* + * 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; + +/** VectorPerFilterSearchResult */ +// CHECKSTYLE:OFF +public class VectorPerFilterSearchResult +// 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 VectorPerFilterSearchResult. */ + protected VectorPerFilterSearchResult() {} + + /** + * Set the filterId of this {@link VectorPerFilterSearchResult} instance and return the same + * instance. + * + * @param filterId The filterId of this {@link VectorPerFilterSearchResult} + * @return The same instance of this {@link VectorPerFilterSearchResult} class + */ + @Nonnull + public VectorPerFilterSearchResult filterId(@Nonnull final String filterId) { + this.filterId = filterId; + return this; + } + + /** + * Get filterId + * + * @return filterId The filterId of this {@link VectorPerFilterSearchResult} instance. + */ + @Nonnull + public String getFilterId() { + return filterId; + } + + /** + * Set the filterId of this {@link VectorPerFilterSearchResult} instance. + * + * @param filterId The filterId of this {@link VectorPerFilterSearchResult} + */ + public void setFilterId(@Nonnull final String filterId) { + this.filterId = filterId; + } + + /** + * Set the results of this {@link VectorPerFilterSearchResult} instance and return the same + * instance. + * + * @param results The results of this {@link VectorPerFilterSearchResult} + * @return The same instance of this {@link VectorPerFilterSearchResult} class + */ + @Nonnull + public VectorPerFilterSearchResult results(@Nonnull final List results) { + this.results = results; + return this; + } + + /** + * Add one results instance to this {@link VectorPerFilterSearchResult}. + * + * @param resultsItem The results that should be added + * @return The same instance of type {@link VectorPerFilterSearchResult} + */ + @Nonnull + public VectorPerFilterSearchResult addResultsItem(@Nonnull final DocumentsChunk resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Get results + * + * @return results The results of this {@link VectorPerFilterSearchResult} instance. + */ + @Nonnull + public List getResults() { + return results; + } + + /** + * Set the results of this {@link VectorPerFilterSearchResult} instance. + * + * @param results The results of this {@link VectorPerFilterSearchResult} + */ + public void setResults(@Nonnull final List results) { + this.results = results; + } + + /** + * Get the names of the unrecognizable properties of the {@link VectorPerFilterSearchResult}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link VectorPerFilterSearchResult} + * 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( + "VectorPerFilterSearchResult has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link VectorPerFilterSearchResult} 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 VectorPerFilterSearchResult} 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 VectorPerFilterSearchResult vectorPerFilterSearchResult = (VectorPerFilterSearchResult) o; + return Objects.equals( + this.cloudSdkCustomFields, vectorPerFilterSearchResult.cloudSdkCustomFields) + && Objects.equals(this.filterId, vectorPerFilterSearchResult.filterId) + && Objects.equals(this.results, vectorPerFilterSearchResult.results); + } + + @Override + public int hashCode() { + return Objects.hash(filterId, results, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class VectorPerFilterSearchResult {\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 + * VectorPerFilterSearchResult} instance with all required arguments. + */ + public static Builder create() { + return (filterId) -> + (results) -> new VectorPerFilterSearchResult().filterId(filterId).results(results); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filterId of this {@link VectorPerFilterSearchResult} instance. + * + * @param filterId The filterId of this {@link VectorPerFilterSearchResult} + * @return The VectorPerFilterSearchResult builder. + */ + Builder1 filterId(@Nonnull final String filterId); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the results of this {@link VectorPerFilterSearchResult} instance. + * + * @param results The results of this {@link VectorPerFilterSearchResult} + * @return The VectorPerFilterSearchResult instance. + */ + VectorPerFilterSearchResult results(@Nonnull final List results); + + /** + * Set the results of this {@link VectorPerFilterSearchResult} instance. + * + * @param results The results of this {@link VectorPerFilterSearchResult} + * @return The VectorPerFilterSearchResult instance. + */ + default VectorPerFilterSearchResult results(@Nonnull final DocumentsChunk... results) { + return results(Arrays.asList(results)); + } + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorSearchConfiguration.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorSearchConfiguration.java new file mode 100644 index 000000000..ceb7c20f0 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorSearchConfiguration.java @@ -0,0 +1,220 @@ +/* + * 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; + +/** VectorSearchConfiguration */ +// CHECKSTYLE:OFF +public class VectorSearchConfiguration +// CHECKSTYLE:ON +{ + @JsonProperty("maxChunkCount") + private Integer maxChunkCount; + + @JsonProperty("maxDocumentCount") + private Integer maxDocumentCount; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for VectorSearchConfiguration. */ + protected VectorSearchConfiguration() {} + + /** + * Set the maxChunkCount of this {@link VectorSearchConfiguration} 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 VectorSearchConfiguration} class + */ + @Nonnull + public VectorSearchConfiguration 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 VectorSearchConfiguration} instance. + */ + @Nullable + public Integer getMaxChunkCount() { + return maxChunkCount; + } + + /** + * Set the maxChunkCount of this {@link VectorSearchConfiguration} 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 VectorSearchConfiguration} 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 VectorSearchConfiguration} class + */ + @Nonnull + public VectorSearchConfiguration 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 VectorSearchConfiguration} + * instance. + */ + @Nullable + public Integer getMaxDocumentCount() { + return maxDocumentCount; + } + + /** + * Set the maxDocumentCount of this {@link VectorSearchConfiguration} 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 VectorSearchConfiguration}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link VectorSearchConfiguration} 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( + "VectorSearchConfiguration has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link VectorSearchConfiguration} 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 VectorSearchConfiguration} 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 VectorSearchConfiguration vectorSearchConfiguration = (VectorSearchConfiguration) o; + return Objects.equals(this.cloudSdkCustomFields, vectorSearchConfiguration.cloudSdkCustomFields) + && Objects.equals(this.maxChunkCount, vectorSearchConfiguration.maxChunkCount) + && Objects.equals(this.maxDocumentCount, vectorSearchConfiguration.maxDocumentCount); + } + + @Override + public int hashCode() { + return Objects.hash(maxChunkCount, maxDocumentCount, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class VectorSearchConfiguration {\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 VectorSearchConfiguration} instance. No arguments are required. */ + public static VectorSearchConfiguration create() { + return new VectorSearchConfiguration(); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorSearchDocumentKeyValueListPair.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorSearchDocumentKeyValueListPair.java new file mode 100644 index 000000000..af9601f91 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorSearchDocumentKeyValueListPair.java @@ -0,0 +1,324 @@ +/* + * 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; + +/** VectorSearchDocumentKeyValueListPair */ +// CHECKSTYLE:OFF +public class VectorSearchDocumentKeyValueListPair +// CHECKSTYLE:ON +{ + @JsonProperty("key") + private String key; + + @JsonProperty("value") + private List value = new ArrayList<>(); + + @JsonProperty("selectMode") + private List selectMode = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for VectorSearchDocumentKeyValueListPair. */ + protected VectorSearchDocumentKeyValueListPair() {} + + /** + * Set the key of this {@link VectorSearchDocumentKeyValueListPair} instance and return the same + * instance. + * + * @param key The key of this {@link VectorSearchDocumentKeyValueListPair} + * @return The same instance of this {@link VectorSearchDocumentKeyValueListPair} class + */ + @Nonnull + public VectorSearchDocumentKeyValueListPair key(@Nonnull final String key) { + this.key = key; + return this; + } + + /** + * Get key + * + * @return key The key of this {@link VectorSearchDocumentKeyValueListPair} instance. + */ + @Nonnull + public String getKey() { + return key; + } + + /** + * Set the key of this {@link VectorSearchDocumentKeyValueListPair} instance. + * + * @param key The key of this {@link VectorSearchDocumentKeyValueListPair} + */ + public void setKey(@Nonnull final String key) { + this.key = key; + } + + /** + * Set the value of this {@link VectorSearchDocumentKeyValueListPair} instance and return the same + * instance. + * + * @param value The value of this {@link VectorSearchDocumentKeyValueListPair} + * @return The same instance of this {@link VectorSearchDocumentKeyValueListPair} class + */ + @Nonnull + public VectorSearchDocumentKeyValueListPair value(@Nonnull final List value) { + this.value = value; + return this; + } + + /** + * Add one value instance to this {@link VectorSearchDocumentKeyValueListPair}. + * + * @param valueItem The value that should be added + * @return The same instance of type {@link VectorSearchDocumentKeyValueListPair} + */ + @Nonnull + public VectorSearchDocumentKeyValueListPair addValueItem(@Nonnull final String valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * + * @return value The value of this {@link VectorSearchDocumentKeyValueListPair} instance. + */ + @Nonnull + public List getValue() { + return value; + } + + /** + * Set the value of this {@link VectorSearchDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link VectorSearchDocumentKeyValueListPair} + */ + public void setValue(@Nonnull final List value) { + this.value = value; + } + + /** + * Set the selectMode of this {@link VectorSearchDocumentKeyValueListPair} instance and return the + * same instance. + * + * @param selectMode Select mode for search filters + * @return The same instance of this {@link VectorSearchDocumentKeyValueListPair} class + */ + @Nonnull + public VectorSearchDocumentKeyValueListPair selectMode( + @Nullable final List selectMode) { + this.selectMode = selectMode; + return this; + } + + /** + * Add one selectMode instance to this {@link VectorSearchDocumentKeyValueListPair}. + * + * @param selectModeItem The selectMode that should be added + * @return The same instance of type {@link VectorSearchDocumentKeyValueListPair} + */ + @Nonnull + public VectorSearchDocumentKeyValueListPair addSelectModeItem( + @Nonnull final VectorSearchSelectOptionEnum selectModeItem) { + if (this.selectMode == null) { + this.selectMode = new ArrayList<>(); + } + this.selectMode.add(selectModeItem); + return this; + } + + /** + * Select mode for search filters + * + * @return selectMode The selectMode of this {@link VectorSearchDocumentKeyValueListPair} + * instance. + */ + @Nonnull + public List getSelectMode() { + return selectMode; + } + + /** + * Set the selectMode of this {@link VectorSearchDocumentKeyValueListPair} instance. + * + * @param selectMode Select mode for search filters + */ + public void setSelectMode(@Nullable final List selectMode) { + this.selectMode = selectMode; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * VectorSearchDocumentKeyValueListPair}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * VectorSearchDocumentKeyValueListPair} 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( + "VectorSearchDocumentKeyValueListPair has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link VectorSearchDocumentKeyValueListPair} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (key != null) declaredFields.put("key", key); + if (value != null) declaredFields.put("value", value); + if (selectMode != null) declaredFields.put("selectMode", selectMode); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link VectorSearchDocumentKeyValueListPair} 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 VectorSearchDocumentKeyValueListPair vectorSearchDocumentKeyValueListPair = + (VectorSearchDocumentKeyValueListPair) o; + return Objects.equals( + this.cloudSdkCustomFields, vectorSearchDocumentKeyValueListPair.cloudSdkCustomFields) + && Objects.equals(this.key, vectorSearchDocumentKeyValueListPair.key) + && Objects.equals(this.value, vectorSearchDocumentKeyValueListPair.value) + && Objects.equals(this.selectMode, vectorSearchDocumentKeyValueListPair.selectMode); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, selectMode, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class VectorSearchDocumentKeyValueListPair {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" selectMode: ").append(toIndentedString(selectMode)).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 + * VectorSearchDocumentKeyValueListPair} instance with all required arguments. + */ + public static Builder create() { + return (key) -> (value) -> new VectorSearchDocumentKeyValueListPair().key(key).value(value); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the key of this {@link VectorSearchDocumentKeyValueListPair} instance. + * + * @param key The key of this {@link VectorSearchDocumentKeyValueListPair} + * @return The VectorSearchDocumentKeyValueListPair builder. + */ + Builder1 key(@Nonnull final String key); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the value of this {@link VectorSearchDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link VectorSearchDocumentKeyValueListPair} + * @return The VectorSearchDocumentKeyValueListPair instance. + */ + VectorSearchDocumentKeyValueListPair value(@Nonnull final List value); + + /** + * Set the value of this {@link VectorSearchDocumentKeyValueListPair} instance. + * + * @param value The value of this {@link VectorSearchDocumentKeyValueListPair} + * @return The VectorSearchDocumentKeyValueListPair instance. + */ + default VectorSearchDocumentKeyValueListPair value(@Nonnull final String... value) { + return value(Arrays.asList(value)); + } + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorSearchFilter.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorSearchFilter.java new file mode 100644 index 000000000..28a10a70a --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorSearchFilter.java @@ -0,0 +1,494 @@ +/* + * 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; + +/** VectorSearchFilter */ +// CHECKSTYLE:OFF +public class VectorSearchFilter +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("collectionIds") + private List collectionIds = new ArrayList<>(); + + @JsonProperty("configuration") + private VectorSearchConfiguration _configuration; + + @JsonProperty("collectionMetadata") + private List collectionMetadata = new ArrayList<>(); + + @JsonProperty("documentMetadata") + private List documentMetadata = new ArrayList<>(); + + @JsonProperty("chunkMetadata") + private List chunkMetadata = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for VectorSearchFilter. */ + protected VectorSearchFilter() {} + + /** + * Set the id of this {@link VectorSearchFilter} instance and return the same instance. + * + * @param id Identifier of this VectorSearchFilter - unique per request. + * @return The same instance of this {@link VectorSearchFilter} class + */ + @Nonnull + public VectorSearchFilter id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Identifier of this VectorSearchFilter - unique per request. + * + * @return id The id of this {@link VectorSearchFilter} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link VectorSearchFilter} instance. + * + * @param id Identifier of this VectorSearchFilter - unique per request. + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the collectionIds of this {@link VectorSearchFilter} instance and return the same instance. + * + * @param collectionIds The collectionIds of this {@link VectorSearchFilter} + * @return The same instance of this {@link VectorSearchFilter} class + */ + @Nonnull + public VectorSearchFilter collectionIds(@Nonnull final List collectionIds) { + this.collectionIds = collectionIds; + return this; + } + + /** + * Add one collectionIds instance to this {@link VectorSearchFilter}. + * + * @param collectionIdsItem The collectionIds that should be added + * @return The same instance of type {@link VectorSearchFilter} + */ + @Nonnull + public VectorSearchFilter addCollectionIdsItem(@Nonnull final String collectionIdsItem) { + if (this.collectionIds == null) { + this.collectionIds = new ArrayList<>(); + } + this.collectionIds.add(collectionIdsItem); + return this; + } + + /** + * Get collectionIds + * + * @return collectionIds The collectionIds of this {@link VectorSearchFilter} instance. + */ + @Nonnull + public List getCollectionIds() { + return collectionIds; + } + + /** + * Set the collectionIds of this {@link VectorSearchFilter} instance. + * + * @param collectionIds The collectionIds of this {@link VectorSearchFilter} + */ + public void setCollectionIds(@Nonnull final List collectionIds) { + this.collectionIds = collectionIds; + } + + /** + * Set the _configuration of this {@link VectorSearchFilter} instance and return the same + * instance. + * + * @param _configuration The _configuration of this {@link VectorSearchFilter} + * @return The same instance of this {@link VectorSearchFilter} class + */ + @Nonnull + public VectorSearchFilter _configuration( + @Nonnull final VectorSearchConfiguration _configuration) { + this._configuration = _configuration; + return this; + } + + /** + * Get _configuration + * + * @return _configuration The _configuration of this {@link VectorSearchFilter} instance. + */ + @Nonnull + public VectorSearchConfiguration getConfiguration() { + return _configuration; + } + + /** + * Set the _configuration of this {@link VectorSearchFilter} instance. + * + * @param _configuration The _configuration of this {@link VectorSearchFilter} + */ + public void setConfiguration(@Nonnull final VectorSearchConfiguration _configuration) { + this._configuration = _configuration; + } + + /** + * Set the collectionMetadata of this {@link VectorSearchFilter} instance and return the same + * instance. + * + * @param collectionMetadata Restrict collections considered during search to those annotated with + * the given metadata. Useful when combined with collections=['*'] + * @return The same instance of this {@link VectorSearchFilter} class + */ + @Nonnull + public VectorSearchFilter collectionMetadata( + @Nullable final List collectionMetadata) { + this.collectionMetadata = collectionMetadata; + return this; + } + + /** + * Add one collectionMetadata instance to this {@link VectorSearchFilter}. + * + * @param collectionMetadataItem The collectionMetadata that should be added + * @return The same instance of type {@link VectorSearchFilter} + */ + @Nonnull + public VectorSearchFilter addCollectionMetadataItem( + @Nonnull final VectorKeyValueListPair collectionMetadataItem) { + if (this.collectionMetadata == null) { + this.collectionMetadata = new ArrayList<>(); + } + this.collectionMetadata.add(collectionMetadataItem); + return this; + } + + /** + * Restrict collections considered during search to those annotated with the given metadata. + * Useful when combined with collections=['*'] + * + * @return collectionMetadata The collectionMetadata of this {@link VectorSearchFilter} instance. + */ + @Nonnull + public List getCollectionMetadata() { + return collectionMetadata; + } + + /** + * Set the collectionMetadata of this {@link VectorSearchFilter} instance. + * + * @param collectionMetadata Restrict collections considered during search to those annotated with + * the given metadata. Useful when combined with collections=['*'] + */ + public void setCollectionMetadata( + @Nullable final List collectionMetadata) { + this.collectionMetadata = collectionMetadata; + } + + /** + * Set the documentMetadata of this {@link VectorSearchFilter} instance and return the same + * instance. + * + * @param documentMetadata Restrict documents considered during search to those annotated with the + * given metadata. + * @return The same instance of this {@link VectorSearchFilter} class + */ + @Nonnull + public VectorSearchFilter documentMetadata( + @Nullable final List documentMetadata) { + this.documentMetadata = documentMetadata; + return this; + } + + /** + * Add one documentMetadata instance to this {@link VectorSearchFilter}. + * + * @param documentMetadataItem The documentMetadata that should be added + * @return The same instance of type {@link VectorSearchFilter} + */ + @Nonnull + public VectorSearchFilter addDocumentMetadataItem( + @Nonnull final VectorSearchDocumentKeyValueListPair documentMetadataItem) { + if (this.documentMetadata == null) { + this.documentMetadata = new ArrayList<>(); + } + this.documentMetadata.add(documentMetadataItem); + return this; + } + + /** + * Restrict documents considered during search to those annotated with the given metadata. + * + * @return documentMetadata The documentMetadata of this {@link VectorSearchFilter} instance. + */ + @Nonnull + public List getDocumentMetadata() { + return documentMetadata; + } + + /** + * Set the documentMetadata of this {@link VectorSearchFilter} instance. + * + * @param documentMetadata Restrict documents considered during search to those annotated with the + * given metadata. + */ + public void setDocumentMetadata( + @Nullable final List documentMetadata) { + this.documentMetadata = documentMetadata; + } + + /** + * Set the chunkMetadata of this {@link VectorSearchFilter} instance and return the same instance. + * + * @param chunkMetadata Restrict chunks considered during search to those with the given metadata. + * @return The same instance of this {@link VectorSearchFilter} class + */ + @Nonnull + public VectorSearchFilter chunkMetadata( + @Nullable final List chunkMetadata) { + this.chunkMetadata = chunkMetadata; + return this; + } + + /** + * Add one chunkMetadata instance to this {@link VectorSearchFilter}. + * + * @param chunkMetadataItem The chunkMetadata that should be added + * @return The same instance of type {@link VectorSearchFilter} + */ + @Nonnull + public VectorSearchFilter addChunkMetadataItem( + @Nonnull final VectorKeyValueListPair chunkMetadataItem) { + if (this.chunkMetadata == null) { + this.chunkMetadata = new ArrayList<>(); + } + this.chunkMetadata.add(chunkMetadataItem); + return this; + } + + /** + * Restrict chunks considered during search to those with the given metadata. + * + * @return chunkMetadata The chunkMetadata of this {@link VectorSearchFilter} instance. + */ + @Nonnull + public List getChunkMetadata() { + return chunkMetadata; + } + + /** + * Set the chunkMetadata of this {@link VectorSearchFilter} instance. + * + * @param chunkMetadata Restrict chunks considered during search to those with the given metadata. + */ + public void setChunkMetadata(@Nullable final List chunkMetadata) { + this.chunkMetadata = chunkMetadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link VectorSearchFilter}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link VectorSearchFilter} 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("VectorSearchFilter has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link VectorSearchFilter} 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 (collectionIds != null) declaredFields.put("collectionIds", collectionIds); + if (_configuration != null) declaredFields.put("_configuration", _configuration); + if (collectionMetadata != null) declaredFields.put("collectionMetadata", collectionMetadata); + if (documentMetadata != null) declaredFields.put("documentMetadata", documentMetadata); + if (chunkMetadata != null) declaredFields.put("chunkMetadata", chunkMetadata); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link VectorSearchFilter} 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 VectorSearchFilter vectorSearchFilter = (VectorSearchFilter) o; + return Objects.equals(this.cloudSdkCustomFields, vectorSearchFilter.cloudSdkCustomFields) + && Objects.equals(this.id, vectorSearchFilter.id) + && Objects.equals(this.collectionIds, vectorSearchFilter.collectionIds) + && Objects.equals(this._configuration, vectorSearchFilter._configuration) + && Objects.equals(this.collectionMetadata, vectorSearchFilter.collectionMetadata) + && Objects.equals(this.documentMetadata, vectorSearchFilter.documentMetadata) + && Objects.equals(this.chunkMetadata, vectorSearchFilter.chunkMetadata); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + collectionIds, + _configuration, + collectionMetadata, + documentMetadata, + chunkMetadata, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class VectorSearchFilter {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" collectionIds: ").append(toIndentedString(collectionIds)).append("\n"); + sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); + sb.append(" collectionMetadata: ").append(toIndentedString(collectionMetadata)).append("\n"); + sb.append(" documentMetadata: ").append(toIndentedString(documentMetadata)).append("\n"); + sb.append(" chunkMetadata: ").append(toIndentedString(chunkMetadata)).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 VectorSearchFilter} + * instance with all required arguments. + */ + public static Builder create() { + return (id) -> + (collectionIds) -> + (_configuration) -> + new VectorSearchFilter() + .id(id) + .collectionIds(collectionIds) + ._configuration(_configuration); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link VectorSearchFilter} instance. + * + * @param id Identifier of this VectorSearchFilter - unique per request. + * @return The VectorSearchFilter builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the collectionIds of this {@link VectorSearchFilter} instance. + * + * @param collectionIds The collectionIds of this {@link VectorSearchFilter} + * @return The VectorSearchFilter builder. + */ + Builder2 collectionIds(@Nonnull final List collectionIds); + + /** + * Set the collectionIds of this {@link VectorSearchFilter} instance. + * + * @param collectionIds The collectionIds of this {@link VectorSearchFilter} + * @return The VectorSearchFilter builder. + */ + default Builder2 collectionIds(@Nonnull final String... collectionIds) { + return collectionIds(Arrays.asList(collectionIds)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the _configuration of this {@link VectorSearchFilter} instance. + * + * @param _configuration The _configuration of this {@link VectorSearchFilter} + * @return The VectorSearchFilter instance. + */ + VectorSearchFilter _configuration(@Nonnull final VectorSearchConfiguration _configuration); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorSearchResults.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorSearchResults.java new file mode 100644 index 000000000..bee3e3f2c --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorSearchResults.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; + +/** VectorSearchResults */ +// CHECKSTYLE:OFF +public class VectorSearchResults +// CHECKSTYLE:ON +{ + @JsonProperty("results") + private List results = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for VectorSearchResults. */ + protected VectorSearchResults() {} + + /** + * Set the results of this {@link VectorSearchResults} instance and return the same instance. + * + * @param results List of returned results. + * @return The same instance of this {@link VectorSearchResults} class + */ + @Nonnull + public VectorSearchResults results(@Nonnull final List results) { + this.results = results; + return this; + } + + /** + * Add one results instance to this {@link VectorSearchResults}. + * + * @param resultsItem The results that should be added + * @return The same instance of type {@link VectorSearchResults} + */ + @Nonnull + public VectorSearchResults 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 VectorSearchResults} instance. + */ + @Nonnull + public List getResults() { + return results; + } + + /** + * Set the results of this {@link VectorSearchResults} 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 VectorSearchResults}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link VectorSearchResults} 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( + "VectorSearchResults has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link VectorSearchResults} 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 VectorSearchResults} 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 VectorSearchResults vectorSearchResults = (VectorSearchResults) o; + return Objects.equals(this.cloudSdkCustomFields, vectorSearchResults.cloudSdkCustomFields) + && Objects.equals(this.results, vectorSearchResults.results); + } + + @Override + public int hashCode() { + return Objects.hash(results, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class VectorSearchResults {\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 VectorSearchResults} + * instance with all required arguments. + */ + public static Builder create() { + return (results) -> new VectorSearchResults().results(results); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the results of this {@link VectorSearchResults} instance. + * + * @param results List of returned results. + * @return The VectorSearchResults instance. + */ + VectorSearchResults results(@Nonnull final List results); + + /** + * Set the results of this {@link VectorSearchResults} instance. + * + * @param results List of returned results. + * @return The VectorSearchResults instance. + */ + default VectorSearchResults 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/VectorSearchSelectOptionEnum.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorSearchSelectOptionEnum.java new file mode 100644 index 000000000..af86e6a27 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/VectorSearchSelectOptionEnum.java @@ -0,0 +1,62 @@ +/* + * 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 VectorSearchSelectOptionEnum */ +public enum VectorSearchSelectOptionEnum { + IGNORE_IF_KEY_ABSENT("ignoreIfKeyAbsent"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + VectorSearchSelectOptionEnum(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 VectorSearchSelectOptionEnum fromValue(@Nonnull final String value) { + for (final VectorSearchSelectOptionEnum b : VectorSearchSelectOptionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/WorkZonePipelineCreateRequest.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/WorkZonePipelineCreateRequest.java new file mode 100644 index 000000000..9921a171d --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/WorkZonePipelineCreateRequest.java @@ -0,0 +1,296 @@ +/* + * 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; + +/** WorkZonePipelineCreateRequest */ +// CHECKSTYLE:OFF +public class WorkZonePipelineCreateRequest implements CreatePipeline +// CHECKSTYLE:ON +{ + /** Gets or Sets type */ + public enum TypeEnum { + /** The WORK_ZONE option of this WorkZonePipelineCreateRequest */ + WORK_ZONE("WorkZone"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this WorkZonePipelineCreateRequest */ + 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 WorkZonePipelineCreateRequest + */ + @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; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for WorkZonePipelineCreateRequest. */ + protected WorkZonePipelineCreateRequest() {} + + /** + * Set the type of this {@link WorkZonePipelineCreateRequest} instance and return the same + * instance. + * + * @param type The type of this {@link WorkZonePipelineCreateRequest} + * @return The same instance of this {@link WorkZonePipelineCreateRequest} class + */ + @Nonnull + public WorkZonePipelineCreateRequest type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link WorkZonePipelineCreateRequest} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link WorkZonePipelineCreateRequest} instance. + * + * @param type The type of this {@link WorkZonePipelineCreateRequest} + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the metadata of this {@link WorkZonePipelineCreateRequest} instance and return the same + * instance. + * + * @param metadata The metadata of this {@link WorkZonePipelineCreateRequest} + * @return The same instance of this {@link WorkZonePipelineCreateRequest} class + */ + @Nonnull + public WorkZonePipelineCreateRequest metadata(@Nonnull final MetaData metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link WorkZonePipelineCreateRequest} instance. + */ + @Nonnull + public MetaData getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link WorkZonePipelineCreateRequest} instance. + * + * @param metadata The metadata of this {@link WorkZonePipelineCreateRequest} + */ + public void setMetadata(@Nonnull final MetaData metadata) { + this.metadata = metadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link WorkZonePipelineCreateRequest}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link WorkZonePipelineCreateRequest} + * 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( + "WorkZonePipelineCreateRequest has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link WorkZonePipelineCreateRequest} 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 (metadata != null) declaredFields.put("metadata", metadata); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link WorkZonePipelineCreateRequest} 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 WorkZonePipelineCreateRequest workZonePipelineCreateRequest = + (WorkZonePipelineCreateRequest) o; + return Objects.equals( + this.cloudSdkCustomFields, workZonePipelineCreateRequest.cloudSdkCustomFields) + && Objects.equals(this.type, workZonePipelineCreateRequest.type) + && Objects.equals(this.metadata, workZonePipelineCreateRequest.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(type, metadata, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class WorkZonePipelineCreateRequest {\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 + * WorkZonePipelineCreateRequest} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (metadata) -> new WorkZonePipelineCreateRequest().type(type).metadata(metadata); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link WorkZonePipelineCreateRequest} instance. + * + * @param type The type of this {@link WorkZonePipelineCreateRequest} + * @return The WorkZonePipelineCreateRequest builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the metadata of this {@link WorkZonePipelineCreateRequest} instance. + * + * @param metadata The metadata of this {@link WorkZonePipelineCreateRequest} + * @return The WorkZonePipelineCreateRequest instance. + */ + WorkZonePipelineCreateRequest metadata(@Nonnull final MetaData metadata); + } +} diff --git a/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/WorkZonePipelineGetResponse.java b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/WorkZonePipelineGetResponse.java new file mode 100644 index 000000000..90a44dc21 --- /dev/null +++ b/core-services/document-grounding/src/main/java/com/sap/ai/sdk/grounding/model/WorkZonePipelineGetResponse.java @@ -0,0 +1,342 @@ +/* + * 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; + +/** WorkZonePipelineGetResponse */ +// CHECKSTYLE:OFF +public class WorkZonePipelineGetResponse implements GetPipeline +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + /** Gets or Sets type */ + public enum TypeEnum { + /** The WORK_ZONE option of this WorkZonePipelineGetResponse */ + WORK_ZONE("WorkZone"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this WorkZonePipelineGetResponse */ + 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 WorkZonePipelineGetResponse + */ + @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; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for WorkZonePipelineGetResponse. */ + protected WorkZonePipelineGetResponse() {} + + /** + * Set the id of this {@link WorkZonePipelineGetResponse} instance and return the same instance. + * + * @param id The id of this {@link WorkZonePipelineGetResponse} + * @return The same instance of this {@link WorkZonePipelineGetResponse} class + */ + @Nonnull + public WorkZonePipelineGetResponse id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link WorkZonePipelineGetResponse} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link WorkZonePipelineGetResponse} instance. + * + * @param id The id of this {@link WorkZonePipelineGetResponse} + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the type of this {@link WorkZonePipelineGetResponse} instance and return the same instance. + * + * @param type The type of this {@link WorkZonePipelineGetResponse} + * @return The same instance of this {@link WorkZonePipelineGetResponse} class + */ + @Nonnull + public WorkZonePipelineGetResponse type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link WorkZonePipelineGetResponse} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link WorkZonePipelineGetResponse} instance. + * + * @param type The type of this {@link WorkZonePipelineGetResponse} + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the metadata of this {@link WorkZonePipelineGetResponse} instance and return the same + * instance. + * + * @param metadata The metadata of this {@link WorkZonePipelineGetResponse} + * @return The same instance of this {@link WorkZonePipelineGetResponse} class + */ + @Nonnull + public WorkZonePipelineGetResponse metadata(@Nonnull final MetaData metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata The metadata of this {@link WorkZonePipelineGetResponse} instance. + */ + @Nonnull + public MetaData getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link WorkZonePipelineGetResponse} instance. + * + * @param metadata The metadata of this {@link WorkZonePipelineGetResponse} + */ + public void setMetadata(@Nonnull final MetaData metadata) { + this.metadata = metadata; + } + + /** + * Get the names of the unrecognizable properties of the {@link WorkZonePipelineGetResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link WorkZonePipelineGetResponse} + * 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( + "WorkZonePipelineGetResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link WorkZonePipelineGetResponse} 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 WorkZonePipelineGetResponse} 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 WorkZonePipelineGetResponse workZonePipelineGetResponse = (WorkZonePipelineGetResponse) o; + return Objects.equals( + this.cloudSdkCustomFields, workZonePipelineGetResponse.cloudSdkCustomFields) + && Objects.equals(this.id, workZonePipelineGetResponse.id) + && Objects.equals(this.type, workZonePipelineGetResponse.type) + && Objects.equals(this.metadata, workZonePipelineGetResponse.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 WorkZonePipelineGetResponse {\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 + * WorkZonePipelineGetResponse} instance with all required arguments. + */ + public static Builder create() { + return (id) -> + (type) -> + (metadata) -> new WorkZonePipelineGetResponse().id(id).type(type).metadata(metadata); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link WorkZonePipelineGetResponse} instance. + * + * @param id The id of this {@link WorkZonePipelineGetResponse} + * @return The WorkZonePipelineGetResponse builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the type of this {@link WorkZonePipelineGetResponse} instance. + * + * @param type The type of this {@link WorkZonePipelineGetResponse} + * @return The WorkZonePipelineGetResponse builder. + */ + Builder2 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the metadata of this {@link WorkZonePipelineGetResponse} instance. + * + * @param metadata The metadata of this {@link WorkZonePipelineGetResponse} + * @return The WorkZonePipelineGetResponse instance. + */ + WorkZonePipelineGetResponse metadata(@Nonnull final MetaData metadata); + } +} 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 0cd714152..50ae76a4f 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": @@ -43,7 +43,7 @@ paths: - Pipelines operationId: pipeline.v1.pipeline_endpoints.create_pipeline summary: Pipeline Creation - description: 'Create a pipeline' + description: Create a pipeline x-sap-cloud-sdk-operation-name: createPipeline parameters: - in: header @@ -82,7 +82,7 @@ paths: - $ref: '#/components/parameters/count' operationId: pipeline.v1.pipeline_endpoints.get_all_pipeline summary: Get Pipelines - description: 'Get all pipelines' + description: Get all pipelines x-sap-cloud-sdk-operation-name: getAllPipelines responses: '200': @@ -99,7 +99,7 @@ paths: - Pipelines operationId: pipeline.v1.pipeline_endpoints.get_pipeline_by_id summary: Get details of a Pipeline - description: 'Get details of a pipeline by pipeline id' + description: Get details of a pipeline by pipeline id x-sap-cloud-sdk-operation-name: getPipelineById parameters: - in: header @@ -128,7 +128,7 @@ paths: - Pipelines operationId: pipeline.v1.pipeline_endpoints.delete_pipeline_by_id summary: Delete pipeline - description: 'Delete a pipeline by pipeline id' + description: Delete a pipeline by pipeline id x-sap-cloud-sdk-operation-name: deletePipelineById parameters: - in: header @@ -154,7 +154,7 @@ paths: - Pipelines operationId: pipeline.v1.pipeline_endpoints.get_pipeline_status summary: Get status of Pipeline - description: 'Get pipeline status by pipeline id' + description: Get pipeline status by pipeline id x-sap-cloud-sdk-operation-name: getPipelineStatus parameters: - in: header @@ -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. @@ -400,6 +400,39 @@ paths: schema: $ref: '#/components/schemas/PipelineDocumentResponse' + "/pipelines/trigger": + post: + tags: + - Pipelines + operationId: pipeline.v1.pipeline_endpoints.trigger_pipeline + summary: Pipeline Trigger + description: Manually trigger a pipeline + x-sap-cloud-sdk-operation-name: manualTriggerPipeline + 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/manualPipelineTrigger' + responses: + '202': + description: Accepted + headers: + Location: + description: Location of the triggered pipeline execution + schema: + type: string + format: uri + '400': + $ref: '#/components/responses/BadRequest' + "/vector/collections": get: parameters: @@ -764,7 +797,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SearchResults' + $ref: '#/components/schemas/VectorSearchResults' '400': $ref: '#/components/responses/BadRequest' '404': @@ -860,7 +893,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 +910,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 @@ -951,19 +984,30 @@ components: flows: clientCredentials: tokenUrl: https://(subdomain_identity_zone).authentication.(host)/oauth/token - scopes: {} + scopes: { } schemas: createPipeline: oneOf: - $ref: "#/components/schemas/MSSharePointPipelineCreateRequest" - $ref: "#/components/schemas/S3PipelineCreateRequest" - $ref: "#/components/schemas/SFTPPipelineCreateRequest" + - $ref: "#/components/schemas/SDMPipelineCreateRequest" + - $ref: "#/components/schemas/WorkZonePipelineCreateRequest" discriminator: propertyName: type mapping: MSSharePoint: "#/components/schemas/MSSharePointPipelineCreateRequest" S3: "#/components/schemas/S3PipelineCreateRequest" SFTP: "#/components/schemas/SFTPPipelineCreateRequest" + SDM: "#/components/schemas/SDMPipelineCreateRequest" + WorkZone: "#/components/schemas/WorkZonePipelineCreateRequest" + + manualPipelineTrigger: + type: object + properties: + pipelineId: + type: string + example: uuid MSSharePointPipelineCreateRequest: type: object @@ -973,7 +1017,7 @@ components: properties: type: type: string - enum: [MSSharePoint] + enum: [ MSSharePoint ] configuration: $ref: "#/components/schemas/MSSharePointConfiguration" metadata: @@ -988,9 +1032,9 @@ components: properties: type: type: string - enum: [S3] + enum: [ S3 ] configuration: - $ref: "#/components/schemas/CommonConfiguration" + $ref: "#/components/schemas/S3Configuration" metadata: $ref: "#/components/schemas/MetaData" additionalProperties: true @@ -1003,9 +1047,35 @@ components: properties: type: type: string - enum: [SFTP] + enum: [ SFTP ] configuration: - $ref: "#/components/schemas/CommonConfiguration" + $ref: "#/components/schemas/SFTPConfiguration" + metadata: + $ref: "#/components/schemas/MetaData" + additionalProperties: true + + SDMPipelineCreateRequest: + type: object + required: + - type + - metadata + properties: + type: + type: string + enum: [ SDM ] + metadata: + $ref: "#/components/schemas/MetaData" + additionalProperties: true + + WorkZonePipelineCreateRequest: + type: object + required: + - type + - metadata + properties: + type: + type: string + enum: [ WorkZone ] metadata: $ref: "#/components/schemas/MetaData" additionalProperties: true @@ -1049,7 +1119,27 @@ components: - /testFolder2 additionalProperties: true - CommonConfiguration: + SFTPConfiguration: + type: object + required: + - destination + properties: + destination: + type: string + example: generic-secret-name + sftp: + type: object + properties: + includePaths: + type: array + items: + type: string + example: + - /testFolder1 + - /testFolder2 + additionalProperties: true + + S3Configuration: type: object required: - destination @@ -1057,6 +1147,16 @@ components: destination: type: string example: generic-secret-name + s3: + type: object + properties: + includePaths: + type: array + items: + type: string + example: + - /testFolder1 + - /testFolder2 additionalProperties: true MetaData: @@ -1086,12 +1186,16 @@ components: - $ref: "#/components/schemas/MSSharePointPipelineGetResponse" - $ref: "#/components/schemas/S3PipelineGetResponse" - $ref: "#/components/schemas/SFTPPipelineGetResponse" + - $ref: "#/components/schemas/SDMPipelineGetResponse" + - $ref: "#/components/schemas/WorkZonePipelineGetResponse" discriminator: propertyName: type mapping: MSSharePoint: "#/components/schemas/MSSharePointPipelineGetResponse" S3: "#/components/schemas/S3PipelineGetResponse" SFTP: "#/components/schemas/SFTPPipelineGetResponse" + SDM: "#/components/schemas/SDMPipelineGetResponse" + WorkZone: "#/components/schemas/WorkZonePipelineGetResponse" MSSharePointPipelineGetResponse: allOf: @@ -1102,7 +1206,7 @@ components: properties: type: type: string - enum: [MSSharePoint] + enum: [ MSSharePoint ] configuration: $ref: "#/components/schemas/MSSharePointConfigurationGetResponse" @@ -1115,9 +1219,9 @@ components: properties: type: type: string - enum: [S3] + enum: [ S3 ] configuration: - $ref: "#/components/schemas/CommonConfiguration" + $ref: "#/components/schemas/S3Configuration" SFTPPipelineGetResponse: allOf: @@ -1128,9 +1232,35 @@ components: properties: type: type: string - enum: [SFTP] + enum: [ SFTP ] configuration: - $ref: "#/components/schemas/CommonConfiguration" + $ref: "#/components/schemas/SFTPConfiguration" + + SDMPipelineGetResponse: + allOf: + - $ref: "#/components/schemas/BasePipelineResponse" + - type: object + required: + - metadata + properties: + type: + type: string + enum: [ SDM ] + metadata: + $ref: "#/components/schemas/MetaData" + + WorkZonePipelineGetResponse: + allOf: + - $ref: "#/components/schemas/BasePipelineResponse" + - type: object + required: + - metadata + properties: + type: + type: string + enum: [ WorkZone ] + metadata: + $ref: "#/components/schemas/MetaData" BasePipelineResponse: type: object @@ -1185,8 +1315,18 @@ components: 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' + createdAt: + 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' + nullable: true + lastCompletedAt: + 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' + nullable: true status: - $ref: '#/components/schemas/PipelineExecutionStatus' + $ref: '#/components/schemas/PipelineExecutionStatus' pipelineId: type: object @@ -1214,7 +1354,17 @@ components: example: uuid status: $ref: '#/components/schemas/PipelineExecutionStatus' - + createdAt: + type: string + pattern: '^$|^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$' + example: '2024-02-15T12:45:00Z' + nullable: true + modifiedAt: + type: string + pattern: '^$|^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$' + example: '2024-02-15T12:45:00Z' + nullable: true + getPipelineExecutions: type: object properties: @@ -1250,6 +1400,7 @@ components: - DEINDEXED - FAILED - FAILED_TO_BE_RETRIED + - TO_BE_SCHEDULED example: 'INDEXED' DocumentsStatusResponse: @@ -1268,6 +1419,29 @@ components: example: uuid status: $ref: '#/components/schemas/DocumentStatus' + viewLocation: + type: string + example: 'location' + nullable: true + downloadLocation: + type: string + example: 'location' + nullable: true + absoluteUrl: + type: string + nullable: true + title: + type: string + nullable: true + metadataId: + type: string + nullable: true + createdTimestamp: + type: string + example: '2024-02-15T12:45:00Z' + lastUpdatedTimestamp: + type: string + example: '2024-02-15T12:45:00Z' PipelineDocumentResponse: type: object @@ -1275,6 +1449,8 @@ components: id: type: string example: uuid + status: + $ref: '#/components/schemas/DocumentStatus' viewLocation: type: string example: 'location' @@ -1283,11 +1459,21 @@ components: type: string example: 'location' nullable: true + absoluteUrl: + type: string + nullable: true + title: + type: string + nullable: true + metadataId: + type: string + nullable: true + createdTimestamp: + type: string + example: '2024-02-15T12:45:00Z' lastUpdatedTimestamp: type: string example: '2024-02-15T12:45:00Z' - status: - $ref: '#/components/schemas/DocumentStatus' Chunk: properties: @@ -1302,12 +1488,50 @@ components: items: $ref: "#/components/schemas/KeyValueListPair" title: Metadata - default: [] + default: [ ] type: object required: - - id - - content + - id + - content title: Chunk + VectorChunk: + properties: + id: + type: string + title: Id + content: + type: string + title: Content + metadata: + type: array + items: + $ref: "#/components/schemas/VectorKeyValueListPair" + title: Metadata + default: [ ] + type: object + required: + - id + - content + title: VectorChunk + RetrievalChunk: + properties: + id: + type: string + title: Id + content: + type: string + title: Content + metadata: + type: array + items: + $ref: "#/components/schemas/RetrievalKeyValueListPair" + title: Metadata + default: [ ] + type: object + required: + - id + - content + title: RetrievalChunk DocumentKeyValueListPair: properties: key: @@ -1328,14 +1552,71 @@ components: default: ANY anyOf: - enum: - - ANY - - ALL - - {} + - ANY + - ALL + - { } + type: object + required: + - key + - value + title: DocumentKeyValueListPair + VectorDocumentKeyValueListPair: + 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: VectorDocumentKeyValueListPair + RetrievalDocumentKeyValueListPair: + 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 + - key + - value title: DocumentKeyValueListPair + HTTPValidationError: properties: detail: @@ -1359,9 +1640,43 @@ components: title: Value type: object required: - - key - - value + - key + - value title: KeyValueListPair + VectorKeyValueListPair: + properties: + key: + type: string + maxLength: 1024 + title: Key + value: + type: array + items: + type: string + maxLength: 1024 + title: Value + type: object + required: + - key + - value + title: VectorKeyValueListPair + RetrievalKeyValueListPair: + properties: + key: + type: string + maxLength: 1024 + title: Key + value: + type: array + items: + type: string + maxLength: 1024 + title: Value + type: object + required: + - key + - value + title: RetrievalKeyValueListPair Document-Output: properties: id: @@ -1370,15 +1685,15 @@ components: title: Id metadata: items: - $ref: '#/components/schemas/DocumentKeyValueListPair' + $ref: '#/components/schemas/VectorDocumentKeyValueListPair' type: array title: Metadata - default: [] + default: [ ] chunks: items: - $ref: '#/components/schemas/Chunk' + $ref: '#/components/schemas/VectorChunk' type: array - title: Chunks + title: VectorChunks type: object required: - id @@ -1395,10 +1710,10 @@ components: title: Title metadata: items: - $ref: '#/components/schemas/KeyValueListPair' + $ref: '#/components/schemas/VectorKeyValueListPair' type: array title: Metadata - default: [] + default: [ ] documents: items: $ref: '#/components/schemas/Document-Output' @@ -1425,6 +1740,21 @@ components: - filterId - results title: PerFilterSearchResult + VectorPerFilterSearchResult: + properties: + filterId: + type: string + title: Filterid + results: + items: + $ref: '#/components/schemas/DocumentsChunk' + type: array + title: Results + type: object + required: + - filterId + - results + title: VectorPerFilterSearchResult SearchConfiguration: properties: maxChunkCount: @@ -1445,6 +1775,42 @@ components: 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 + VectorSearchConfiguration: + 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: VectorSearchConfiguration + 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: RetrievalSearchConfiguration SearchDocumentKeyValueListPair: properties: key: @@ -1465,22 +1831,81 @@ components: description: Select mode for search filters type: object required: - - key - - value + - key + - value title: SearchDocumentKeyValueListPair + VectorSearchDocumentKeyValueListPair: + properties: + key: + type: string + maxLength: 1024 + title: Key + value: + type: array + items: + type: string + maxLength: 1024 + title: Value + selectMode: + type: array + items: + $ref: "#/components/schemas/VectorSearchSelectOptionEnum" + title: Selectmode + description: Select mode for search filters + type: object + required: + - key + - value + title: VectorSearchDocumentKeyValueListPair + RetrievalSearchDocumentKeyValueListPair: + properties: + key: + type: string + maxLength: 1024 + title: Key + value: + type: array + items: + type: string + maxLength: 1024 + title: Value + selectMode: + type: array + items: + $ref: "#/components/schemas/RetrievalSearchSelectOptionEnum" + title: Selectmode + description: Select mode for search filters + type: object + required: + - key + - value + title: RetrievalSearchDocumentKeyValueListPair SearchResults: properties: results: 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 + VectorSearchResults: + properties: + results: + type: array + items: + anyOf: + - $ref: "#/components/schemas/VectorPerFilterSearchResult" + title: Results + description: List of returned results. + type: object + required: + - results + title: VectorSearchResults CollectionsListResponse: properties: @@ -1506,13 +1931,13 @@ components: $ref: '#/components/schemas/EmbeddingConfig' metadata: items: - $ref: '#/components/schemas/KeyValueListPair' + $ref: '#/components/schemas/VectorKeyValueListPair' type: array title: Metadata description: >- Metadata attached to collection. Useful to restrict search to a subset of collections. - default: [] + default: [ ] type: object required: - embeddingConfig @@ -1566,7 +1991,7 @@ components: title: Chunks metadata: items: - $ref: '#/components/schemas/DocumentKeyValueListPair' + $ref: '#/components/schemas/VectorDocumentKeyValueListPair' type: array title: Metadata type: object @@ -1598,7 +2023,7 @@ components: title: Chunks metadata: items: - $ref: '#/components/schemas/DocumentKeyValueListPair' + $ref: '#/components/schemas/VectorDocumentKeyValueListPair' type: array title: Metadata id: @@ -1631,7 +2056,7 @@ components: properties: metadata: items: - $ref: '#/components/schemas/DocumentKeyValueListPair' + $ref: '#/components/schemas/VectorDocumentKeyValueListPair' type: array title: Metadata id: @@ -1680,7 +2105,7 @@ components: title: Content metadata: items: - $ref: '#/components/schemas/KeyValueListPair' + $ref: '#/components/schemas/VectorKeyValueListPair' type: array title: Metadata type: object @@ -1697,7 +2122,7 @@ components: title: Chunks metadata: items: - $ref: '#/components/schemas/DocumentKeyValueListPair' + $ref: '#/components/schemas/VectorDocumentKeyValueListPair' type: array title: Metadata id: @@ -1718,10 +2143,25 @@ components: type: string anyOf: - enum: - - ignoreIfKeyAbsent - - {} + - ignoreIfKeyAbsent + - { } default: ignoreIfKeyAbsent title: SearchSelectOptionEnum + VectorSearchSelectOptionEnum: + type: string + anyOf: + - enum: + - ignoreIfKeyAbsent + - { } + default: ignoreIfKeyAbsent + title: VectorSearchSelectOptionEnum + RetrievalSearchSelectOptionEnum: + type: string + anyOf: + - enum: + - ignoreIfKeyAbsent + - { } + title: RetrievalSearchSelectOptionEnum SearchFilter: properties: id: @@ -1744,7 +2184,7 @@ components: description: >- Restrict collections considered during search to those annotated with the given metadata. Useful when combined with collections=['*'] - default: [] + default: [ ] documentMetadata: items: $ref: '#/components/schemas/SearchDocumentKeyValueListPair' @@ -1754,7 +2194,7 @@ components: description: >- Restrict documents considered during search to those annotated with the given metadata. - default: [] + default: [ ] chunkMetadata: items: $ref: '#/components/schemas/KeyValueListPair' @@ -1764,13 +2204,62 @@ components: description: >- Restrict chunks considered during search to those with the given metadata. - default: [] + default: [ ] type: object required: - id - collectionIds - configuration title: SearchFilter + VectorSearchFilter: + properties: + id: + type: string + title: Id + description: Identifier of this VectorSearchFilter - unique per request. + collectionIds: + items: + type: string + type: array + title: Collectionids + configuration: + $ref: '#/components/schemas/VectorSearchConfiguration' + collectionMetadata: + items: + $ref: '#/components/schemas/VectorKeyValueListPair' + type: array + maxItems: 2000 + title: Collectionmetadata + description: >- + Restrict collections considered during search to those annotated + with the given metadata. Useful when combined with collections=['*'] + default: [ ] + documentMetadata: + items: + $ref: '#/components/schemas/VectorSearchDocumentKeyValueListPair' + type: array + maxItems: 2000 + title: Documentmetadata + description: >- + Restrict documents considered during search to those annotated with + the given metadata. + default: [ ] + chunkMetadata: + items: + $ref: '#/components/schemas/VectorKeyValueListPair' + type: array + maxItems: 2000 + title: Chunkmetadata + description: >- + Restrict chunks considered during search to those with the given + metadata. + default: [ ] + type: object + required: + - id + - collectionIds + - configuration + title: VectorSearchFilter TextSearchRequest: properties: query: @@ -1781,7 +2270,7 @@ components: description: Query string filters: items: - $ref: '#/components/schemas/SearchFilter' + $ref: '#/components/schemas/VectorSearchFilter' type: array title: Filters type: object @@ -1808,13 +2297,13 @@ components: $ref: '#/components/schemas/EmbeddingConfig' metadata: items: - $ref: '#/components/schemas/KeyValueListPair' + $ref: '#/components/schemas/VectorKeyValueListPair' type: array title: Metadata description: >- Metadata attached to collection. Useful to restrict search to a subset of collections. - default: [] + default: [ ] id: type: string format: uuid @@ -1837,7 +2326,7 @@ components: title: Datarepositories type: object required: - - resources + - resources title: DataRepositories DataRepository: properties: @@ -1852,17 +2341,17 @@ components: metadata: type: array items: - $ref: "#/components/schemas/KeyValueListPair" + $ref: "#/components/schemas/RetrievalKeyValueListPair" title: Metadata description: Metadata attached to DataRepository. Useful to later limit search to a subset of DataRepositories. - default: [] + default: [ ] type: $ref: "#/components/schemas/DataRepositoryType" type: object required: - - id - - title - - type + - id + - title + - type title: DataRepository description: DataRepository schema expected by Retrieval. DataRepositorySearchResult: @@ -1871,15 +2360,15 @@ 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: properties: @@ -1894,7 +2383,7 @@ components: metadata: type: array items: - $ref: "#/components/schemas/KeyValueListPair" + $ref: "#/components/schemas/RetrievalKeyValueListPair" title: Metadata description: Metadata attached to DataRepository. Useful to later limit search to a subset of DataRepositories. documents: @@ -1904,9 +2393,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: @@ -1917,18 +2406,18 @@ components: metadata: type: array items: - $ref: "#/components/schemas/DocumentKeyValueListPair" + $ref: "#/components/schemas/RetrievalDocumentKeyValueListPair" title: Metadata - default: [] + default: [ ] chunks: type: array items: - $ref: "#/components/schemas/Chunk" - title: Chunks + $ref: "#/components/schemas/RetrievalChunk" + title: RetrievalChunks type: object required: - - id - - chunks + - id + - chunks title: Document DataRepositoryPerFilterSearchResult: properties: @@ -1941,10 +2430,10 @@ components: $ref: "#/components/schemas/DataRepositorySearchResult" title: Results description: List of returned results. - default: [] + default: [ ] type: object required: - - filterId + - filterId title: PerFilterSearchResult PerFilterSearchResultError: properties: @@ -1953,8 +2442,17 @@ components: title: Message type: object required: - - message + - message title: PerFilterSearchResultError + RetrievalPerFilterSearchResultError: + properties: + message: + type: string + title: Message + type: object + required: + - message + title: RetrievalPerFilterSearchResultError PerFilterSearchResultWithError: properties: filterId: @@ -1967,19 +2465,19 @@ components: message: Unknown Error Occurred type: object required: - - filterId + - filterId title: PerFilterSearchResultWithError RetrievalSearchFilter: properties: id: type: string title: Id - description: Identifier of this SearchFilter - unique per request. + description: Identifier of this RetrievalSearchFilter - unique per request. searchConfiguration: type: object nullable: true - $ref: "#/components/schemas/SearchConfiguration" - default: {} + $ref: "#/components/schemas/RetrievalSearchConfiguration" + default: { } minProperties: 0 maxProperties: 2 dataRepositories: @@ -1989,7 +2487,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" @@ -1997,29 +2495,29 @@ components: dataRepositoryMetadata: type: array items: - $ref: "#/components/schemas/KeyValueListPair" + $ref: "#/components/schemas/RetrievalKeyValueListPair" title: Datarepositorymetadata description: Restrict DataRepositories considered during search to those annotated with the given metadata. Useful when combined with dataRepositories=['*'] - default: [] + default: [ ] documentMetadata: type: array items: - $ref: "#/components/schemas/SearchDocumentKeyValueListPair" + $ref: "#/components/schemas/RetrievalSearchDocumentKeyValueListPair" title: Documentmetadata description: Restrict documents considered during search to those annotated with the given metadata. - default: [] + default: [ ] chunkMetadata: type: array items: - $ref: "#/components/schemas/KeyValueListPair" + $ref: "#/components/schemas/RetrievalKeyValueListPair" title: Chunkmetadata description: Restrict chunks considered during search to those with the given metadata. - default: [] + default: [ ] type: object required: - - id - - dataRepositoryType - title: SearchFilter + - id + - dataRepositoryType + title: RetrievalSearchFilter description: Limit scope of search to certain DataRepositories, Documents or Chunks. RetrievalSearchInput: properties: @@ -2035,17 +2533,17 @@ components: title: Filters type: object required: - - query - - filters - title: SearchInput + - query + - filters + title: RetrievalSearchInput RetrievalDataRepositorySearchResult: properties: dataRepository: $ref: "#/components/schemas/DataRepositoryWithDocuments" type: object required: - - dataRepository - title: DataRepositorySearchResult + - dataRepository + title: RetrievalDataRepositorySearchResult RetrievalPerFilterSearchResult: properties: filterId: @@ -2057,47 +2555,52 @@ components: $ref: "#/components/schemas/RetrievalDataRepositorySearchResult" title: Results description: List of returned results. - default: [] + default: [ ] type: object required: - - filterId - title: PerFilterSearchResult + - filterId + title: RetrievalPerFilterSearchResult RetrievalPerFilterSearchResultWithError: properties: - message: + filterId: type: string - title: Message + title: Filterid + error: + $ref: "#/components/schemas/RetrievalPerFilterSearchResultError" + description: Error message if any. + default: + message: Unknown Error Occurred type: object required: - - message - title: PerFilterSearchResultError + - filterId + title: RetrievalPerFilterSearchResultWithError RetrievalSearchResults: properties: results: 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 - title: SearchResults + - results + title: RetrievalSearchResults DataRepositorySearchResults: properties: results: 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 +2617,9 @@ components: title: Error Type type: object required: - - loc - - msg - - type + - loc + - msg + - type title: ValidationError ### ### ######################## ### ### 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 de8a58431..acda11eaf 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 @@ -11,18 +11,19 @@ import com.sap.ai.sdk.grounding.model.CollectionsListResponse; import com.sap.ai.sdk.grounding.model.DataRepositories; import com.sap.ai.sdk.grounding.model.DataRepositoryType; -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.RetrievalKeyValueListPair; +import com.sap.ai.sdk.grounding.model.VectorDocumentKeyValueListPair; +import com.sap.ai.sdk.grounding.model.VectorKeyValueListPair; import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination; import java.util.UUID; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; -public class GroundingClientTest { +class GroundingClientTest { @RegisterExtension private static final WireMockExtension WM = @@ -56,18 +57,19 @@ void testVector() { assertThat(c.getTitle()).isEqualTo("test-collection"); assertThat(c.getEmbeddingConfig()).isNotNull(); assertThat(c.getEmbeddingConfig().getModelName()).isEqualTo("text-embedding-ada-999"); - final var meta = KeyValueListPair.create().key("purpose").value("grounding test"); + final var meta = + VectorKeyValueListPair.create().key("purpose").value("grounding test"); assertThat(c.getMetadata()).isNotNull().containsExactly(meta); }); final UUID collectionId = collections.getResources().get(0).getId(); final Documents documents = api.getAllDocuments("reosurceGroup", collectionId); assertThat(documents).isNotNull(); - final DocumentKeyValueListPair documentMeta = - DocumentKeyValueListPair.create() + final var documentMeta = + VectorDocumentKeyValueListPair.create() .key("url") .value("http://hello.com", "123") - .matchMode(DocumentKeyValueListPair.MatchModeEnum.ANY); + .matchMode(VectorDocumentKeyValueListPair.MatchModeEnum.ANY); assertThat(documents.getResources()) .isNotNull() .hasSize(1) @@ -90,17 +92,21 @@ void testVector() { d1 -> { assertThat(d1).isNotNull(); assertThat(d1.getContent()).isNotEmpty(); - final var m1 = KeyValueListPair.create().key("index").value("1"); + final var m1 = VectorKeyValueListPair.create().key("index").value("1"); final var m2 = - KeyValueListPair.create().key("sap.document-grounding/language").value("en"); + VectorKeyValueListPair.create() + .key("sap.document-grounding/language") + .value("en"); assertThat(d1.getMetadata()).isNotNull().containsExactly(m1, m2); }, d2 -> { assertThat(d2).isNotNull(); assertThat(d2.getContent()).isNotEmpty(); - final var m1 = KeyValueListPair.create().key("index").value("2"); + final var m1 = VectorKeyValueListPair.create().key("index").value("2"); final var m2 = - KeyValueListPair.create().key("sap.document-grounding/language").value("en"); + VectorKeyValueListPair.create() + .key("sap.document-grounding/language") + .value("en"); assertThat(d2.getMetadata()).isNotNull().containsExactly(m1, m2); }); } @@ -119,7 +125,8 @@ void testRetrieval() { assertThat(r.getId()).isNotNull(); assertThat(r.getTitle()).isEqualTo("test-collection"); assertThat(r.getType()).isEqualTo(DataRepositoryType.VECTOR); - final var meta = KeyValueListPair.create().key("purpose").value("grounding test"); + final var meta = + RetrievalKeyValueListPair.create().key("purpose").value("grounding test"); assertThat(r.getMetadata()).isNotNull().containsExactly(meta); }, r2 -> { diff --git a/docs/release_notes.md b/docs/release_notes.md index 118cbc75e..27b5bb85d 100644 --- a/docs/release_notes.md +++ b/docs/release_notes.md @@ -16,6 +16,17 @@ - `LLMModuleConfig` is replaced by `LLMModelDetails` in `withLLmConfig` method of `OrchestrationModuleConfig` class. - `PromptTemplatingModuleConfigPrompt` replaces `TemplatingModuleConfig` in the `withTemplateConfig` method of `OrchestrationModuleConfig` class. - The generated model classes will reflect payload updates including restructuring of the module configurations and renaming of several fields. +- [Document Grounding] Breaking: The `message` field in `RetrievalPerFilterSearchResultWithError` is replaced by `error` and `filterId` with more specific error details. +- [Document Grounding] Extensive generated model class renaming for better specificity due to API spec changes. + - `SearchResults` → `VectorSearchResults` + - `KeyValueListPair` split into context-specific classes: + - `VectorKeyValueListPair` for vector operations + - `RetrievalKeyValueListPair` for retrieval operations + - `VectorDocumentKeyValueListPair` for vector document operations + - `RetrievalDocumentKeyValueListPair` for retrieval document operations + - `Chunk` → `VectorChunk` and `RetrievalChunk` for different contexts + - `SearchFilter` → `VectorSearchFilter` and `RetrievalSearchFilter` + - `SearchConfiguration` → `VectorSearchConfiguration` and `RetrievalSearchConfiguration` ### ✨ New Functionality @@ -26,11 +37,15 @@ - `getFilterDetails()`: Returns a map of all filter details. - `getAzureContentSafetyInput()` and `getAzureContentSafetyInput()` : Returns Azure Content Safety filter scores - `getLlamaGuard38b()`: Returns LlamaGuard filter scores +- [Document Grounding] Extend pipline operations, notably: + - Added new pipeline creation requests for SDM and WorkZone with `SDMPipelineCreateRequest` and `WorkZonePipelineCreateRequest`. + - S3 and SFTP pipeline configurations extended with `S3Configuration` and `SFTPConfiguration` for including data sources. + - Support `/pipelines/trigger` endpoint to trigger pipelines on-demand via `PipelinesApi#manualTriggerPipeline()`. ### 📈 Improvements - Update AI Core client to 2.40.1 - +- [Document Grounding] Enhanced pipeline status reporting with additional metadata such as `createdAt`, `modifiedAt`, `lastCompletedAt`. ### 🐛 Fixed Issues 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 ffda583f5..93e5cfd62 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 @@ -9,25 +9,25 @@ import com.sap.ai.sdk.grounding.client.RetrievalApi; import com.sap.ai.sdk.grounding.client.VectorApi; import com.sap.ai.sdk.grounding.model.BaseDocument; -import com.sap.ai.sdk.grounding.model.Chunk; import com.sap.ai.sdk.grounding.model.Collection; import com.sap.ai.sdk.grounding.model.CollectionRequest; import com.sap.ai.sdk.grounding.model.CollectionsListResponse; import com.sap.ai.sdk.grounding.model.DataRepository; import com.sap.ai.sdk.grounding.model.DataRepositoryType; import com.sap.ai.sdk.grounding.model.DocumentCreateRequest; -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.RetrievalChunk; +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.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.ai.sdk.grounding.model.VectorDocumentKeyValueListPair; +import com.sap.ai.sdk.grounding.model.VectorKeyValueListPair; import com.sap.cloud.sdk.services.openapi.core.OpenApiResponse; import java.time.format.TextStyle; import java.util.ArrayList; @@ -105,7 +105,7 @@ Object searchInDocuments( .id("question") .dataRepositoryType(DataRepositoryType.VECTOR) .dataRepositories(List.of("*")) - .searchConfiguration(SearchConfiguration.create().maxChunkCount(10)); + .searchConfiguration(RetrievalSearchConfiguration.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); @@ -117,7 +117,7 @@ Object searchInDocuments( .flatMap(resultsInner1 -> resultsInner1.getResults().stream()) .flatMap(result -> result.getDataRepository().getDocuments().stream()) .flatMap(dataRepositorySearchResult -> dataRepositorySearchResult.getChunks().stream()) - .map(Chunk::getContent) + .map(RetrievalChunk::getContent) .toList(); return "Found the following response(s): " + messages; } @@ -170,9 +170,9 @@ Object createDocument( final var dayOfWeek = now().getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.ENGLISH); final var documentContent = "Last upload on " + dayOfWeek; - final var chunkMeta = KeyValueListPair.create().key("context").value("day-of-week"); + final var chunkMeta = VectorKeyValueListPair.create().key("context").value("day-of-week"); final var chunk = TextOnlyBaseChunk.create().content(documentContent).metadata(chunkMeta); - final var docMeta = DocumentKeyValueListPair.create().key("purpose").value("testing"); + final var docMeta = VectorDocumentKeyValueListPair.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); @@ -190,10 +190,10 @@ Object deleteCollection( @Nonnull @PathVariable("id") final UUID collectionId, @Nullable @RequestParam(value = "format", required = false) final String format) { final var dayOfWeek = now().getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.ENGLISH); - final var chunkMeta = KeyValueListPair.create().key("context").value("day-of-week"); + final var chunkMeta = VectorKeyValueListPair.create().key("context").value("day-of-week"); final var chunk = TextOnlyBaseChunk.create().content("Today is " + dayOfWeek).metadata(chunkMeta); - final var docMeta = DocumentKeyValueListPair.create().key("purpose").value("testing"); + final var docMeta = VectorDocumentKeyValueListPair.create().key("purpose").value("testing"); final var doc = BaseDocument.create().chunks(chunk).metadata(docMeta); final var request = DocumentCreateRequest.create().documents(doc);