Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update with new generator version #235

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are the mix ins LLMModuleResult and ModuleResultsOutputUnmaskingInner still there?
It means we are forcing interfaces to deserialize as synchronous classes, it can never be streaming classes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side effect from not having run the generator on the latest spec yet


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 {}
Loading