diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/JacksonMixins.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/JacksonMixins.java index eeee1bbf..7e1fec77 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/JacksonMixins.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/JacksonMixins.java @@ -18,8 +18,4 @@ interface LLMModuleResultMixIn {} @JsonTypeInfo(use = JsonTypeInfo.Id.NONE) @JsonDeserialize(as = LLMChoice.class) interface ModuleResultsOutputUnmaskingInnerMixIn {} - - /** Mixin to suppress @JsonTypeInfo for oneOf interfaces. */ - @JsonTypeInfo(use = JsonTypeInfo.Id.NONE) - interface NoTypeInfoMixin {} } diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationClient.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationClient.java index bec0192b..3a1ab932 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationClient.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationClient.java @@ -11,13 +11,10 @@ import com.sap.ai.sdk.core.DeploymentResolutionException; import com.sap.ai.sdk.orchestration.model.CompletionPostRequest; import com.sap.ai.sdk.orchestration.model.CompletionPostResponse; -import com.sap.ai.sdk.orchestration.model.FilterConfig; import com.sap.ai.sdk.orchestration.model.LLMModuleResult; -import com.sap.ai.sdk.orchestration.model.MaskingProviderConfig; import com.sap.ai.sdk.orchestration.model.ModuleConfigs; import com.sap.ai.sdk.orchestration.model.ModuleResultsOutputUnmaskingInner; import com.sap.ai.sdk.orchestration.model.OrchestrationConfig; -import com.sap.ai.sdk.orchestration.model.TemplatingModuleConfig; import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination; import com.sap.cloud.sdk.cloudplatform.connectivity.exception.DestinationAccessException; @@ -47,9 +44,6 @@ public class OrchestrationClient { JACKSON.addMixIn( ModuleResultsOutputUnmaskingInner.class, JacksonMixins.ModuleResultsOutputUnmaskingInnerMixIn.class); - JACKSON.addMixIn(FilterConfig.class, JacksonMixins.NoTypeInfoMixin.class); - JACKSON.addMixIn(MaskingProviderConfig.class, JacksonMixins.NoTypeInfoMixin.class); - JACKSON.addMixIn(TemplatingModuleConfig.class, JacksonMixins.NoTypeInfoMixin.class); } @Nonnull private final Supplier destinationSupplier; diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DataRepositoryType.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DataRepositoryType.java index 5408b2fc..902b863f 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DataRepositoryType.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DataRepositoryType.java @@ -20,8 +20,6 @@ public enum DataRepositoryType { VECTOR("vector"), - HELP_SAP_COM("help.sap.com"), - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); private final String value; diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilterConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilterConfig.java index 22b7d4ef..16343759 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilterConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilterConfig.java @@ -12,12 +12,12 @@ package com.sap.ai.sdk.orchestration.model; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; /** FilterConfig */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "", - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) +@JsonSubTypes({ + @JsonSubTypes.Type(value = AzureContentSafetyFilterConfig.class), +}) public interface FilterConfig {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfigConfigFiltersInner.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfigConfigFiltersInner.java index 37a9d871..603c3b10 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfigConfigFiltersInner.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfigConfigFiltersInner.java @@ -12,12 +12,12 @@ package com.sap.ai.sdk.orchestration.model; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; /** GroundingModuleConfigConfigFiltersInner */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "", - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) +@JsonSubTypes({ + @JsonSubTypes.Type(value = DocumentGroundingFilter.class), +}) public interface GroundingModuleConfigConfigFiltersInner {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResult.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResult.java index 2d0e9b57..786737d3 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResult.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResult.java @@ -12,12 +12,13 @@ package com.sap.ai.sdk.orchestration.model; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; /** Output of LLM module. Follows the OpenAI spec. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "", - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) +@JsonSubTypes({ + @JsonSubTypes.Type(value = LLMModuleResultStreaming.class), + @JsonSubTypes.Type(value = LLMModuleResultSynchronous.class), +}) public interface LLMModuleResult {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MaskingProviderConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MaskingProviderConfig.java index 466b9de7..861e997b 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MaskingProviderConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MaskingProviderConfig.java @@ -12,12 +12,12 @@ package com.sap.ai.sdk.orchestration.model; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; /** MaskingProviderConfig */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "", - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) +@JsonSubTypes({ + @JsonSubTypes.Type(value = DPIConfig.class), +}) public interface MaskingProviderConfig {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleResultsOutputUnmaskingInner.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleResultsOutputUnmaskingInner.java index a7660380..8117bb32 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleResultsOutputUnmaskingInner.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleResultsOutputUnmaskingInner.java @@ -12,12 +12,13 @@ package com.sap.ai.sdk.orchestration.model; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; /** ModuleResultsOutputUnmaskingInner */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "", - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) +@JsonSubTypes({ + @JsonSubTypes.Type(value = LLMChoice.class), + @JsonSubTypes.Type(value = LLMChoiceStreaming.class), +}) public interface ModuleResultsOutputUnmaskingInner {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefTemplateRef.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefTemplateRef.java index 06ecd7c4..ac7024f6 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefTemplateRef.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefTemplateRef.java @@ -12,12 +12,13 @@ package com.sap.ai.sdk.orchestration.model; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; /** Reference to a template in the prompt registry by ID or by scenario, name and version */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "", - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) +@JsonSubTypes({ + @JsonSubTypes.Type(value = TemplateRefByID.class), + @JsonSubTypes.Type(value = TemplateRefByScenarioNameVersion.class), +}) public interface TemplateRefTemplateRef {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplatingModuleConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplatingModuleConfig.java index 701b97b4..d2577ac7 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplatingModuleConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplatingModuleConfig.java @@ -12,12 +12,13 @@ package com.sap.ai.sdk.orchestration.model; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; /** TemplatingModuleConfig */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "", - visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Template.class), + @JsonSubTypes.Type(value = TemplateRef.class), +}) public interface TemplatingModuleConfig {}