Skip to content
Draft
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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,266 @@
/*
* Prompt Registry
* The Prompt Registry simplifies the lifecycle management of prompt templates across design and runtime environments. It comes with an imperative and declarative interface. This API specification describes the imperative API for managing prompt templates and also allows the retrieval of declarative managed prompt templates. A prompt template consists of chat messages where placeholders can be defined together with default values. Additional information such as metadata tags can be added to the resource as well.
*
*
*
* 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.prompt.registry.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;

/** AfterLastRoleTargetSelector */
// CHECKSTYLE:OFF
public class AfterLastRoleTargetSelector implements InputFilterTargetSelector
// CHECKSTYLE:ON
{
/**
* Filter all messages after the last message with this role in the combined message list. If no
* message is scoped after applying this filter, then the filter is skipped.
*/
public enum AfterLastRoleEnum {
/** The SYSTEM option of this AfterLastRoleTargetSelector */
SYSTEM("system"),

/** The USER option of this AfterLastRoleTargetSelector */
USER("user"),

/** The ASSISTANT option of this AfterLastRoleTargetSelector */
ASSISTANT("assistant"),

/** The DEVELOPER option of this AfterLastRoleTargetSelector */
DEVELOPER("developer"),

/** The TOOL option of this AfterLastRoleTargetSelector */
TOOL("tool"),

/** The UNKNOWN_DEFAULT_OPEN_API option of this AfterLastRoleTargetSelector */
UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

private String value;

AfterLastRoleEnum(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 AfterLastRoleTargetSelector
*/
@JsonCreator
@Nonnull
public static AfterLastRoleEnum fromValue(@Nonnull final String value) {
for (AfterLastRoleEnum b : AfterLastRoleEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return UNKNOWN_DEFAULT_OPEN_API;
}
}

@JsonProperty("after_last_role")
private AfterLastRoleEnum afterLastRole;

@JsonAnySetter @JsonAnyGetter
private final Map<String, Object> cloudSdkCustomFields = new LinkedHashMap<>();

/** Default constructor for AfterLastRoleTargetSelector. */
protected AfterLastRoleTargetSelector() {}

/**
* Set the afterLastRole of this {@link AfterLastRoleTargetSelector} instance and return the same
* instance.
*
* @param afterLastRole Filter all messages after the last message with this role in the combined
* message list. If no message is scoped after applying this filter, then the filter is
* skipped.
* @return The same instance of this {@link AfterLastRoleTargetSelector} class
*/
@Nonnull
public AfterLastRoleTargetSelector afterLastRole(@Nonnull final AfterLastRoleEnum afterLastRole) {
this.afterLastRole = afterLastRole;
return this;
}

/**
* Filter all messages after the last message with this role in the combined message list. If no
* message is scoped after applying this filter, then the filter is skipped.
*
* @return afterLastRole The afterLastRole of this {@link AfterLastRoleTargetSelector} instance.
*/
@Nonnull
public AfterLastRoleEnum getAfterLastRole() {
return afterLastRole;
}

/**
* Set the afterLastRole of this {@link AfterLastRoleTargetSelector} instance.
*
* @param afterLastRole Filter all messages after the last message with this role in the combined
* message list. If no message is scoped after applying this filter, then the filter is
* skipped.
*/
public void setAfterLastRole(@Nonnull final AfterLastRoleEnum afterLastRole) {
this.afterLastRole = afterLastRole;
}

/**
* Get the names of the unrecognizable properties of the {@link AfterLastRoleTargetSelector}.
*
* @return The set of properties names
*/
@JsonIgnore
@Nonnull
public Set<String> getCustomFieldNames() {
return cloudSdkCustomFields.keySet();
}

/**
* Get the value of an unrecognizable property of this {@link AfterLastRoleTargetSelector}
* 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(
"AfterLastRoleTargetSelector has no field with name '" + name + "'.");
}
return cloudSdkCustomFields.get(name);
}

/**
* Get the value of all properties of this {@link AfterLastRoleTargetSelector} instance including
* unrecognized properties.
*
* @return The map of all properties
*/
@JsonIgnore
@Nonnull
public Map<String, Object> toMap() {
final Map<String, Object> declaredFields = new LinkedHashMap<>(cloudSdkCustomFields);
if (afterLastRole != null) declaredFields.put("afterLastRole", afterLastRole);
return declaredFields;
}

/**
* Set an unrecognizable property of this {@link AfterLastRoleTargetSelector} 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 AfterLastRoleTargetSelector afterLastRoleTargetSelector = (AfterLastRoleTargetSelector) o;
return Objects.equals(
this.cloudSdkCustomFields, afterLastRoleTargetSelector.cloudSdkCustomFields)
&& Objects.equals(this.afterLastRole, afterLastRoleTargetSelector.afterLastRole);
}

@Override
public int hashCode() {
return Objects.hash(afterLastRole, cloudSdkCustomFields);
}

@Override
@Nonnull
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append("class AfterLastRoleTargetSelector {\n");
sb.append(" afterLastRole: ").append(toIndentedString(afterLastRole)).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
* AfterLastRoleTargetSelector} instance with all required arguments.
*/
public static Builder create() {
return (afterLastRole) -> new AfterLastRoleTargetSelector().afterLastRole(afterLastRole);
}

/** Builder helper class. */
public interface Builder {
/**
* Set the afterLastRole of this {@link AfterLastRoleTargetSelector} instance.
*
* @param afterLastRole Filter all messages after the last message with this role in the
* combined message list. If no message is scoped after applying this filter, then the
* filter is skipped.
* @return The AfterLastRoleTargetSelector instance.
*/
AfterLastRoleTargetSelector afterLastRole(@Nonnull final AfterLastRoleEnum afterLastRole);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Prompt Registry API
* Prompt Storage service for Design time & Runtime prompt templates.
* Prompt Registry
* The Prompt Registry simplifies the lifecycle management of prompt templates across design and runtime environments. It comes with an imperative and declarative interface. This API specification describes the imperative API for managing prompt templates and also allows the retrieval of declarative managed prompt templates. A prompt template consists of chat messages where placeholders can be defined together with default values. Additional information such as metadata tags can be added to the resource as well.
*
*
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Prompt Registry API
* Prompt Storage service for Design time & Runtime prompt templates.
* Prompt Registry
* The Prompt Registry simplifies the lifecycle management of prompt templates across design and runtime environments. It comes with an imperative and declarative interface. This API specification describes the imperative API for managing prompt templates and also allows the retrieval of declarative managed prompt templates. A prompt template consists of chat messages where placeholders can be defined together with default values. Additional information such as metadata tags can be added to the resource as well.
*
*
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Prompt Registry API
* Prompt Storage service for Design time & Runtime prompt templates.
* Prompt Registry
* The Prompt Registry simplifies the lifecycle management of prompt templates across design and runtime environments. It comes with an imperative and declarative interface. This API specification describes the imperative API for managing prompt templates and also allows the retrieval of declarative managed prompt templates. A prompt template consists of chat messages where placeholders can be defined together with default values. Additional information such as metadata tags can be added to the resource as well.
*
*
*
Expand Down Expand Up @@ -90,6 +90,9 @@ public static TypeEnum fromValue(@Nonnull final String value) {
@JsonProperty("config")
private AzureContentSafetyInput config;

@JsonProperty("target_selector")
private InputFilterTargetSelector targetSelector;

@JsonAnySetter @JsonAnyGetter
private final Map<String, Object> cloudSdkCustomFields = new LinkedHashMap<>();

Expand Down Expand Up @@ -161,6 +164,40 @@ public void setConfig(@Nullable final AzureContentSafetyInput config) {
this.config = config;
}

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

/**
* Get targetSelector
*
* @return targetSelector The targetSelector of this {@link AzureContentSafetyInputFilterConfig}
* instance.
*/
@Nonnull
public InputFilterTargetSelector getTargetSelector() {
return targetSelector;
}

/**
* Set the targetSelector of this {@link AzureContentSafetyInputFilterConfig} instance.
*
* @param targetSelector The targetSelector of this {@link AzureContentSafetyInputFilterConfig}
*/
public void setTargetSelector(@Nullable final InputFilterTargetSelector targetSelector) {
this.targetSelector = targetSelector;
}

/**
* Get the names of the unrecognizable properties of the {@link
* AzureContentSafetyInputFilterConfig}.
Expand Down Expand Up @@ -204,6 +241,7 @@ public Map<String, Object> toMap() {
final Map<String, Object> declaredFields = new LinkedHashMap<>(cloudSdkCustomFields);
if (type != null) declaredFields.put("type", type);
if (config != null) declaredFields.put("config", config);
if (targetSelector != null) declaredFields.put("targetSelector", targetSelector);
return declaredFields;
}

Expand Down Expand Up @@ -233,12 +271,13 @@ public boolean equals(@Nullable final java.lang.Object o) {
return Objects.equals(
this.cloudSdkCustomFields, azureContentSafetyInputFilterConfig.cloudSdkCustomFields)
&& Objects.equals(this.type, azureContentSafetyInputFilterConfig.type)
&& Objects.equals(this.config, azureContentSafetyInputFilterConfig.config);
&& Objects.equals(this.config, azureContentSafetyInputFilterConfig.config)
&& Objects.equals(this.targetSelector, azureContentSafetyInputFilterConfig.targetSelector);
}

@Override
public int hashCode() {
return Objects.hash(type, config, cloudSdkCustomFields);
return Objects.hash(type, config, targetSelector, cloudSdkCustomFields);
}

@Override
Expand All @@ -248,6 +287,7 @@ public String toString() {
sb.append("class AzureContentSafetyInputFilterConfig {\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" config: ").append(toIndentedString(config)).append("\n");
sb.append(" targetSelector: ").append(toIndentedString(targetSelector)).append("\n");
cloudSdkCustomFields.forEach(
(k, v) ->
sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Prompt Registry API
* Prompt Storage service for Design time & Runtime prompt templates.
* Prompt Registry
* The Prompt Registry simplifies the lifecycle management of prompt templates across design and runtime environments. It comes with an imperative and declarative interface. This API specification describes the imperative API for managing prompt templates and also allows the retrieval of declarative managed prompt templates. A prompt template consists of chat messages where placeholders can be defined together with default values. Additional information such as metadata tags can be added to the resource as well.
*
*
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Prompt Registry API
* Prompt Storage service for Design time & Runtime prompt templates.
* Prompt Registry
* The Prompt Registry simplifies the lifecycle management of prompt templates across design and runtime environments. It comes with an imperative and declarative interface. This API specification describes the imperative API for managing prompt templates and also allows the retrieval of declarative managed prompt templates. A prompt template consists of chat messages where placeholders can be defined together with default values. Additional information such as metadata tags can be added to the resource as well.
*
*
*
Expand Down
Loading
Loading