Skip to content

Commit

Permalink
Update with new generator version
Browse files Browse the repository at this point in the history
  • Loading branch information
MatKuhr committed Dec 9, 2024
1 parent 8cc077b commit 3289a4d
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<HttpDestination> destinationSupplier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

0 comments on commit 3289a4d

Please sign in to comment.