Skip to content
Closed
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 @@ -34,9 +34,6 @@ public class CompletionRequestConfigurationReferenceById implements CompletionPo
@JsonProperty("config_ref")
private CompletionRequestConfigurationReferenceByIdConfigRef configRef;

@JsonProperty("config")
private OrchestrationConfig config;

@JsonProperty("placeholder_values")
private Map<String, String> placeholderValues = new HashMap<>();

Expand Down Expand Up @@ -84,39 +81,6 @@ public void setConfigRef(
this.configRef = configRef;
}

/**
* Set the config of this {@link CompletionRequestConfigurationReferenceById} instance and return
* the same instance.
*
* @param config The config of this {@link CompletionRequestConfigurationReferenceById}
* @return The same instance of this {@link CompletionRequestConfigurationReferenceById} class
*/
@Nonnull
public CompletionRequestConfigurationReferenceById config(
@Nullable final OrchestrationConfig config) {
this.config = config;
return this;
}

/**
* Get config
*
* @return config The config of this {@link CompletionRequestConfigurationReferenceById} instance.
*/
@Nonnull
public OrchestrationConfig getConfig() {
return config;
}

/**
* Set the config of this {@link CompletionRequestConfigurationReferenceById} instance.
*
* @param config The config of this {@link CompletionRequestConfigurationReferenceById}
*/
public void setConfig(@Nullable final OrchestrationConfig config) {
this.config = config;
}

/**
* Set the placeholderValues of this {@link CompletionRequestConfigurationReferenceById} instance
* and return the same instance.
Expand Down Expand Up @@ -266,7 +230,6 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc
public Map<String, Object> toMap() {
final Map<String, Object> declaredFields = new LinkedHashMap<>(cloudSdkCustomFields);
if (configRef != null) declaredFields.put("configRef", configRef);
if (config != null) declaredFields.put("config", config);
if (placeholderValues != null) declaredFields.put("placeholderValues", placeholderValues);
if (messagesHistory != null) declaredFields.put("messagesHistory", messagesHistory);
return declaredFields;
Expand Down Expand Up @@ -299,7 +262,6 @@ public boolean equals(@Nullable final java.lang.Object o) {
this.cloudSdkCustomFields,
completionRequestConfigurationReferenceById.cloudSdkCustomFields)
&& Objects.equals(this.configRef, completionRequestConfigurationReferenceById.configRef)
&& Objects.equals(this.config, completionRequestConfigurationReferenceById.config)
&& Objects.equals(
this.placeholderValues, completionRequestConfigurationReferenceById.placeholderValues)
&& Objects.equals(
Expand All @@ -308,8 +270,7 @@ public boolean equals(@Nullable final java.lang.Object o) {

@Override
public int hashCode() {
return Objects.hash(
configRef, config, placeholderValues, messagesHistory, cloudSdkCustomFields);
return Objects.hash(configRef, placeholderValues, messagesHistory, cloudSdkCustomFields);
}

@Override
Expand All @@ -318,7 +279,6 @@ public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append("class CompletionRequestConfigurationReferenceById {\n");
sb.append(" configRef: ").append(toIndentedString(configRef)).append("\n");
sb.append(" config: ").append(toIndentedString(config)).append("\n");
sb.append(" placeholderValues: ").append(toIndentedString(placeholderValues)).append("\n");
sb.append(" messagesHistory: ").append(toIndentedString(messagesHistory)).append("\n");
cloudSdkCustomFields.forEach(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ public class CompletionRequestConfigurationReferenceByNameScenarioVersion
@JsonProperty("config_ref")
private CompletionRequestConfigurationReferenceByNameScenarioVersionConfigRef configRef;

@JsonProperty("config")
private OrchestrationConfig config;

@JsonProperty("placeholder_values")
private Map<String, String> placeholderValues = new HashMap<>();

Expand Down Expand Up @@ -91,44 +88,6 @@ public void setConfigRef(
this.configRef = configRef;
}

/**
* Set the config of this {@link CompletionRequestConfigurationReferenceByNameScenarioVersion}
* instance and return the same instance.
*
* @param config The config of this {@link
* CompletionRequestConfigurationReferenceByNameScenarioVersion}
* @return The same instance of this {@link
* CompletionRequestConfigurationReferenceByNameScenarioVersion} class
*/
@Nonnull
public CompletionRequestConfigurationReferenceByNameScenarioVersion config(
@Nullable final OrchestrationConfig config) {
this.config = config;
return this;
}

/**
* Get config
*
* @return config The config of this {@link
* CompletionRequestConfigurationReferenceByNameScenarioVersion} instance.
*/
@Nonnull
public OrchestrationConfig getConfig() {
return config;
}

/**
* Set the config of this {@link CompletionRequestConfigurationReferenceByNameScenarioVersion}
* instance.
*
* @param config The config of this {@link
* CompletionRequestConfigurationReferenceByNameScenarioVersion}
*/
public void setConfig(@Nullable final OrchestrationConfig config) {
this.config = config;
}

/**
* Set the placeholderValues of this {@link
* CompletionRequestConfigurationReferenceByNameScenarioVersion} instance and return the same
Expand Down Expand Up @@ -290,7 +249,6 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc
public Map<String, Object> toMap() {
final Map<String, Object> declaredFields = new LinkedHashMap<>(cloudSdkCustomFields);
if (configRef != null) declaredFields.put("configRef", configRef);
if (config != null) declaredFields.put("config", config);
if (placeholderValues != null) declaredFields.put("placeholderValues", placeholderValues);
if (messagesHistory != null) declaredFields.put("messagesHistory", messagesHistory);
return declaredFields;
Expand Down Expand Up @@ -325,8 +283,6 @@ public boolean equals(@Nullable final java.lang.Object o) {
completionRequestConfigurationReferenceByNameScenarioVersion.cloudSdkCustomFields)
&& Objects.equals(
this.configRef, completionRequestConfigurationReferenceByNameScenarioVersion.configRef)
&& Objects.equals(
this.config, completionRequestConfigurationReferenceByNameScenarioVersion.config)
&& Objects.equals(
this.placeholderValues,
completionRequestConfigurationReferenceByNameScenarioVersion.placeholderValues)
Expand All @@ -337,8 +293,7 @@ public boolean equals(@Nullable final java.lang.Object o) {

@Override
public int hashCode() {
return Objects.hash(
configRef, config, placeholderValues, messagesHistory, cloudSdkCustomFields);
return Objects.hash(configRef, placeholderValues, messagesHistory, cloudSdkCustomFields);
}

@Override
Expand All @@ -347,7 +302,6 @@ public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append("class CompletionRequestConfigurationReferenceByNameScenarioVersion {\n");
sb.append(" configRef: ").append(toIndentedString(configRef)).append("\n");
sb.append(" config: ").append(toIndentedString(config)).append("\n");
sb.append(" placeholderValues: ").append(toIndentedString(placeholderValues)).append("\n");
sb.append(" messagesHistory: ").append(toIndentedString(messagesHistory)).append("\n");
cloudSdkCustomFields.forEach(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected PromptTemplatingModuleConfig() {}
*/
@Nonnull
public PromptTemplatingModuleConfig prompt(
@Nullable final PromptTemplatingModuleConfigPrompt prompt) {
@Nonnull final PromptTemplatingModuleConfigPrompt prompt) {
this.prompt = prompt;
return this;
}
Expand All @@ -69,7 +69,7 @@ public PromptTemplatingModuleConfigPrompt getPrompt() {
*
* @param prompt The prompt of this {@link PromptTemplatingModuleConfig}
*/
public void setPrompt(@Nullable final PromptTemplatingModuleConfigPrompt prompt) {
public void setPrompt(@Nonnull final PromptTemplatingModuleConfigPrompt prompt) {
this.prompt = prompt;
}

Expand Down Expand Up @@ -213,11 +213,22 @@ private String toIndentedString(final java.lang.Object o) {
* PromptTemplatingModuleConfig} instance with all required arguments.
*/
public static Builder create() {
return (model) -> new PromptTemplatingModuleConfig().model(model);
return (prompt) -> (model) -> new PromptTemplatingModuleConfig().prompt(prompt).model(model);
}

/** Builder helper class. */
public interface Builder {
/**
* Set the prompt of this {@link PromptTemplatingModuleConfig} instance.
*
* @param prompt The prompt of this {@link PromptTemplatingModuleConfig}
* @return The PromptTemplatingModuleConfig builder.
*/
Builder1 prompt(@Nonnull final PromptTemplatingModuleConfigPrompt prompt);
}

/** Builder helper class. */
public interface Builder1 {
/**
* Set the model of this {@link PromptTemplatingModuleConfig} instance.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

/**
* The prompt template to be used. Can be either a user defined template or a reference to a
* template in the prompt registry. If omitted, messages_history must be provided in the request
* body.
* template in the prompt registry.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION)
@JsonSubTypes({
Expand Down
62 changes: 24 additions & 38 deletions orchestration/src/main/resources/spec/orchestration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ info:
version: 0.110.12
x-sap-shortText: Enhance content generation with additional capabilities for business AI scenarios.
servers:
- url: https://api.ai.{region}.ml.hana.ondemand.com/v2/inference/deployments/{orchestration_deployment_id}/v2
description: Production endpoint for SAP AI Core
variables:
region:
enum:
- prod.eu-central-1.aws
- prodeuonly.eu-central-1.aws
- prod.us-east-1.aws
- prod.ap-northeast-1.aws
- prod.ap-southeast-2.aws
- prod-eu20.westeurope.azure
- prod-us21.eastus.azure
- prod-eu30.europe-west3.gcp
- prod-us30.us-central1.gcp
default: prod.eu-central-1.aws
orchestration_deployment_id:
description: The deployment ID of the orchestration service. To be obtained from the SAP AI Core service using the deployments endpoint.
default: x111111
- url: https://api.ai.{region}.ml.hana.ondemand.com/v2/inference/deployments/{orchestration_deployment_id}/v2
description: Production endpoint for SAP AI Core
variables:
region:
enum:
- prod.eu-central-1.aws
- prodeuonly.eu-central-1.aws
- prod.us-east-1.aws
- prod.ap-northeast-1.aws
- prod.ap-southeast-2.aws
- prod-eu20.westeurope.azure
- prod-us21.eastus.azure
- prod-eu30.europe-west3.gcp
- prod-us30.us-central1.gcp
default: prod.eu-central-1.aws
orchestration_deployment_id:
description: The deployment ID of the orchestration service. To be obtained from the SAP AI Core service using the deployments endpoint.
default: x111111
externalDocs:
description: Documentation for SAP AI Core - Orchestration
url: https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/orchestration
Expand Down Expand Up @@ -203,6 +203,7 @@ paths:
default:
$ref: "#/components/responses/CommonError"


components:
parameters:
AIResourceGroup:
Expand All @@ -228,8 +229,7 @@ components:
securitySchemes:
Oauth2:
type: oauth2
description:
OAuth client credentials (client ID and secret) are required. These
description: OAuth client credentials (client ID and secret) are required. These
can be requested from SAP BTP cloud cockpit.
flows:
clientCredentials:
Expand Down Expand Up @@ -272,17 +272,7 @@ components:
$ref: "#/components/schemas/EmbeddingsInputText"
type:
type: string
enum:
[
"text",
"document",
"query",
"search_document",
"search_query",
"classification",
"clustering",
"image",
]
enum: ["text", "document", "query", "search_document", "search_query", "classification", "clustering", "image"]
EmbeddingsInputText:
oneOf:
- type: string
Expand All @@ -294,7 +284,7 @@ components:
items:
type: string
minLength: 1
example: ["Hello", "World", "!"]
example: ['Hello', 'World', '!']
description: Text input for which embeddings need to be generated
example: ["This is an input string.", "This is another input string."]
EmbeddingsModuleConfigs:
Expand Down Expand Up @@ -1177,13 +1167,13 @@ components:
PromptTemplatingModuleConfig:
type: object
required:
- prompt
- model
additionalProperties: false
properties:
prompt:
description: >
The prompt template to be used. Can be either a user defined template or a reference to a template in the prompt registry.
If omitted, messages_history must be provided in the request body.
oneOf:
- $ref: "#/components/schemas/Template"
- $ref: "#/components/schemas/TemplateRef"
Expand Down Expand Up @@ -2293,8 +2283,6 @@ components:
properties:
config_ref:
$ref: "#/components/schemas/CompletionRequestConfigurationReferenceByIdConfigRef"
config:
$ref: "#/components/schemas/OrchestrationConfig"
placeholder_values:
type: object
example:
Expand Down Expand Up @@ -2326,8 +2314,6 @@ components:
properties:
config_ref:
$ref: "#/components/schemas/CompletionRequestConfigurationReferenceByNameScenarioVersionConfigRef"
config:
$ref: "#/components/schemas/OrchestrationConfig"
placeholder_values:
type: object
example:
Expand Down Expand Up @@ -2367,4 +2353,4 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
$ref: "#/components/schemas/ErrorResponse"
Loading