diff --git a/docs/release-notes/release_notes.md b/docs/release-notes/release_notes.md index 7e7985c77..ef8313847 100644 --- a/docs/release-notes/release_notes.md +++ b/docs/release-notes/release_notes.md @@ -8,20 +8,23 @@ ### 🔧 Compatibility Notes -- `ChatMessage`, as well as new `MultiChatMessage`, are now subtypes of new interface `ChatMessagesInner`. - Most variables or methods previously typed as `ChatMessage` in `model` package are now typed as `ChatMessagesInner`. +- `SingleChatMessage`, as well as new `MultiChatMessage`, are now subtypes of new interface `ChatMessage`. + Most variables or methods previously typed as `ChatMessage` in `model` package are now typed as `SingleChatMessage`. - Add missing `@Beta` annotations to all `com.sap.ai.sdk.core.client` and `com.sap.ai.sdk.core.model` classes. ### ✨ New Functionality -- Orchestration supports images as input in newly introduced `MultiChatMessage`. -- `MultiChatMessage` also allows for multiple content items (text or image) in one object. -- Grounding input can be masked with `DPIConfig`. -- [Integrate the Orchestration client in Spring AI.](../guides/ORCHESTRATION_CHAT_COMPLETION.md#spring-ai-integration) +- New Orchestration features: + - [Spring AI integration](../guides/ORCHESTRATION_CHAT_COMPLETION.md#spring-ai-integration) + - Images are now supported as input in newly introduced `MultiChatMessage`. + - `MultiChatMessage` also allows for multiple content items (text or image) in one object. + - Grounding input can be masked with `DPIConfig`. + - LLama Guard can now be used for content filtering. + - Support for tool calling and response format ### 📈 Improvements -- Update Orchestration client to version 0.43.0 (2412a) +- Update Orchestration client to version 0.48.2 (2501a) ### 🐛 Fixed Issues diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/ConfigToRequestTransformer.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/ConfigToRequestTransformer.java index 9a99289b4..dea5a69f6 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/ConfigToRequestTransformer.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/ConfigToRequestTransformer.java @@ -1,6 +1,6 @@ package com.sap.ai.sdk.orchestration; -import com.sap.ai.sdk.orchestration.model.ChatMessagesInner; +import com.sap.ai.sdk.orchestration.model.ChatMessage; import com.sap.ai.sdk.orchestration.model.CompletionPostRequest; import com.sap.ai.sdk.orchestration.model.ModuleConfigs; import com.sap.ai.sdk.orchestration.model.OrchestrationConfig; @@ -34,7 +34,7 @@ static CompletionPostRequest toCompletionPostRequest( .messagesHistory( prompt.getMessagesHistory().stream() .map(Message::createChatMessage) - .map(ChatMessagesInner.class::cast) + .map(ChatMessage.class::cast) .toList()); } @@ -48,7 +48,7 @@ static TemplatingModuleConfig toTemplateModuleConfig( * In this case, the request will fail, since the templating module will try to resolve the parameter. * To be fixed with https://github.tools.sap/AI/llm-orchestration/issues/662 */ - val messages = template instanceof Template t ? t.getTemplate() : List.of(); + val messages = template instanceof Template t ? t.getTemplate() : List.of(); val messagesWithPrompt = new ArrayList<>(messages); messagesWithPrompt.addAll( prompt.getMessages().stream().map(Message::createChatMessage).toList()); diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/Message.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/Message.java index 368b058e8..e3199dd01 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/Message.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/Message.java @@ -2,6 +2,7 @@ import com.google.common.annotations.Beta; import com.sap.ai.sdk.orchestration.model.ChatMessage; +import com.sap.ai.sdk.orchestration.model.SingleChatMessage; import javax.annotation.Nonnull; /** Interface representing convenience wrappers of chat message to the orchestration service. */ @@ -47,7 +48,7 @@ static SystemMessage system(@Nonnull final String msg) { */ @Nonnull default ChatMessage createChatMessage() { - return ChatMessage.create().role(role()).content(content()); + return SingleChatMessage.create().role(role()).content(content()); } /** diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationChatResponse.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationChatResponse.java index 607953af9..963f79ad8 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationChatResponse.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationChatResponse.java @@ -3,10 +3,10 @@ import static lombok.AccessLevel.PACKAGE; import com.sap.ai.sdk.orchestration.model.ChatMessage; -import com.sap.ai.sdk.orchestration.model.ChatMessagesInner; import com.sap.ai.sdk.orchestration.model.CompletionPostResponse; import com.sap.ai.sdk.orchestration.model.LLMChoice; import com.sap.ai.sdk.orchestration.model.LLMModuleResultSynchronous; +import com.sap.ai.sdk.orchestration.model.SingleChatMessage; import com.sap.ai.sdk.orchestration.model.TokenUsage; import java.util.ArrayList; import java.util.List; @@ -58,9 +58,8 @@ public TokenUsage getTokenUsage() { public List getAllMessages() throws UnsupportedOperationException { final var messages = new ArrayList(); - for (final ChatMessagesInner chatMessage : - originalResponse.getModuleResults().getTemplating()) { - if (chatMessage instanceof ChatMessage simpleMsg) { + for (final ChatMessage chatMessage : originalResponse.getModuleResults().getTemplating()) { + if (chatMessage instanceof SingleChatMessage simpleMsg) { final var message = switch (simpleMsg.getRole()) { case "user" -> new UserMessage(simpleMsg.getContent()); diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationJacksonConfiguration.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationJacksonConfiguration.java index 26fcb2e19..95e64aa24 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationJacksonConfiguration.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationJacksonConfiguration.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.module.SimpleModule; import com.google.common.annotations.Beta; -import com.sap.ai.sdk.orchestration.model.ChatMessagesInner; +import com.sap.ai.sdk.orchestration.model.ChatMessage; import com.sap.ai.sdk.orchestration.model.LLMModuleResult; import com.sap.ai.sdk.orchestration.model.ModuleResultsOutputUnmaskingInner; import javax.annotation.Nonnull; @@ -45,9 +45,9 @@ public static ObjectMapper getOrchestrationObjectMapper() { final var module = new SimpleModule() .addDeserializer( - ChatMessagesInner.class, - PolymorphicFallbackDeserializer.fromJsonSubTypes(ChatMessagesInner.class)) - .setMixInAnnotation(ChatMessagesInner.class, JacksonMixins.NoneTypeInfoMixin.class); + ChatMessage.class, + PolymorphicFallbackDeserializer.fromJsonSubTypes(ChatMessage.class)) + .setMixInAnnotation(ChatMessage.class, JacksonMixins.NoneTypeInfoMixin.class); jackson.registerModule(module); return jackson; } diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafety.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafety.java index fdfb3b6a4..fe59fc716 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafety.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafety.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafetyFilterConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafetyFilterConfig.java index d4615eef7..c0e0a04ec 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafetyFilterConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureContentSafetyFilterConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -32,7 +32,7 @@ public class AzureContentSafetyFilterConfig implements FilterConfig // CHECKSTYLE:ON { - /** String represents name of the filter provider */ + /** Name of the filter provider type */ public enum TypeEnum { /** The AZURE_CONTENT_SAFETY option of this AzureContentSafetyFilterConfig */ AZURE_CONTENT_SAFETY("azure_content_safety"), @@ -102,7 +102,7 @@ protected AzureContentSafetyFilterConfig() {} * Set the type of this {@link AzureContentSafetyFilterConfig} instance and return the same * instance. * - * @param type String represents name of the filter provider + * @param type Name of the filter provider type * @return The same instance of this {@link AzureContentSafetyFilterConfig} class */ @Nonnull @@ -112,7 +112,7 @@ public AzureContentSafetyFilterConfig type(@Nonnull final TypeEnum type) { } /** - * String represents name of the filter provider + * Name of the filter provider type * * @return type The type of this {@link AzureContentSafetyFilterConfig} instance. */ @@ -124,7 +124,7 @@ public TypeEnum getType() { /** * Set the type of this {@link AzureContentSafetyFilterConfig} instance. * - * @param type String represents name of the filter provider + * @param type Name of the filter provider type */ public void setType(@Nonnull final TypeEnum type) { this.type = type; @@ -261,7 +261,7 @@ public interface Builder { /** * Set the type of this {@link AzureContentSafetyFilterConfig} instance. * - * @param type String represents name of the filter provider + * @param type Name of the filter provider type * @return The AzureContentSafetyFilterConfig instance. */ AzureContentSafetyFilterConfig type(@Nonnull final TypeEnum type); diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureThreshold.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureThreshold.java index a2728005e..93be35eba 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureThreshold.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/AzureThreshold.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatCompletionTool.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatCompletionTool.java new file mode 100644 index 000000000..378c5a3ea --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatCompletionTool.java @@ -0,0 +1,273 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.48.2 + * + * + * 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.orchestration.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 com.google.common.annotations.Beta; +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; + +/** ChatCompletionTool */ +@Beta // CHECKSTYLE:OFF +public class ChatCompletionTool +// CHECKSTYLE:ON +{ + /** The type of the tool. Currently, only `function` is supported. */ + public enum TypeEnum { + /** The FUNCTION option of this ChatCompletionTool */ + FUNCTION("function"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this ChatCompletionTool */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(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 ChatCompletionTool + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("function") + private FunctionObject function; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ChatCompletionTool. */ + protected ChatCompletionTool() {} + + /** + * Set the type of this {@link ChatCompletionTool} instance and return the same instance. + * + * @param type The type of the tool. Currently, only `function` is supported. + * @return The same instance of this {@link ChatCompletionTool} class + */ + @Nonnull + public ChatCompletionTool type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the tool. Currently, only `function` is supported. + * + * @return type The type of this {@link ChatCompletionTool} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link ChatCompletionTool} instance. + * + * @param type The type of the tool. Currently, only `function` is supported. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the function of this {@link ChatCompletionTool} instance and return the same instance. + * + * @param function The function of this {@link ChatCompletionTool} + * @return The same instance of this {@link ChatCompletionTool} class + */ + @Nonnull + public ChatCompletionTool function(@Nonnull final FunctionObject function) { + this.function = function; + return this; + } + + /** + * Get function + * + * @return function The function of this {@link ChatCompletionTool} instance. + */ + @Nonnull + public FunctionObject getFunction() { + return function; + } + + /** + * Set the function of this {@link ChatCompletionTool} instance. + * + * @param function The function of this {@link ChatCompletionTool} + */ + public void setFunction(@Nonnull final FunctionObject function) { + this.function = function; + } + + /** + * Get the names of the unrecognizable properties of the {@link ChatCompletionTool}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ChatCompletionTool} instance. + * + * @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 + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("ChatCompletionTool has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link ChatCompletionTool} 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 ChatCompletionTool chatCompletionTool = (ChatCompletionTool) o; + return Objects.equals(this.cloudSdkCustomFields, chatCompletionTool.cloudSdkCustomFields) + && Objects.equals(this.type, chatCompletionTool.type) + && Objects.equals(this.function, chatCompletionTool.function); + } + + @Override + public int hashCode() { + return Objects.hash(type, function, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ChatCompletionTool {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" function: ").append(toIndentedString(function)).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 ChatCompletionTool} + * instance with all required arguments. + */ + public static Builder create() { + return (type) -> (function) -> new ChatCompletionTool().type(type).function(function); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link ChatCompletionTool} instance. + * + * @param type The type of the tool. Currently, only `function` is supported. + * @return The ChatCompletionTool builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the function of this {@link ChatCompletionTool} instance. + * + * @param function The function of this {@link ChatCompletionTool} + * @return The ChatCompletionTool instance. + */ + ChatCompletionTool function(@Nonnull final FunctionObject function); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatDelta.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatDelta.java index 9906351ef..d752bf41b 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatDelta.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatDelta.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -17,7 +17,9 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.annotations.Beta; +import java.util.ArrayList; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; import java.util.NoSuchElementException; import java.util.Objects; @@ -36,6 +38,12 @@ public class ChatDelta @JsonProperty("content") private String content = ""; + @JsonProperty("refusal") + private String refusal; + + @JsonProperty("tool_calls") + private List toolCalls = new ArrayList<>(); + @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -104,6 +112,83 @@ public void setContent(@Nonnull final String content) { this.content = content; } + /** + * Set the refusal of this {@link ChatDelta} instance and return the same instance. + * + * @param refusal The refusal message generated by the model. + * @return The same instance of this {@link ChatDelta} class + */ + @Nonnull + public ChatDelta refusal(@Nullable final String refusal) { + this.refusal = refusal; + return this; + } + + /** + * The refusal message generated by the model. + * + * @return refusal The refusal of this {@link ChatDelta} instance. + */ + @Nonnull + public String getRefusal() { + return refusal; + } + + /** + * Set the refusal of this {@link ChatDelta} instance. + * + * @param refusal The refusal message generated by the model. + */ + public void setRefusal(@Nullable final String refusal) { + this.refusal = refusal; + } + + /** + * Set the toolCalls of this {@link ChatDelta} instance and return the same instance. + * + * @param toolCalls The toolCalls of this {@link ChatDelta} + * @return The same instance of this {@link ChatDelta} class + */ + @Nonnull + public ChatDelta toolCalls(@Nullable final List toolCalls) { + this.toolCalls = toolCalls; + return this; + } + + /** + * Add one toolCalls instance to this {@link ChatDelta}. + * + * @param toolCallsItem The toolCalls that should be added + * @return The same instance of type {@link ChatDelta} + */ + @Nonnull + public ChatDelta addToolCallsItem(@Nonnull final ToolCallChunk toolCallsItem) { + if (this.toolCalls == null) { + this.toolCalls = new ArrayList<>(); + } + this.toolCalls.add(toolCallsItem); + return this; + } + + /** + * Get toolCalls + * + * @return toolCalls The toolCalls of this {@link ChatDelta} instance. + */ + @Nonnull + public List getToolCalls() { + return toolCalls; + } + + /** + * Set the toolCalls of this {@link ChatDelta} instance. + * + * @param toolCalls The toolCalls of this {@link ChatDelta} + */ + public void setToolCalls(@Nullable final List toolCalls) { + this.toolCalls = toolCalls; + } + /** * Get the names of the unrecognizable properties of the {@link ChatDelta}. * @@ -153,12 +238,14 @@ public boolean equals(@Nullable final java.lang.Object o) { final ChatDelta chatDelta = (ChatDelta) o; return Objects.equals(this.cloudSdkCustomFields, chatDelta.cloudSdkCustomFields) && Objects.equals(this.role, chatDelta.role) - && Objects.equals(this.content, chatDelta.content); + && Objects.equals(this.content, chatDelta.content) + && Objects.equals(this.refusal, chatDelta.refusal) + && Objects.equals(this.toolCalls, chatDelta.toolCalls); } @Override public int hashCode() { - return Objects.hash(role, content, cloudSdkCustomFields); + return Objects.hash(role, content, refusal, toolCalls, cloudSdkCustomFields); } @Override @@ -168,6 +255,8 @@ public String toString() { sb.append("class ChatDelta {\n"); sb.append(" role: ").append(toIndentedString(role)).append("\n"); sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" refusal: ").append(toIndentedString(refusal)).append("\n"); + sb.append(" toolCalls: ").append(toIndentedString(toolCalls)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatMessage.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatMessage.java index d85ba9005..24547d563 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatMessage.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatMessage.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,206 +12,13 @@ package com.sap.ai.sdk.orchestration.model; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.annotations.Beta; -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; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; /** ChatMessage */ -@Beta // CHECKSTYLE:OFF -public class ChatMessage implements ChatMessagesInner -// CHECKSTYLE:ON -{ - @JsonProperty("role") - private String role; - - @JsonProperty("content") - private String content; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for ChatMessage. */ - protected ChatMessage() {} - - /** - * Set the role of this {@link ChatMessage} instance and return the same instance. - * - * @param role The role of this {@link ChatMessage} - * @return The same instance of this {@link ChatMessage} class - */ - @Nonnull - public ChatMessage role(@Nonnull final String role) { - this.role = role; - return this; - } - - /** - * Get role - * - * @return role The role of this {@link ChatMessage} instance. - */ - @Nonnull - public String getRole() { - return role; - } - - /** - * Set the role of this {@link ChatMessage} instance. - * - * @param role The role of this {@link ChatMessage} - */ - public void setRole(@Nonnull final String role) { - this.role = role; - } - - /** - * Set the content of this {@link ChatMessage} instance and return the same instance. - * - * @param content The content of this {@link ChatMessage} - * @return The same instance of this {@link ChatMessage} class - */ - @Nonnull - public ChatMessage content(@Nonnull final String content) { - this.content = content; - return this; - } - - /** - * Get content - * - * @return content The content of this {@link ChatMessage} instance. - */ - @Nonnull - public String getContent() { - return content; - } - - /** - * Set the content of this {@link ChatMessage} instance. - * - * @param content The content of this {@link ChatMessage} - */ - public void setContent(@Nonnull final String content) { - this.content = content; - } - - /** - * Get the names of the unrecognizable properties of the {@link ChatMessage}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link ChatMessage} instance. - * - * @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 - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("ChatMessage has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link ChatMessage} 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 ChatMessage chatMessage = (ChatMessage) o; - return Objects.equals(this.cloudSdkCustomFields, chatMessage.cloudSdkCustomFields) - && Objects.equals(this.role, chatMessage.role) - && Objects.equals(this.content, chatMessage.content); - } - - @Override - public int hashCode() { - return Objects.hash(role, content, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class ChatMessage {\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" content: ").append(toIndentedString(content)).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 ChatMessage} instance - * with all required arguments. - */ - public static Builder create() { - return (role) -> (content) -> new ChatMessage().role(role).content(content); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the role of this {@link ChatMessage} instance. - * - * @param role The role of this {@link ChatMessage} - * @return The ChatMessage builder. - */ - Builder1 role(@Nonnull final String role); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the content of this {@link ChatMessage} instance. - * - * @param content The content of this {@link ChatMessage} - * @return The ChatMessage instance. - */ - ChatMessage content(@Nonnull final String content); - } -} +@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) +@JsonSubTypes({ + @JsonSubTypes.Type(value = MultiChatMessage.class), + @JsonSubTypes.Type(value = SingleChatMessage.class), +}) +public interface ChatMessage {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostRequest.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostRequest.java index 344a7feb3..1bde94583 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostRequest.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostRequest.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -40,7 +40,7 @@ public class CompletionPostRequest private Map inputParams = new HashMap<>(); @JsonProperty("messages_history") - private List messagesHistory; + private List messagesHistory; @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -140,8 +140,7 @@ public void setInputParams(@Nullable final Map inputParams) { * @return The same instance of this {@link CompletionPostRequest} class */ @Nonnull - public CompletionPostRequest messagesHistory( - @Nullable final List messagesHistory) { + public CompletionPostRequest messagesHistory(@Nullable final List messagesHistory) { this.messagesHistory = messagesHistory; return this; } @@ -154,7 +153,7 @@ public CompletionPostRequest messagesHistory( */ @Nonnull public CompletionPostRequest addMessagesHistoryItem( - @Nonnull final ChatMessagesInner messagesHistoryItem) { + @Nonnull final ChatMessage messagesHistoryItem) { if (this.messagesHistory == null) { this.messagesHistory = new ArrayList<>(); } @@ -169,7 +168,7 @@ public CompletionPostRequest addMessagesHistoryItem( * @return messagesHistory The messagesHistory of this {@link CompletionPostRequest} instance. */ @Nonnull - public List getMessagesHistory() { + public List getMessagesHistory() { return messagesHistory; } @@ -179,7 +178,7 @@ public List getMessagesHistory() { * @param messagesHistory History of chat messages. Can be used to provide system and assistant * messages to set the context of the conversation. Will be merged with the template message */ - public void setMessagesHistory(@Nullable final List messagesHistory) { + public void setMessagesHistory(@Nullable final List messagesHistory) { this.messagesHistory = messagesHistory; } diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostResponse.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostResponse.java index 13ebcc432..6b451453b 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostResponse.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostResponse.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostResponseStreaming.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostResponseStreaming.java index 45c9cdf9b..82746e9f2 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostResponseStreaming.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/CompletionPostResponseStreaming.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIConfig.java index 47e739e95..e21a0db1c 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIConfigMaskGroundingInput.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIConfigMaskGroundingInput.java index d11e4d746..d47726809 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIConfigMaskGroundingInput.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIConfigMaskGroundingInput.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIEntities.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIEntities.java index 346e2ac8d..d248cbe0f 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIEntities.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIEntities.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIEntityConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIEntityConfig.java index 7fdb1cb3e..7ce621ed9 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIEntityConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DPIEntityConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 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 680fec885..98b16a87c 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 @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +20,8 @@ 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/DocumentGroundingFilter.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DocumentGroundingFilter.java index 466c7f477..533954c10 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DocumentGroundingFilter.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/DocumentGroundingFilter.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -110,7 +110,7 @@ public DocumentGroundingFilter searchConfig( * * @return searchConfig The searchConfig of this {@link DocumentGroundingFilter} instance. */ - @Nullable + @Nonnull public GroundingFilterSearchConfiguration getSearchConfig() { return searchConfig; } diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ErrorResponse.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ErrorResponse.java index b3faab498..193997eaa 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ErrorResponse.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ErrorResponse.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 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 deef401b0..33532a5bd 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 @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,5 +19,6 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) @JsonSubTypes({ @JsonSubTypes.Type(value = AzureContentSafetyFilterConfig.class), + @JsonSubTypes.Type(value = LlamaGuard38bFilterConfig.class), }) public interface FilterConfig {} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilteringModuleConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilteringModuleConfig.java index 092340c8b..371695005 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilteringModuleConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilteringModuleConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilteringStreamOptions.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilteringStreamOptions.java index 8b9874c3f..748d7a204 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilteringStreamOptions.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FilteringStreamOptions.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FunctionObject.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FunctionObject.java new file mode 100644 index 000000000..f03504a55 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/FunctionObject.java @@ -0,0 +1,325 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.48.2 + * + * + * 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.orchestration.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.HashMap; +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; + +/** FunctionObject */ +@Beta // CHECKSTYLE:OFF +public class FunctionObject +// CHECKSTYLE:ON +{ + @JsonProperty("description") + private String description; + + @JsonProperty("name") + private String name; + + @JsonProperty("parameters") + private Map parameters = new HashMap<>(); + + @JsonProperty("strict") + private Boolean strict = false; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for FunctionObject. */ + protected FunctionObject() {} + + /** + * Set the description of this {@link FunctionObject} instance and return the same instance. + * + * @param description A description of what the function does, used by the model to choose when + * and how to call the function. + * @return The same instance of this {@link FunctionObject} class + */ + @Nonnull + public FunctionObject description(@Nullable final String description) { + this.description = description; + return this; + } + + /** + * A description of what the function does, used by the model to choose when and how to call the + * function. + * + * @return description The description of this {@link FunctionObject} instance. + */ + @Nonnull + public String getDescription() { + return description; + } + + /** + * Set the description of this {@link FunctionObject} instance. + * + * @param description A description of what the function does, used by the model to choose when + * and how to call the function. + */ + public void setDescription(@Nullable final String description) { + this.description = description; + } + + /** + * Set the name of this {@link FunctionObject} instance and return the same instance. + * + * @param name The name of the function to be called. Must be a-z, A-Z, 0-9, or contain + * underscores and dashes, with a maximum length of 64. + * @return The same instance of this {@link FunctionObject} class + */ + @Nonnull + public FunctionObject name(@Nonnull final String name) { + this.name = name; + return this; + } + + /** + * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and + * dashes, with a maximum length of 64. + * + * @return name The name of this {@link FunctionObject} instance. + */ + @Nonnull + public String getName() { + return name; + } + + /** + * Set the name of this {@link FunctionObject} instance. + * + * @param name The name of the function to be called. Must be a-z, A-Z, 0-9, or contain + * underscores and dashes, with a maximum length of 64. + */ + public void setName(@Nonnull final String name) { + this.name = name; + } + + /** + * Set the parameters of this {@link FunctionObject} instance and return the same instance. + * + * @param parameters The parameters the functions accepts, described as a JSON Schema object. See + * the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the + * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for + * documentation about the format. Omitting `parameters` defines a function with an + * empty parameter list. + * @return The same instance of this {@link FunctionObject} class + */ + @Nonnull + public FunctionObject parameters(@Nullable final Map parameters) { + this.parameters = parameters; + return this; + } + + /** + * Put one parameters instance to this {@link FunctionObject} instance. + * + * @param key The String key of this parameters instance + * @param parametersItem The parameters that should be added under the given key + * @return The same instance of type {@link FunctionObject} + */ + @Nonnull + public FunctionObject putparametersItem( + @Nonnull final String key, @Nullable final Object parametersItem) { + if (this.parameters == null) { + this.parameters = new HashMap<>(); + } + this.parameters.put(key, parametersItem); + return this; + } + + /** + * The parameters the functions accepts, described as a JSON Schema object. See the + * [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON + * Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about + * the format. Omitting `parameters` defines a function with an empty parameter list. + * + * @return parameters The parameters of this {@link FunctionObject} instance. + */ + @Nonnull + public Map getParameters() { + return parameters; + } + + /** + * Set the parameters of this {@link FunctionObject} instance. + * + * @param parameters The parameters the functions accepts, described as a JSON Schema object. See + * the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the + * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for + * documentation about the format. Omitting `parameters` defines a function with an + * empty parameter list. + */ + public void setParameters(@Nullable final Map parameters) { + this.parameters = parameters; + } + + /** + * Set the strict of this {@link FunctionObject} instance and return the same instance. + * + * @param strict Whether to enable strict schema adherence when generating the function call. If + * set to true, the model will follow the exact schema defined in the `parameters` + * field. Only a subset of JSON Schema is supported when `strict` is + * `true`. Learn more about Structured Outputs in the [function calling + * guide](docs/guides/function-calling). + * @return The same instance of this {@link FunctionObject} class + */ + @Nonnull + public FunctionObject strict(@Nullable final Boolean strict) { + this.strict = strict; + return this; + } + + /** + * Whether to enable strict schema adherence when generating the function call. If set to true, + * the model will follow the exact schema defined in the `parameters` field. Only a + * subset of JSON Schema is supported when `strict` is `true`. Learn more + * about Structured Outputs in the [function calling guide](docs/guides/function-calling). + * + * @return strict The strict of this {@link FunctionObject} instance. + */ + @Nullable + public Boolean isStrict() { + return strict; + } + + /** + * Set the strict of this {@link FunctionObject} instance. + * + * @param strict Whether to enable strict schema adherence when generating the function call. If + * set to true, the model will follow the exact schema defined in the `parameters` + * field. Only a subset of JSON Schema is supported when `strict` is + * `true`. Learn more about Structured Outputs in the [function calling + * guide](docs/guides/function-calling). + */ + public void setStrict(@Nullable final Boolean strict) { + this.strict = strict; + } + + /** + * Get the names of the unrecognizable properties of the {@link FunctionObject}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link FunctionObject} instance. + * + * @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 + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("FunctionObject has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link FunctionObject} 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 FunctionObject functionObject = (FunctionObject) o; + return Objects.equals(this.cloudSdkCustomFields, functionObject.cloudSdkCustomFields) + && Objects.equals(this.description, functionObject.description) + && Objects.equals(this.name, functionObject.name) + && Objects.equals(this.parameters, functionObject.parameters) + && Objects.equals(this.strict, functionObject.strict); + } + + @Override + public int hashCode() { + return Objects.hash(description, name, parameters, strict, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class FunctionObject {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); + sb.append(" strict: ").append(toIndentedString(strict)).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 FunctionObject} + * instance with all required arguments. + */ + public static Builder create() { + return (name) -> new FunctionObject().name(name); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the name of this {@link FunctionObject} instance. + * + * @param name The name of the function to be called. Must be a-z, A-Z, 0-9, or contain + * underscores and dashes, with a maximum length of 64. + * @return The FunctionObject instance. + */ + FunctionObject name(@Nonnull final String name); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GenericModuleResult.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GenericModuleResult.java index a01ce6316..47d1cda2d 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GenericModuleResult.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GenericModuleResult.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GlobalStreamOptions.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GlobalStreamOptions.java index f0af712f3..52f66820d 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GlobalStreamOptions.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GlobalStreamOptions.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingFilterSearchConfiguration.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingFilterSearchConfiguration.java index ba8bbbffa..ccd8be52c 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingFilterSearchConfiguration.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingFilterSearchConfiguration.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -63,7 +63,7 @@ public GroundingFilterSearchConfiguration maxChunkCount(@Nullable final Integer * @return maxChunkCount The maxChunkCount of this {@link GroundingFilterSearchConfiguration} * instance. */ - @Nullable + @Nonnull public Integer getMaxChunkCount() { return maxChunkCount; } @@ -102,7 +102,7 @@ public GroundingFilterSearchConfiguration maxDocumentCount( * @return maxDocumentCount The maxDocumentCount of this {@link * GroundingFilterSearchConfiguration} instance. */ - @Nullable + @Nonnull public Integer getMaxDocumentCount() { return maxDocumentCount; } diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfig.java index 914517ae5..8e500872b 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfigConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfigConfig.java index 06e73ca20..5597762a2 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfigConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/GroundingModuleConfigConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 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 012a3640c..781122d38 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 @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ImageContent.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ImageContent.java index 1a9c59e39..5eaf5c788 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ImageContent.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ImageContent.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ImageContentImageUrl.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ImageContentImageUrl.java index 5a9dd707c..fe061877b 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ImageContentImageUrl.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ImageContentImageUrl.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/InputFilteringConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/InputFilteringConfig.java index b406c5c67..4c6e212d2 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/InputFilteringConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/InputFilteringConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/KeyValueListPair.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/KeyValueListPair.java index 861cc5efe..14fc09e90 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/KeyValueListPair.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/KeyValueListPair.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMChoice.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMChoice.java index 98ce5325a..8e913a28f 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMChoice.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMChoice.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -37,7 +37,7 @@ public class LLMChoice implements ModuleResultsOutputUnmaskingInner private Integer index; @JsonProperty("message") - private ChatMessage message; + private ResponseChatMessage message; @JsonProperty("logprobs") private Map> logprobs = new HashMap<>(); @@ -89,7 +89,7 @@ public void setIndex(@Nonnull final Integer index) { * @return The same instance of this {@link LLMChoice} class */ @Nonnull - public LLMChoice message(@Nonnull final ChatMessage message) { + public LLMChoice message(@Nonnull final ResponseChatMessage message) { this.message = message; return this; } @@ -100,7 +100,7 @@ public LLMChoice message(@Nonnull final ChatMessage message) { * @return message The message of this {@link LLMChoice} instance. */ @Nonnull - public ChatMessage getMessage() { + public ResponseChatMessage getMessage() { return message; } @@ -109,7 +109,7 @@ public ChatMessage getMessage() { * * @param message The message of this {@link LLMChoice} */ - public void setMessage(@Nonnull final ChatMessage message) { + public void setMessage(@Nonnull final ResponseChatMessage message) { this.message = message; } @@ -316,7 +316,7 @@ public interface Builder1 { * @param message The message of this {@link LLMChoice} * @return The LLMChoice builder. */ - Builder2 message(@Nonnull final ChatMessage message); + Builder2 message(@Nonnull final ResponseChatMessage message); } /** Builder helper class. */ diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMChoiceStreaming.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMChoiceStreaming.java index 9705809cb..4b620b0ee 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMChoiceStreaming.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMChoiceStreaming.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleConfig.java index 076db674a..57baf7830 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.annotations.Beta; +import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import java.util.NoSuchElementException; @@ -34,7 +35,7 @@ public class LLMModuleConfig private String modelName; @JsonProperty("model_params") - private Object modelParams; + private Map modelParams = new HashMap<>(); @JsonProperty("model_version") private String modelVersion = "latest"; @@ -83,18 +84,35 @@ public void setModelName(@Nonnull final String modelName) { * @return The same instance of this {@link LLMModuleConfig} class */ @Nonnull - public LLMModuleConfig modelParams(@Nonnull final Object modelParams) { + public LLMModuleConfig modelParams(@Nullable final Map modelParams) { this.modelParams = modelParams; return this; } + /** + * Put one modelParams instance to this {@link LLMModuleConfig} instance. + * + * @param key The String key of this modelParams instance + * @param modelParamsItem The modelParams that should be added under the given key + * @return The same instance of type {@link LLMModuleConfig} + */ + @Nonnull + public LLMModuleConfig putmodelParamsItem( + @Nonnull final String key, @Nullable final Object modelParamsItem) { + if (this.modelParams == null) { + this.modelParams = new HashMap<>(); + } + this.modelParams.put(key, modelParamsItem); + return this; + } + /** * Model parameters * * @return modelParams The modelParams of this {@link LLMModuleConfig} instance. */ @Nonnull - public Object getModelParams() { + public Map getModelParams() { return modelParams; } @@ -103,7 +121,7 @@ public Object getModelParams() { * * @param modelParams Model parameters */ - public void setModelParams(@Nonnull final Object modelParams) { + public void setModelParams(@Nullable final Map modelParams) { this.modelParams = modelParams; } @@ -226,8 +244,7 @@ private String toIndentedString(final java.lang.Object o) { * instance with all required arguments. */ public static Builder create() { - return (modelName) -> - (modelParams) -> new LLMModuleConfig().modelName(modelName).modelParams(modelParams); + return (modelName) -> new LLMModuleConfig().modelName(modelName); } /** Builder helper class. */ @@ -236,19 +253,8 @@ public interface Builder { * Set the modelName of this {@link LLMModuleConfig} instance. * * @param modelName Model name as in LLM Access configuration - * @return The LLMModuleConfig builder. - */ - Builder1 modelName(@Nonnull final String modelName); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the modelParams of this {@link LLMModuleConfig} instance. - * - * @param modelParams Model parameters * @return The LLMModuleConfig instance. */ - LLMModuleConfig modelParams(@Nonnull final Object modelParams); + LLMModuleConfig modelName(@Nonnull final String modelName); } } 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 1a6e99d95..292cdb845 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 @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResultStreaming.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResultStreaming.java index 1e597ba69..2ec6cefa0 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResultStreaming.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResultStreaming.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResultSynchronous.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResultSynchronous.java index 4a74a61c2..018562ddf 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResultSynchronous.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LLMModuleResultSynchronous.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LlamaGuard38b.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LlamaGuard38b.java new file mode 100644 index 000000000..b7a87d101 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LlamaGuard38b.java @@ -0,0 +1,648 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.48.2 + * + * + * 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.orchestration.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +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; + +/** Filter configuration for Llama Guard 3 8B */ +@Beta // CHECKSTYLE:OFF +public class LlamaGuard38b +// CHECKSTYLE:ON +{ + @JsonProperty("violent_crimes") + private Boolean violentCrimes; + + @JsonProperty("non_violent_crimes") + private Boolean nonViolentCrimes; + + @JsonProperty("sex_crimes") + private Boolean sexCrimes; + + @JsonProperty("child_exploitation") + private Boolean childExploitation; + + @JsonProperty("defamation") + private Boolean defamation; + + @JsonProperty("specialized_advice") + private Boolean specializedAdvice; + + @JsonProperty("privacy") + private Boolean privacy; + + @JsonProperty("intellectual_property") + private Boolean intellectualProperty; + + @JsonProperty("indiscriminate_weapons") + private Boolean indiscriminateWeapons; + + @JsonProperty("hate") + private Boolean hate; + + @JsonProperty("self_harm") + private Boolean selfHarm; + + @JsonProperty("sexual_content") + private Boolean sexualContent; + + @JsonProperty("elections") + private Boolean elections; + + @JsonProperty("code_interpreter_abuse") + private Boolean codeInterpreterAbuse; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for LlamaGuard38b. */ + protected LlamaGuard38b() {} + + /** + * Set the violentCrimes of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param violentCrimes The violentCrimes of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b violentCrimes(@Nullable final Boolean violentCrimes) { + this.violentCrimes = violentCrimes; + return this; + } + + /** + * Get violentCrimes + * + * @return violentCrimes The violentCrimes of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isViolentCrimes() { + return violentCrimes; + } + + /** + * Set the violentCrimes of this {@link LlamaGuard38b} instance. + * + * @param violentCrimes The violentCrimes of this {@link LlamaGuard38b} + */ + public void setViolentCrimes(@Nullable final Boolean violentCrimes) { + this.violentCrimes = violentCrimes; + } + + /** + * Set the nonViolentCrimes of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param nonViolentCrimes The nonViolentCrimes of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b nonViolentCrimes(@Nullable final Boolean nonViolentCrimes) { + this.nonViolentCrimes = nonViolentCrimes; + return this; + } + + /** + * Get nonViolentCrimes + * + * @return nonViolentCrimes The nonViolentCrimes of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isNonViolentCrimes() { + return nonViolentCrimes; + } + + /** + * Set the nonViolentCrimes of this {@link LlamaGuard38b} instance. + * + * @param nonViolentCrimes The nonViolentCrimes of this {@link LlamaGuard38b} + */ + public void setNonViolentCrimes(@Nullable final Boolean nonViolentCrimes) { + this.nonViolentCrimes = nonViolentCrimes; + } + + /** + * Set the sexCrimes of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param sexCrimes The sexCrimes of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b sexCrimes(@Nullable final Boolean sexCrimes) { + this.sexCrimes = sexCrimes; + return this; + } + + /** + * Get sexCrimes + * + * @return sexCrimes The sexCrimes of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isSexCrimes() { + return sexCrimes; + } + + /** + * Set the sexCrimes of this {@link LlamaGuard38b} instance. + * + * @param sexCrimes The sexCrimes of this {@link LlamaGuard38b} + */ + public void setSexCrimes(@Nullable final Boolean sexCrimes) { + this.sexCrimes = sexCrimes; + } + + /** + * Set the childExploitation of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param childExploitation The childExploitation of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b childExploitation(@Nullable final Boolean childExploitation) { + this.childExploitation = childExploitation; + return this; + } + + /** + * Get childExploitation + * + * @return childExploitation The childExploitation of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isChildExploitation() { + return childExploitation; + } + + /** + * Set the childExploitation of this {@link LlamaGuard38b} instance. + * + * @param childExploitation The childExploitation of this {@link LlamaGuard38b} + */ + public void setChildExploitation(@Nullable final Boolean childExploitation) { + this.childExploitation = childExploitation; + } + + /** + * Set the defamation of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param defamation The defamation of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b defamation(@Nullable final Boolean defamation) { + this.defamation = defamation; + return this; + } + + /** + * Get defamation + * + * @return defamation The defamation of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isDefamation() { + return defamation; + } + + /** + * Set the defamation of this {@link LlamaGuard38b} instance. + * + * @param defamation The defamation of this {@link LlamaGuard38b} + */ + public void setDefamation(@Nullable final Boolean defamation) { + this.defamation = defamation; + } + + /** + * Set the specializedAdvice of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param specializedAdvice The specializedAdvice of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b specializedAdvice(@Nullable final Boolean specializedAdvice) { + this.specializedAdvice = specializedAdvice; + return this; + } + + /** + * Get specializedAdvice + * + * @return specializedAdvice The specializedAdvice of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isSpecializedAdvice() { + return specializedAdvice; + } + + /** + * Set the specializedAdvice of this {@link LlamaGuard38b} instance. + * + * @param specializedAdvice The specializedAdvice of this {@link LlamaGuard38b} + */ + public void setSpecializedAdvice(@Nullable final Boolean specializedAdvice) { + this.specializedAdvice = specializedAdvice; + } + + /** + * Set the privacy of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param privacy The privacy of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b privacy(@Nullable final Boolean privacy) { + this.privacy = privacy; + return this; + } + + /** + * Get privacy + * + * @return privacy The privacy of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isPrivacy() { + return privacy; + } + + /** + * Set the privacy of this {@link LlamaGuard38b} instance. + * + * @param privacy The privacy of this {@link LlamaGuard38b} + */ + public void setPrivacy(@Nullable final Boolean privacy) { + this.privacy = privacy; + } + + /** + * Set the intellectualProperty of this {@link LlamaGuard38b} instance and return the same + * instance. + * + * @param intellectualProperty The intellectualProperty of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b intellectualProperty(@Nullable final Boolean intellectualProperty) { + this.intellectualProperty = intellectualProperty; + return this; + } + + /** + * Get intellectualProperty + * + * @return intellectualProperty The intellectualProperty of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isIntellectualProperty() { + return intellectualProperty; + } + + /** + * Set the intellectualProperty of this {@link LlamaGuard38b} instance. + * + * @param intellectualProperty The intellectualProperty of this {@link LlamaGuard38b} + */ + public void setIntellectualProperty(@Nullable final Boolean intellectualProperty) { + this.intellectualProperty = intellectualProperty; + } + + /** + * Set the indiscriminateWeapons of this {@link LlamaGuard38b} instance and return the same + * instance. + * + * @param indiscriminateWeapons The indiscriminateWeapons of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b indiscriminateWeapons(@Nullable final Boolean indiscriminateWeapons) { + this.indiscriminateWeapons = indiscriminateWeapons; + return this; + } + + /** + * Get indiscriminateWeapons + * + * @return indiscriminateWeapons The indiscriminateWeapons of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isIndiscriminateWeapons() { + return indiscriminateWeapons; + } + + /** + * Set the indiscriminateWeapons of this {@link LlamaGuard38b} instance. + * + * @param indiscriminateWeapons The indiscriminateWeapons of this {@link LlamaGuard38b} + */ + public void setIndiscriminateWeapons(@Nullable final Boolean indiscriminateWeapons) { + this.indiscriminateWeapons = indiscriminateWeapons; + } + + /** + * Set the hate of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param hate The hate of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b hate(@Nullable final Boolean hate) { + this.hate = hate; + return this; + } + + /** + * Get hate + * + * @return hate The hate of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isHate() { + return hate; + } + + /** + * Set the hate of this {@link LlamaGuard38b} instance. + * + * @param hate The hate of this {@link LlamaGuard38b} + */ + public void setHate(@Nullable final Boolean hate) { + this.hate = hate; + } + + /** + * Set the selfHarm of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param selfHarm The selfHarm of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b selfHarm(@Nullable final Boolean selfHarm) { + this.selfHarm = selfHarm; + return this; + } + + /** + * Get selfHarm + * + * @return selfHarm The selfHarm of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isSelfHarm() { + return selfHarm; + } + + /** + * Set the selfHarm of this {@link LlamaGuard38b} instance. + * + * @param selfHarm The selfHarm of this {@link LlamaGuard38b} + */ + public void setSelfHarm(@Nullable final Boolean selfHarm) { + this.selfHarm = selfHarm; + } + + /** + * Set the sexualContent of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param sexualContent The sexualContent of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b sexualContent(@Nullable final Boolean sexualContent) { + this.sexualContent = sexualContent; + return this; + } + + /** + * Get sexualContent + * + * @return sexualContent The sexualContent of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isSexualContent() { + return sexualContent; + } + + /** + * Set the sexualContent of this {@link LlamaGuard38b} instance. + * + * @param sexualContent The sexualContent of this {@link LlamaGuard38b} + */ + public void setSexualContent(@Nullable final Boolean sexualContent) { + this.sexualContent = sexualContent; + } + + /** + * Set the elections of this {@link LlamaGuard38b} instance and return the same instance. + * + * @param elections The elections of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b elections(@Nullable final Boolean elections) { + this.elections = elections; + return this; + } + + /** + * Get elections + * + * @return elections The elections of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isElections() { + return elections; + } + + /** + * Set the elections of this {@link LlamaGuard38b} instance. + * + * @param elections The elections of this {@link LlamaGuard38b} + */ + public void setElections(@Nullable final Boolean elections) { + this.elections = elections; + } + + /** + * Set the codeInterpreterAbuse of this {@link LlamaGuard38b} instance and return the same + * instance. + * + * @param codeInterpreterAbuse The codeInterpreterAbuse of this {@link LlamaGuard38b} + * @return The same instance of this {@link LlamaGuard38b} class + */ + @Nonnull + public LlamaGuard38b codeInterpreterAbuse(@Nullable final Boolean codeInterpreterAbuse) { + this.codeInterpreterAbuse = codeInterpreterAbuse; + return this; + } + + /** + * Get codeInterpreterAbuse + * + * @return codeInterpreterAbuse The codeInterpreterAbuse of this {@link LlamaGuard38b} instance. + */ + @Nonnull + public Boolean isCodeInterpreterAbuse() { + return codeInterpreterAbuse; + } + + /** + * Set the codeInterpreterAbuse of this {@link LlamaGuard38b} instance. + * + * @param codeInterpreterAbuse The codeInterpreterAbuse of this {@link LlamaGuard38b} + */ + public void setCodeInterpreterAbuse(@Nullable final Boolean codeInterpreterAbuse) { + this.codeInterpreterAbuse = codeInterpreterAbuse; + } + + /** + * Get the names of the unrecognizable properties of the {@link LlamaGuard38b}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link LlamaGuard38b} instance. + * + * @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 + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("LlamaGuard38b has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link LlamaGuard38b} 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 LlamaGuard38b llamaGuard38b = (LlamaGuard38b) o; + return Objects.equals(this.cloudSdkCustomFields, llamaGuard38b.cloudSdkCustomFields) + && Objects.equals(this.violentCrimes, llamaGuard38b.violentCrimes) + && Objects.equals(this.nonViolentCrimes, llamaGuard38b.nonViolentCrimes) + && Objects.equals(this.sexCrimes, llamaGuard38b.sexCrimes) + && Objects.equals(this.childExploitation, llamaGuard38b.childExploitation) + && Objects.equals(this.defamation, llamaGuard38b.defamation) + && Objects.equals(this.specializedAdvice, llamaGuard38b.specializedAdvice) + && Objects.equals(this.privacy, llamaGuard38b.privacy) + && Objects.equals(this.intellectualProperty, llamaGuard38b.intellectualProperty) + && Objects.equals(this.indiscriminateWeapons, llamaGuard38b.indiscriminateWeapons) + && Objects.equals(this.hate, llamaGuard38b.hate) + && Objects.equals(this.selfHarm, llamaGuard38b.selfHarm) + && Objects.equals(this.sexualContent, llamaGuard38b.sexualContent) + && Objects.equals(this.elections, llamaGuard38b.elections) + && Objects.equals(this.codeInterpreterAbuse, llamaGuard38b.codeInterpreterAbuse); + } + + @Override + public int hashCode() { + return Objects.hash( + violentCrimes, + nonViolentCrimes, + sexCrimes, + childExploitation, + defamation, + specializedAdvice, + privacy, + intellectualProperty, + indiscriminateWeapons, + hate, + selfHarm, + sexualContent, + elections, + codeInterpreterAbuse, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class LlamaGuard38b {\n"); + sb.append(" violentCrimes: ").append(toIndentedString(violentCrimes)).append("\n"); + sb.append(" nonViolentCrimes: ").append(toIndentedString(nonViolentCrimes)).append("\n"); + sb.append(" sexCrimes: ").append(toIndentedString(sexCrimes)).append("\n"); + sb.append(" childExploitation: ").append(toIndentedString(childExploitation)).append("\n"); + sb.append(" defamation: ").append(toIndentedString(defamation)).append("\n"); + sb.append(" specializedAdvice: ").append(toIndentedString(specializedAdvice)).append("\n"); + sb.append(" privacy: ").append(toIndentedString(privacy)).append("\n"); + sb.append(" intellectualProperty: ") + .append(toIndentedString(intellectualProperty)) + .append("\n"); + sb.append(" indiscriminateWeapons: ") + .append(toIndentedString(indiscriminateWeapons)) + .append("\n"); + sb.append(" hate: ").append(toIndentedString(hate)).append("\n"); + sb.append(" selfHarm: ").append(toIndentedString(selfHarm)).append("\n"); + sb.append(" sexualContent: ").append(toIndentedString(sexualContent)).append("\n"); + sb.append(" elections: ").append(toIndentedString(elections)).append("\n"); + sb.append(" codeInterpreterAbuse: ") + .append(toIndentedString(codeInterpreterAbuse)) + .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 new {@link LlamaGuard38b} instance. No arguments are required. */ + public static LlamaGuard38b create() { + return new LlamaGuard38b(); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LlamaGuard38bFilterConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LlamaGuard38bFilterConfig.java new file mode 100644 index 000000000..be12a3cde --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/LlamaGuard38bFilterConfig.java @@ -0,0 +1,274 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.48.2 + * + * + * 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.orchestration.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 com.google.common.annotations.Beta; +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; + +/** LlamaGuard38bFilterConfig */ +@Beta // CHECKSTYLE:OFF +public class LlamaGuard38bFilterConfig implements FilterConfig +// CHECKSTYLE:ON +{ + /** Name of the filter provider type */ + public enum TypeEnum { + /** The LLAMA_GUARD_3_8B option of this LlamaGuard38bFilterConfig */ + LLAMA_GUARD_3_8B("llama_guard_3_8b"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this LlamaGuard38bFilterConfig */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(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 LlamaGuard38bFilterConfig + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("config") + private LlamaGuard38b config; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for LlamaGuard38bFilterConfig. */ + protected LlamaGuard38bFilterConfig() {} + + /** + * Set the type of this {@link LlamaGuard38bFilterConfig} instance and return the same instance. + * + * @param type Name of the filter provider type + * @return The same instance of this {@link LlamaGuard38bFilterConfig} class + */ + @Nonnull + public LlamaGuard38bFilterConfig type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * Name of the filter provider type + * + * @return type The type of this {@link LlamaGuard38bFilterConfig} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link LlamaGuard38bFilterConfig} instance. + * + * @param type Name of the filter provider type + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the config of this {@link LlamaGuard38bFilterConfig} instance and return the same instance. + * + * @param config The config of this {@link LlamaGuard38bFilterConfig} + * @return The same instance of this {@link LlamaGuard38bFilterConfig} class + */ + @Nonnull + public LlamaGuard38bFilterConfig config(@Nonnull final LlamaGuard38b config) { + this.config = config; + return this; + } + + /** + * Get config + * + * @return config The config of this {@link LlamaGuard38bFilterConfig} instance. + */ + @Nonnull + public LlamaGuard38b getConfig() { + return config; + } + + /** + * Set the config of this {@link LlamaGuard38bFilterConfig} instance. + * + * @param config The config of this {@link LlamaGuard38bFilterConfig} + */ + public void setConfig(@Nonnull final LlamaGuard38b config) { + this.config = config; + } + + /** + * Get the names of the unrecognizable properties of the {@link LlamaGuard38bFilterConfig}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link LlamaGuard38bFilterConfig} instance. + * + * @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 + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "LlamaGuard38bFilterConfig has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link LlamaGuard38bFilterConfig} 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 LlamaGuard38bFilterConfig llamaGuard38bFilterConfig = (LlamaGuard38bFilterConfig) o; + return Objects.equals(this.cloudSdkCustomFields, llamaGuard38bFilterConfig.cloudSdkCustomFields) + && Objects.equals(this.type, llamaGuard38bFilterConfig.type) + && Objects.equals(this.config, llamaGuard38bFilterConfig.config); + } + + @Override + public int hashCode() { + return Objects.hash(type, config, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class LlamaGuard38bFilterConfig {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" config: ").append(toIndentedString(config)).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 + * LlamaGuard38bFilterConfig} instance with all required arguments. + */ + public static Builder create() { + return (type) -> (config) -> new LlamaGuard38bFilterConfig().type(type).config(config); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link LlamaGuard38bFilterConfig} instance. + * + * @param type Name of the filter provider type + * @return The LlamaGuard38bFilterConfig builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the config of this {@link LlamaGuard38bFilterConfig} instance. + * + * @param config The config of this {@link LlamaGuard38bFilterConfig} + * @return The LlamaGuard38bFilterConfig instance. + */ + LlamaGuard38bFilterConfig config(@Nonnull final LlamaGuard38b config); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MaskingModuleConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MaskingModuleConfig.java index c8491838e..229c44ae6 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MaskingModuleConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MaskingModuleConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 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 c24981eda..3413ae52a 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 @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleConfigs.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleConfigs.java index 3796a2512..bc0df933e 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleConfigs.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleConfigs.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleResults.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleResults.java index dd232d764..cde3384b2 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleResults.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ModuleResults.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -36,7 +36,7 @@ public class ModuleResults private GenericModuleResult grounding; @JsonProperty("templating") - private List templating = new ArrayList<>(); + private List templating = new ArrayList<>(); @JsonProperty("input_masking") private GenericModuleResult inputMasking; @@ -97,7 +97,7 @@ public void setGrounding(@Nullable final GenericModuleResult grounding) { * @return The same instance of this {@link ModuleResults} class */ @Nonnull - public ModuleResults templating(@Nullable final List templating) { + public ModuleResults templating(@Nullable final List templating) { this.templating = templating; return this; } @@ -109,7 +109,7 @@ public ModuleResults templating(@Nullable final List templati * @return The same instance of type {@link ModuleResults} */ @Nonnull - public ModuleResults addTemplatingItem(@Nonnull final ChatMessagesInner templatingItem) { + public ModuleResults addTemplatingItem(@Nonnull final ChatMessage templatingItem) { if (this.templating == null) { this.templating = new ArrayList<>(); } @@ -123,7 +123,7 @@ public ModuleResults addTemplatingItem(@Nonnull final ChatMessagesInner templati * @return templating The templating of this {@link ModuleResults} instance. */ @Nonnull - public List getTemplating() { + public List getTemplating() { return templating; } @@ -132,7 +132,7 @@ public List getTemplating() { * * @param templating The templating of this {@link ModuleResults} */ - public void setTemplating(@Nullable final List templating) { + public void setTemplating(@Nullable final List templating) { this.templating = templating; } 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 79dcce091..c56d6c64e 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 @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MultiChatMessage.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MultiChatMessage.java index 44718872f..6acd58e87 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MultiChatMessage.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MultiChatMessage.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -30,7 +30,7 @@ /** MultiChatMessage */ @Beta // CHECKSTYLE:OFF -public class MultiChatMessage implements ChatMessagesInner +public class MultiChatMessage implements ChatMessage // CHECKSTYLE:ON { @JsonProperty("role") diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MultiChatMessageContent.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MultiChatMessageContent.java index 72a8c4e7e..cd3c9c7a4 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MultiChatMessageContent.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/MultiChatMessageContent.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OrchestrationConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OrchestrationConfig.java index 4fac832dd..6e2145c99 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OrchestrationConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OrchestrationConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OutputFilteringConfig.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OutputFilteringConfig.java index 1c14acb78..6e6637c66 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OutputFilteringConfig.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/OutputFilteringConfig.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseChatMessage.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseChatMessage.java new file mode 100644 index 000000000..6dcfc5837 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseChatMessage.java @@ -0,0 +1,308 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.48.2 + * + * + * 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.orchestration.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** ResponseChatMessage */ +@Beta // CHECKSTYLE:OFF +public class ResponseChatMessage +// CHECKSTYLE:ON +{ + @JsonProperty("role") + private String role; + + @JsonProperty("content") + private String content; + + @JsonProperty("refusal") + private String refusal; + + @JsonProperty("tool_calls") + private List toolCalls = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ResponseChatMessage. */ + protected ResponseChatMessage() {} + + /** + * Set the role of this {@link ResponseChatMessage} instance and return the same instance. + * + * @param role The role of this {@link ResponseChatMessage} + * @return The same instance of this {@link ResponseChatMessage} class + */ + @Nonnull + public ResponseChatMessage role(@Nonnull final String role) { + this.role = role; + return this; + } + + /** + * Get role + * + * @return role The role of this {@link ResponseChatMessage} instance. + */ + @Nonnull + public String getRole() { + return role; + } + + /** + * Set the role of this {@link ResponseChatMessage} instance. + * + * @param role The role of this {@link ResponseChatMessage} + */ + public void setRole(@Nonnull final String role) { + this.role = role; + } + + /** + * Set the content of this {@link ResponseChatMessage} instance and return the same instance. + * + * @param content The content of this {@link ResponseChatMessage} + * @return The same instance of this {@link ResponseChatMessage} class + */ + @Nonnull + public ResponseChatMessage content(@Nonnull final String content) { + this.content = content; + return this; + } + + /** + * Get content + * + * @return content The content of this {@link ResponseChatMessage} instance. + */ + @Nonnull + public String getContent() { + return content; + } + + /** + * Set the content of this {@link ResponseChatMessage} instance. + * + * @param content The content of this {@link ResponseChatMessage} + */ + public void setContent(@Nonnull final String content) { + this.content = content; + } + + /** + * Set the refusal of this {@link ResponseChatMessage} instance and return the same instance. + * + * @param refusal The refusal of this {@link ResponseChatMessage} + * @return The same instance of this {@link ResponseChatMessage} class + */ + @Nonnull + public ResponseChatMessage refusal(@Nullable final String refusal) { + this.refusal = refusal; + return this; + } + + /** + * Get refusal + * + * @return refusal The refusal of this {@link ResponseChatMessage} instance. + */ + @Nonnull + public String getRefusal() { + return refusal; + } + + /** + * Set the refusal of this {@link ResponseChatMessage} instance. + * + * @param refusal The refusal of this {@link ResponseChatMessage} + */ + public void setRefusal(@Nullable final String refusal) { + this.refusal = refusal; + } + + /** + * Set the toolCalls of this {@link ResponseChatMessage} instance and return the same instance. + * + * @param toolCalls The tool calls generated by the model, such as function calls. + * @return The same instance of this {@link ResponseChatMessage} class + */ + @Nonnull + public ResponseChatMessage toolCalls(@Nullable final List toolCalls) { + this.toolCalls = toolCalls; + return this; + } + + /** + * Add one toolCalls instance to this {@link ResponseChatMessage}. + * + * @param toolCallsItem The toolCalls that should be added + * @return The same instance of type {@link ResponseChatMessage} + */ + @Nonnull + public ResponseChatMessage addToolCallsItem( + @Nonnull final ResponseMessageToolCall toolCallsItem) { + if (this.toolCalls == null) { + this.toolCalls = new ArrayList<>(); + } + this.toolCalls.add(toolCallsItem); + return this; + } + + /** + * The tool calls generated by the model, such as function calls. + * + * @return toolCalls The toolCalls of this {@link ResponseChatMessage} instance. + */ + @Nonnull + public List getToolCalls() { + return toolCalls; + } + + /** + * Set the toolCalls of this {@link ResponseChatMessage} instance. + * + * @param toolCalls The tool calls generated by the model, such as function calls. + */ + public void setToolCalls(@Nullable final List toolCalls) { + this.toolCalls = toolCalls; + } + + /** + * Get the names of the unrecognizable properties of the {@link ResponseChatMessage}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ResponseChatMessage} instance. + * + * @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 + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "ResponseChatMessage has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link ResponseChatMessage} 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 ResponseChatMessage responseChatMessage = (ResponseChatMessage) o; + return Objects.equals(this.cloudSdkCustomFields, responseChatMessage.cloudSdkCustomFields) + && Objects.equals(this.role, responseChatMessage.role) + && Objects.equals(this.content, responseChatMessage.content) + && Objects.equals(this.refusal, responseChatMessage.refusal) + && Objects.equals(this.toolCalls, responseChatMessage.toolCalls); + } + + @Override + public int hashCode() { + return Objects.hash(role, content, refusal, toolCalls, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ResponseChatMessage {\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" refusal: ").append(toIndentedString(refusal)).append("\n"); + sb.append(" toolCalls: ").append(toIndentedString(toolCalls)).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 ResponseChatMessage} + * instance with all required arguments. + */ + public static Builder create() { + return (role) -> (content) -> new ResponseChatMessage().role(role).content(content); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the role of this {@link ResponseChatMessage} instance. + * + * @param role The role of this {@link ResponseChatMessage} + * @return The ResponseChatMessage builder. + */ + Builder1 role(@Nonnull final String role); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the content of this {@link ResponseChatMessage} instance. + * + * @param content The content of this {@link ResponseChatMessage} + * @return The ResponseChatMessage instance. + */ + ResponseChatMessage content(@Nonnull final String content); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseFormatJsonObject.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseFormatJsonObject.java new file mode 100644 index 000000000..7be7e8bd8 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseFormatJsonObject.java @@ -0,0 +1,227 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.48.2 + * + * + * 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.orchestration.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 com.google.common.annotations.Beta; +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; + +/** ResponseFormatJsonObject */ +@Beta // CHECKSTYLE:OFF +public class ResponseFormatJsonObject implements TemplateResponseFormat +// CHECKSTYLE:ON +{ + /** The type of response format being defined: `json_object` */ + public enum TypeEnum { + /** The JSON_OBJECT option of this ResponseFormatJsonObject */ + JSON_OBJECT("json_object"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this ResponseFormatJsonObject */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(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 ResponseFormatJsonObject + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ResponseFormatJsonObject. */ + protected ResponseFormatJsonObject() {} + + /** + * Set the type of this {@link ResponseFormatJsonObject} instance and return the same instance. + * + * @param type The type of response format being defined: `json_object` + * @return The same instance of this {@link ResponseFormatJsonObject} class + */ + @Nonnull + public ResponseFormatJsonObject type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of response format being defined: `json_object` + * + * @return type The type of this {@link ResponseFormatJsonObject} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link ResponseFormatJsonObject} instance. + * + * @param type The type of response format being defined: `json_object` + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Get the names of the unrecognizable properties of the {@link ResponseFormatJsonObject}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ResponseFormatJsonObject} instance. + * + * @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 + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "ResponseFormatJsonObject has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link ResponseFormatJsonObject} 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 ResponseFormatJsonObject responseFormatJsonObject = (ResponseFormatJsonObject) o; + return Objects.equals(this.cloudSdkCustomFields, responseFormatJsonObject.cloudSdkCustomFields) + && Objects.equals(this.type, responseFormatJsonObject.type); + } + + @Override + public int hashCode() { + return Objects.hash(type, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ResponseFormatJsonObject {\n"); + sb.append(" type: ").append(toIndentedString(type)).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 + * ResponseFormatJsonObject} instance with all required arguments. + */ + public static Builder create() { + return (type) -> new ResponseFormatJsonObject().type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link ResponseFormatJsonObject} instance. + * + * @param type The type of response format being defined: `json_object` + * @return The ResponseFormatJsonObject instance. + */ + ResponseFormatJsonObject type(@Nonnull final TypeEnum type); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseFormatJsonSchema.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseFormatJsonSchema.java new file mode 100644 index 000000000..9ea2e4b5f --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseFormatJsonSchema.java @@ -0,0 +1,278 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.48.2 + * + * + * 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.orchestration.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 com.google.common.annotations.Beta; +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; + +/** ResponseFormatJsonSchema */ +@Beta // CHECKSTYLE:OFF +public class ResponseFormatJsonSchema implements TemplateResponseFormat +// CHECKSTYLE:ON +{ + /** The type of response format being defined: `json_schema` */ + public enum TypeEnum { + /** The JSON_SCHEMA option of this ResponseFormatJsonSchema */ + JSON_SCHEMA("json_schema"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this ResponseFormatJsonSchema */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(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 ResponseFormatJsonSchema + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("json_schema") + private ResponseFormatJsonSchemaJsonSchema jsonSchema; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ResponseFormatJsonSchema. */ + protected ResponseFormatJsonSchema() {} + + /** + * Set the type of this {@link ResponseFormatJsonSchema} instance and return the same instance. + * + * @param type The type of response format being defined: `json_schema` + * @return The same instance of this {@link ResponseFormatJsonSchema} class + */ + @Nonnull + public ResponseFormatJsonSchema type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of response format being defined: `json_schema` + * + * @return type The type of this {@link ResponseFormatJsonSchema} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link ResponseFormatJsonSchema} instance. + * + * @param type The type of response format being defined: `json_schema` + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the jsonSchema of this {@link ResponseFormatJsonSchema} instance and return the same + * instance. + * + * @param jsonSchema The jsonSchema of this {@link ResponseFormatJsonSchema} + * @return The same instance of this {@link ResponseFormatJsonSchema} class + */ + @Nonnull + public ResponseFormatJsonSchema jsonSchema( + @Nonnull final ResponseFormatJsonSchemaJsonSchema jsonSchema) { + this.jsonSchema = jsonSchema; + return this; + } + + /** + * Get jsonSchema + * + * @return jsonSchema The jsonSchema of this {@link ResponseFormatJsonSchema} instance. + */ + @Nonnull + public ResponseFormatJsonSchemaJsonSchema getJsonSchema() { + return jsonSchema; + } + + /** + * Set the jsonSchema of this {@link ResponseFormatJsonSchema} instance. + * + * @param jsonSchema The jsonSchema of this {@link ResponseFormatJsonSchema} + */ + public void setJsonSchema(@Nonnull final ResponseFormatJsonSchemaJsonSchema jsonSchema) { + this.jsonSchema = jsonSchema; + } + + /** + * Get the names of the unrecognizable properties of the {@link ResponseFormatJsonSchema}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ResponseFormatJsonSchema} instance. + * + * @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 + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "ResponseFormatJsonSchema has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link ResponseFormatJsonSchema} 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 ResponseFormatJsonSchema responseFormatJsonSchema = (ResponseFormatJsonSchema) o; + return Objects.equals(this.cloudSdkCustomFields, responseFormatJsonSchema.cloudSdkCustomFields) + && Objects.equals(this.type, responseFormatJsonSchema.type) + && Objects.equals(this.jsonSchema, responseFormatJsonSchema.jsonSchema); + } + + @Override + public int hashCode() { + return Objects.hash(type, jsonSchema, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ResponseFormatJsonSchema {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" jsonSchema: ").append(toIndentedString(jsonSchema)).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 + * ResponseFormatJsonSchema} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (jsonSchema) -> new ResponseFormatJsonSchema().type(type).jsonSchema(jsonSchema); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link ResponseFormatJsonSchema} instance. + * + * @param type The type of response format being defined: `json_schema` + * @return The ResponseFormatJsonSchema builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the jsonSchema of this {@link ResponseFormatJsonSchema} instance. + * + * @param jsonSchema The jsonSchema of this {@link ResponseFormatJsonSchema} + * @return The ResponseFormatJsonSchema instance. + */ + ResponseFormatJsonSchema jsonSchema( + @Nonnull final ResponseFormatJsonSchemaJsonSchema jsonSchema); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseFormatJsonSchemaJsonSchema.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseFormatJsonSchemaJsonSchema.java new file mode 100644 index 000000000..5e434fdbb --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseFormatJsonSchemaJsonSchema.java @@ -0,0 +1,325 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.48.2 + * + * + * 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.orchestration.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +import java.util.HashMap; +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; + +/** ResponseFormatJsonSchemaJsonSchema */ +@Beta // CHECKSTYLE:OFF +public class ResponseFormatJsonSchemaJsonSchema +// CHECKSTYLE:ON +{ + @JsonProperty("description") + private String description; + + @JsonProperty("name") + private String name; + + @JsonProperty("schema") + private Map schema = new HashMap<>(); + + @JsonProperty("strict") + private Boolean strict = false; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ResponseFormatJsonSchemaJsonSchema. */ + protected ResponseFormatJsonSchemaJsonSchema() {} + + /** + * Set the description of this {@link ResponseFormatJsonSchemaJsonSchema} instance and return the + * same instance. + * + * @param description A description of what the response format is for, used by the model to + * determine how to respond in the format. + * @return The same instance of this {@link ResponseFormatJsonSchemaJsonSchema} class + */ + @Nonnull + public ResponseFormatJsonSchemaJsonSchema description(@Nullable final String description) { + this.description = description; + return this; + } + + /** + * A description of what the response format is for, used by the model to determine how to respond + * in the format. + * + * @return description The description of this {@link ResponseFormatJsonSchemaJsonSchema} + * instance. + */ + @Nonnull + public String getDescription() { + return description; + } + + /** + * Set the description of this {@link ResponseFormatJsonSchemaJsonSchema} instance. + * + * @param description A description of what the response format is for, used by the model to + * determine how to respond in the format. + */ + public void setDescription(@Nullable final String description) { + this.description = description; + } + + /** + * Set the name of this {@link ResponseFormatJsonSchemaJsonSchema} instance and return the same + * instance. + * + * @param name The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and + * dashes, with a maximum length of 64. + * @return The same instance of this {@link ResponseFormatJsonSchemaJsonSchema} class + */ + @Nonnull + public ResponseFormatJsonSchemaJsonSchema name(@Nonnull final String name) { + this.name = name; + return this; + } + + /** + * The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with + * a maximum length of 64. + * + * @return name The name of this {@link ResponseFormatJsonSchemaJsonSchema} instance. + */ + @Nonnull + public String getName() { + return name; + } + + /** + * Set the name of this {@link ResponseFormatJsonSchemaJsonSchema} instance. + * + * @param name The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and + * dashes, with a maximum length of 64. + */ + public void setName(@Nonnull final String name) { + this.name = name; + } + + /** + * Set the schema of this {@link ResponseFormatJsonSchemaJsonSchema} instance and return the same + * instance. + * + * @param schema The schema for the response format, described as a JSON Schema object. + * @return The same instance of this {@link ResponseFormatJsonSchemaJsonSchema} class + */ + @Nonnull + public ResponseFormatJsonSchemaJsonSchema schema(@Nullable final Map schema) { + this.schema = schema; + return this; + } + + /** + * Put one schema instance to this {@link ResponseFormatJsonSchemaJsonSchema} instance. + * + * @param key The String key of this schema instance + * @param schemaItem The schema that should be added under the given key + * @return The same instance of type {@link ResponseFormatJsonSchemaJsonSchema} + */ + @Nonnull + public ResponseFormatJsonSchemaJsonSchema putschemaItem( + @Nonnull final String key, @Nullable final Object schemaItem) { + if (this.schema == null) { + this.schema = new HashMap<>(); + } + this.schema.put(key, schemaItem); + return this; + } + + /** + * The schema for the response format, described as a JSON Schema object. + * + * @return schema The schema of this {@link ResponseFormatJsonSchemaJsonSchema} instance. + */ + @Nonnull + public Map getSchema() { + return schema; + } + + /** + * Set the schema of this {@link ResponseFormatJsonSchemaJsonSchema} instance. + * + * @param schema The schema for the response format, described as a JSON Schema object. + */ + public void setSchema(@Nullable final Map schema) { + this.schema = schema; + } + + /** + * Set the strict of this {@link ResponseFormatJsonSchemaJsonSchema} instance and return the same + * instance. + * + * @param strict Whether to enable strict schema adherence when generating the output. If set to + * true, the model will always follow the exact schema defined in the `schema` + * field. Only a subset of JSON Schema is supported when `strict` is + * `true`. To learn more, read the [Structured Outputs + * guide](https://platform.openai.com/docs/guides/structured-outputs). + * @return The same instance of this {@link ResponseFormatJsonSchemaJsonSchema} class + */ + @Nonnull + public ResponseFormatJsonSchemaJsonSchema strict(@Nullable final Boolean strict) { + this.strict = strict; + return this; + } + + /** + * Whether to enable strict schema adherence when generating the output. If set to true, the model + * will always follow the exact schema defined in the `schema` field. Only a subset of + * JSON Schema is supported when `strict` is `true`. To learn more, read the + * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + * + * @return strict The strict of this {@link ResponseFormatJsonSchemaJsonSchema} instance. + */ + @Nullable + public Boolean isStrict() { + return strict; + } + + /** + * Set the strict of this {@link ResponseFormatJsonSchemaJsonSchema} instance. + * + * @param strict Whether to enable strict schema adherence when generating the output. If set to + * true, the model will always follow the exact schema defined in the `schema` + * field. Only a subset of JSON Schema is supported when `strict` is + * `true`. To learn more, read the [Structured Outputs + * guide](https://platform.openai.com/docs/guides/structured-outputs). + */ + public void setStrict(@Nullable final Boolean strict) { + this.strict = strict; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * ResponseFormatJsonSchemaJsonSchema}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ResponseFormatJsonSchemaJsonSchema} + * instance. + * + * @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 + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "ResponseFormatJsonSchemaJsonSchema has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link ResponseFormatJsonSchemaJsonSchema} 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 ResponseFormatJsonSchemaJsonSchema responseFormatJsonSchemaJsonSchema = + (ResponseFormatJsonSchemaJsonSchema) o; + return Objects.equals( + this.cloudSdkCustomFields, responseFormatJsonSchemaJsonSchema.cloudSdkCustomFields) + && Objects.equals(this.description, responseFormatJsonSchemaJsonSchema.description) + && Objects.equals(this.name, responseFormatJsonSchemaJsonSchema.name) + && Objects.equals(this.schema, responseFormatJsonSchemaJsonSchema.schema) + && Objects.equals(this.strict, responseFormatJsonSchemaJsonSchema.strict); + } + + @Override + public int hashCode() { + return Objects.hash(description, name, schema, strict, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ResponseFormatJsonSchemaJsonSchema {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); + sb.append(" strict: ").append(toIndentedString(strict)).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 + * ResponseFormatJsonSchemaJsonSchema} instance with all required arguments. + */ + public static Builder create() { + return (name) -> new ResponseFormatJsonSchemaJsonSchema().name(name); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the name of this {@link ResponseFormatJsonSchemaJsonSchema} instance. + * + * @param name The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores + * and dashes, with a maximum length of 64. + * @return The ResponseFormatJsonSchemaJsonSchema instance. + */ + ResponseFormatJsonSchemaJsonSchema name(@Nonnull final String name); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseFormatText.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseFormatText.java new file mode 100644 index 000000000..34d2e3c96 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseFormatText.java @@ -0,0 +1,226 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.48.2 + * + * + * 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.orchestration.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 com.google.common.annotations.Beta; +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; + +/** ResponseFormatText */ +@Beta // CHECKSTYLE:OFF +public class ResponseFormatText implements TemplateResponseFormat +// CHECKSTYLE:ON +{ + /** The type of response format being defined: `text` */ + public enum TypeEnum { + /** The TEXT option of this ResponseFormatText */ + TEXT("text"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this ResponseFormatText */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(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 ResponseFormatText + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ResponseFormatText. */ + protected ResponseFormatText() {} + + /** + * Set the type of this {@link ResponseFormatText} instance and return the same instance. + * + * @param type The type of response format being defined: `text` + * @return The same instance of this {@link ResponseFormatText} class + */ + @Nonnull + public ResponseFormatText type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of response format being defined: `text` + * + * @return type The type of this {@link ResponseFormatText} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link ResponseFormatText} instance. + * + * @param type The type of response format being defined: `text` + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Get the names of the unrecognizable properties of the {@link ResponseFormatText}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ResponseFormatText} instance. + * + * @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 + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("ResponseFormatText has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link ResponseFormatText} 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 ResponseFormatText responseFormatText = (ResponseFormatText) o; + return Objects.equals(this.cloudSdkCustomFields, responseFormatText.cloudSdkCustomFields) + && Objects.equals(this.type, responseFormatText.type); + } + + @Override + public int hashCode() { + return Objects.hash(type, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ResponseFormatText {\n"); + sb.append(" type: ").append(toIndentedString(type)).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 ResponseFormatText} + * instance with all required arguments. + */ + public static Builder create() { + return (type) -> new ResponseFormatText().type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link ResponseFormatText} instance. + * + * @param type The type of response format being defined: `text` + * @return The ResponseFormatText instance. + */ + ResponseFormatText type(@Nonnull final TypeEnum type); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseMessageToolCall.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseMessageToolCall.java new file mode 100644 index 000000000..300bd84e8 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseMessageToolCall.java @@ -0,0 +1,322 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.48.2 + * + * + * 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.orchestration.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 com.google.common.annotations.Beta; +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; + +/** ResponseMessageToolCall */ +@Beta // CHECKSTYLE:OFF +public class ResponseMessageToolCall +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + /** The type of the tool. Currently, only `function` is supported. */ + public enum TypeEnum { + /** The FUNCTION option of this ResponseMessageToolCall */ + FUNCTION("function"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this ResponseMessageToolCall */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(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 ResponseMessageToolCall + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("function") + private ResponseMessageToolCallFunction function; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ResponseMessageToolCall. */ + protected ResponseMessageToolCall() {} + + /** + * Set the id of this {@link ResponseMessageToolCall} instance and return the same instance. + * + * @param id The ID of the tool call. + * @return The same instance of this {@link ResponseMessageToolCall} class + */ + @Nonnull + public ResponseMessageToolCall id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * The ID of the tool call. + * + * @return id The id of this {@link ResponseMessageToolCall} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link ResponseMessageToolCall} instance. + * + * @param id The ID of the tool call. + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the type of this {@link ResponseMessageToolCall} instance and return the same instance. + * + * @param type The type of the tool. Currently, only `function` is supported. + * @return The same instance of this {@link ResponseMessageToolCall} class + */ + @Nonnull + public ResponseMessageToolCall type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the tool. Currently, only `function` is supported. + * + * @return type The type of this {@link ResponseMessageToolCall} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link ResponseMessageToolCall} instance. + * + * @param type The type of the tool. Currently, only `function` is supported. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the function of this {@link ResponseMessageToolCall} instance and return the same instance. + * + * @param function The function of this {@link ResponseMessageToolCall} + * @return The same instance of this {@link ResponseMessageToolCall} class + */ + @Nonnull + public ResponseMessageToolCall function(@Nonnull final ResponseMessageToolCallFunction function) { + this.function = function; + return this; + } + + /** + * Get function + * + * @return function The function of this {@link ResponseMessageToolCall} instance. + */ + @Nonnull + public ResponseMessageToolCallFunction getFunction() { + return function; + } + + /** + * Set the function of this {@link ResponseMessageToolCall} instance. + * + * @param function The function of this {@link ResponseMessageToolCall} + */ + public void setFunction(@Nonnull final ResponseMessageToolCallFunction function) { + this.function = function; + } + + /** + * Get the names of the unrecognizable properties of the {@link ResponseMessageToolCall}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ResponseMessageToolCall} instance. + * + * @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 + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "ResponseMessageToolCall has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link ResponseMessageToolCall} 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 ResponseMessageToolCall responseMessageToolCall = (ResponseMessageToolCall) o; + return Objects.equals(this.cloudSdkCustomFields, responseMessageToolCall.cloudSdkCustomFields) + && Objects.equals(this.id, responseMessageToolCall.id) + && Objects.equals(this.type, responseMessageToolCall.type) + && Objects.equals(this.function, responseMessageToolCall.function); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, function, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ResponseMessageToolCall {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" function: ").append(toIndentedString(function)).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 + * ResponseMessageToolCall} instance with all required arguments. + */ + public static Builder create() { + return (id) -> + (type) -> (function) -> new ResponseMessageToolCall().id(id).type(type).function(function); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link ResponseMessageToolCall} instance. + * + * @param id The ID of the tool call. + * @return The ResponseMessageToolCall builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the type of this {@link ResponseMessageToolCall} instance. + * + * @param type The type of the tool. Currently, only `function` is supported. + * @return The ResponseMessageToolCall builder. + */ + Builder2 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the function of this {@link ResponseMessageToolCall} instance. + * + * @param function The function of this {@link ResponseMessageToolCall} + * @return The ResponseMessageToolCall instance. + */ + ResponseMessageToolCall function(@Nonnull final ResponseMessageToolCallFunction function); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseMessageToolCallFunction.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseMessageToolCallFunction.java new file mode 100644 index 000000000..0c6aee78f --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ResponseMessageToolCallFunction.java @@ -0,0 +1,236 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.48.2 + * + * + * 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.orchestration.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +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; + +/** The function that the model called. */ +@Beta // CHECKSTYLE:OFF +public class ResponseMessageToolCallFunction +// CHECKSTYLE:ON +{ + @JsonProperty("name") + private String name; + + @JsonProperty("arguments") + private String arguments; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ResponseMessageToolCallFunction. */ + protected ResponseMessageToolCallFunction() {} + + /** + * Set the name of this {@link ResponseMessageToolCallFunction} instance and return the same + * instance. + * + * @param name The name of the function to call. + * @return The same instance of this {@link ResponseMessageToolCallFunction} class + */ + @Nonnull + public ResponseMessageToolCallFunction name(@Nonnull final String name) { + this.name = name; + return this; + } + + /** + * The name of the function to call. + * + * @return name The name of this {@link ResponseMessageToolCallFunction} instance. + */ + @Nonnull + public String getName() { + return name; + } + + /** + * Set the name of this {@link ResponseMessageToolCallFunction} instance. + * + * @param name The name of the function to call. + */ + public void setName(@Nonnull final String name) { + this.name = name; + } + + /** + * Set the arguments of this {@link ResponseMessageToolCallFunction} instance and return the same + * instance. + * + * @param arguments The arguments to call the function with, as generated by the model in JSON + * format. Note that the model does not always generate valid JSON, and may hallucinate + * parameters not defined by your function schema. Validate the arguments in your code before + * calling your function. + * @return The same instance of this {@link ResponseMessageToolCallFunction} class + */ + @Nonnull + public ResponseMessageToolCallFunction arguments(@Nonnull final String arguments) { + this.arguments = arguments; + return this; + } + + /** + * The arguments to call the function with, as generated by the model in JSON format. Note that + * the model does not always generate valid JSON, and may hallucinate parameters not defined by + * your function schema. Validate the arguments in your code before calling your function. + * + * @return arguments The arguments of this {@link ResponseMessageToolCallFunction} instance. + */ + @Nonnull + public String getArguments() { + return arguments; + } + + /** + * Set the arguments of this {@link ResponseMessageToolCallFunction} instance. + * + * @param arguments The arguments to call the function with, as generated by the model in JSON + * format. Note that the model does not always generate valid JSON, and may hallucinate + * parameters not defined by your function schema. Validate the arguments in your code before + * calling your function. + */ + public void setArguments(@Nonnull final String arguments) { + this.arguments = arguments; + } + + /** + * Get the names of the unrecognizable properties of the {@link ResponseMessageToolCallFunction}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ResponseMessageToolCallFunction} + * instance. + * + * @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 + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "ResponseMessageToolCallFunction has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link ResponseMessageToolCallFunction} 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 ResponseMessageToolCallFunction responseMessageToolCallFunction = + (ResponseMessageToolCallFunction) o; + return Objects.equals( + this.cloudSdkCustomFields, responseMessageToolCallFunction.cloudSdkCustomFields) + && Objects.equals(this.name, responseMessageToolCallFunction.name) + && Objects.equals(this.arguments, responseMessageToolCallFunction.arguments); + } + + @Override + public int hashCode() { + return Objects.hash(name, arguments, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ResponseMessageToolCallFunction {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" arguments: ").append(toIndentedString(arguments)).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 + * ResponseMessageToolCallFunction} instance with all required arguments. + */ + public static Builder create() { + return (name) -> + (arguments) -> new ResponseMessageToolCallFunction().name(name).arguments(arguments); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the name of this {@link ResponseMessageToolCallFunction} instance. + * + * @param name The name of the function to call. + * @return The ResponseMessageToolCallFunction builder. + */ + Builder1 name(@Nonnull final String name); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the arguments of this {@link ResponseMessageToolCallFunction} instance. + * + * @param arguments The arguments to call the function with, as generated by the model in JSON + * format. Note that the model does not always generate valid JSON, and may hallucinate + * parameters not defined by your function schema. Validate the arguments in your code + * before calling your function. + * @return The ResponseMessageToolCallFunction instance. + */ + ResponseMessageToolCallFunction arguments(@Nonnull final String arguments); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SearchDocumentKeyValueListPair.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SearchDocumentKeyValueListPair.java index c551210d9..5784c4691 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SearchDocumentKeyValueListPair.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SearchDocumentKeyValueListPair.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SearchSelectOptionEnum.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SearchSelectOptionEnum.java index 4f8bace52..de29d7aef 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SearchSelectOptionEnum.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SearchSelectOptionEnum.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SingleChatMessage.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SingleChatMessage.java new file mode 100644 index 000000000..14399fdc4 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/SingleChatMessage.java @@ -0,0 +1,217 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.48.2 + * + * + * 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.orchestration.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +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; + +/** SingleChatMessage */ +@Beta // CHECKSTYLE:OFF +public class SingleChatMessage implements ChatMessage +// CHECKSTYLE:ON +{ + @JsonProperty("role") + private String role; + + @JsonProperty("content") + private String content; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for SingleChatMessage. */ + protected SingleChatMessage() {} + + /** + * Set the role of this {@link SingleChatMessage} instance and return the same instance. + * + * @param role The role of this {@link SingleChatMessage} + * @return The same instance of this {@link SingleChatMessage} class + */ + @Nonnull + public SingleChatMessage role(@Nonnull final String role) { + this.role = role; + return this; + } + + /** + * Get role + * + * @return role The role of this {@link SingleChatMessage} instance. + */ + @Nonnull + public String getRole() { + return role; + } + + /** + * Set the role of this {@link SingleChatMessage} instance. + * + * @param role The role of this {@link SingleChatMessage} + */ + public void setRole(@Nonnull final String role) { + this.role = role; + } + + /** + * Set the content of this {@link SingleChatMessage} instance and return the same instance. + * + * @param content The content of this {@link SingleChatMessage} + * @return The same instance of this {@link SingleChatMessage} class + */ + @Nonnull + public SingleChatMessage content(@Nonnull final String content) { + this.content = content; + return this; + } + + /** + * Get content + * + * @return content The content of this {@link SingleChatMessage} instance. + */ + @Nonnull + public String getContent() { + return content; + } + + /** + * Set the content of this {@link SingleChatMessage} instance. + * + * @param content The content of this {@link SingleChatMessage} + */ + public void setContent(@Nonnull final String content) { + this.content = content; + } + + /** + * Get the names of the unrecognizable properties of the {@link SingleChatMessage}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link SingleChatMessage} instance. + * + * @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 + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("SingleChatMessage has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link SingleChatMessage} 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 SingleChatMessage singleChatMessage = (SingleChatMessage) o; + return Objects.equals(this.cloudSdkCustomFields, singleChatMessage.cloudSdkCustomFields) + && Objects.equals(this.role, singleChatMessage.role) + && Objects.equals(this.content, singleChatMessage.content); + } + + @Override + public int hashCode() { + return Objects.hash(role, content, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class SingleChatMessage {\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).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 SingleChatMessage} + * instance with all required arguments. + */ + public static Builder create() { + return (role) -> (content) -> new SingleChatMessage().role(role).content(content); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the role of this {@link SingleChatMessage} instance. + * + * @param role The role of this {@link SingleChatMessage} + * @return The SingleChatMessage builder. + */ + Builder1 role(@Nonnull final String role); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the content of this {@link SingleChatMessage} instance. + * + * @param content The content of this {@link SingleChatMessage} + * @return The SingleChatMessage instance. + */ + SingleChatMessage content(@Nonnull final String content); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/Template.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/Template.java index 21f436ad4..da4c12b96 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/Template.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/Template.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,6 +19,7 @@ import com.google.common.annotations.Beta; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -34,10 +35,16 @@ public class Template implements TemplatingModuleConfig // CHECKSTYLE:ON { @JsonProperty("template") - private List template; + private List template; @JsonProperty("defaults") - private Object defaults; + private Map defaults = new HashMap<>(); + + @JsonProperty("response_format") + private TemplateResponseFormat responseFormat; + + @JsonProperty("tools") + private List tools = new ArrayList<>(); @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -54,7 +61,7 @@ protected Template() {} * @return The same instance of this {@link Template} class */ @Nonnull - public Template template(@Nonnull final List template) { + public Template template(@Nonnull final List template) { this.template = template; return this; } @@ -66,7 +73,7 @@ public Template template(@Nonnull final List template) { * @return The same instance of type {@link Template} */ @Nonnull - public Template addTemplateItem(@Nonnull final ChatMessagesInner templateItem) { + public Template addTemplateItem(@Nonnull final ChatMessage templateItem) { if (this.template == null) { this.template = new ArrayList<>(); } @@ -81,7 +88,7 @@ public Template addTemplateItem(@Nonnull final ChatMessagesInner templateItem) { * @return template The template of this {@link Template} instance. */ @Nonnull - public List getTemplate() { + public List getTemplate() { return template; } @@ -92,7 +99,7 @@ public List getTemplate() { * and content can be templated. If messages_history is provided, the templated messages will * be appended. */ - public void setTemplate(@Nonnull final List template) { + public void setTemplate(@Nonnull final List template) { this.template = template; } @@ -104,18 +111,34 @@ public void setTemplate(@Nonnull final List template) { * @return The same instance of this {@link Template} class */ @Nonnull - public Template defaults(@Nullable final Object defaults) { + public Template defaults(@Nullable final Map defaults) { this.defaults = defaults; return this; } + /** + * Put one defaults instance to this {@link Template} instance. + * + * @param key The String key of this defaults instance + * @param defaultsItem The defaults that should be added under the given key + * @return The same instance of type {@link Template} + */ + @Nonnull + public Template putdefaultsItem(@Nonnull final String key, @Nonnull final String defaultsItem) { + if (this.defaults == null) { + this.defaults = new HashMap<>(); + } + this.defaults.put(key, defaultsItem); + return this; + } + /** * Optional default values for the template. If a parameter has no default it is required. * * @return defaults The defaults of this {@link Template} instance. */ @Nonnull - public Object getDefaults() { + public Map getDefaults() { return defaults; } @@ -125,10 +148,90 @@ public Object getDefaults() { * @param defaults Optional default values for the template. If a parameter has no default it is * required. */ - public void setDefaults(@Nullable final Object defaults) { + public void setDefaults(@Nullable final Map defaults) { this.defaults = defaults; } + /** + * Set the responseFormat of this {@link Template} instance and return the same instance. + * + * @param responseFormat The responseFormat of this {@link Template} + * @return The same instance of this {@link Template} class + */ + @Nonnull + public Template responseFormat(@Nullable final TemplateResponseFormat responseFormat) { + this.responseFormat = responseFormat; + return this; + } + + /** + * Get responseFormat + * + * @return responseFormat The responseFormat of this {@link Template} instance. + */ + @Nonnull + public TemplateResponseFormat getResponseFormat() { + return responseFormat; + } + + /** + * Set the responseFormat of this {@link Template} instance. + * + * @param responseFormat The responseFormat of this {@link Template} + */ + public void setResponseFormat(@Nullable final TemplateResponseFormat responseFormat) { + this.responseFormat = responseFormat; + } + + /** + * Set the tools of this {@link Template} instance and return the same instance. + * + * @param tools A list of tools the model may call. Used to provide a list of functions the model + * may generate JSON inputs for. This is the same as the OpenAI definition. + * @return The same instance of this {@link Template} class + */ + @Nonnull + public Template tools(@Nullable final List tools) { + this.tools = tools; + return this; + } + + /** + * Add one tools instance to this {@link Template}. + * + * @param toolsItem The tools that should be added + * @return The same instance of type {@link Template} + */ + @Nonnull + public Template addToolsItem(@Nonnull final ChatCompletionTool toolsItem) { + if (this.tools == null) { + this.tools = new ArrayList<>(); + } + this.tools.add(toolsItem); + return this; + } + + /** + * A list of tools the model may call. Used to provide a list of functions the model may generate + * JSON inputs for. This is the same as the OpenAI definition. + * + * @return tools The tools of this {@link Template} instance. + */ + @Nonnull + public List getTools() { + return tools; + } + + /** + * Set the tools of this {@link Template} instance. + * + * @param tools A list of tools the model may call. Used to provide a list of functions the model + * may generate JSON inputs for. This is the same as the OpenAI definition. + */ + public void setTools(@Nullable final List tools) { + this.tools = tools; + } + /** * Get the names of the unrecognizable properties of the {@link Template}. * @@ -178,12 +281,14 @@ public boolean equals(@Nullable final java.lang.Object o) { final Template template = (Template) o; return Objects.equals(this.cloudSdkCustomFields, template.cloudSdkCustomFields) && Objects.equals(this.template, template.template) - && Objects.equals(this.defaults, template.defaults); + && Objects.equals(this.defaults, template.defaults) + && Objects.equals(this.responseFormat, template.responseFormat) + && Objects.equals(this.tools, template.tools); } @Override public int hashCode() { - return Objects.hash(template, defaults, cloudSdkCustomFields); + return Objects.hash(template, defaults, responseFormat, tools, cloudSdkCustomFields); } @Override @@ -193,6 +298,8 @@ public String toString() { sb.append("class Template {\n"); sb.append(" template: ").append(toIndentedString(template)).append("\n"); sb.append(" defaults: ").append(toIndentedString(defaults)).append("\n"); + sb.append(" responseFormat: ").append(toIndentedString(responseFormat)).append("\n"); + sb.append(" tools: ").append(toIndentedString(tools)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); @@ -228,7 +335,7 @@ public interface Builder { * will be appended. * @return The Template instance. */ - Template template(@Nonnull final List template); + Template template(@Nonnull final List template); /** * Set the template of this {@link Template} instance. @@ -238,7 +345,7 @@ public interface Builder { * will be appended. * @return The Template instance. */ - default Template template(@Nonnull final ChatMessagesInner... template) { + default Template template(@Nonnull final ChatMessage... template) { return template(Arrays.asList(template)); } } diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRef.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRef.java index 62e44c1e1..2d17b2eaa 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRef.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRef.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefByID.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefByID.java index b144a2098..56c9c9e02 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefByID.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefByID.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefByScenarioNameVersion.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefByScenarioNameVersion.java index cc66e39c3..fd84acfe4 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefByScenarioNameVersion.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateRefByScenarioNameVersion.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 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 1f902c3fe..f133b75d5 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 @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatMessagesInner.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateResponseFormat.java similarity index 65% rename from orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatMessagesInner.java rename to orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateResponseFormat.java index e7a3be24c..d37f43763 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ChatMessagesInner.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TemplateResponseFormat.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -15,10 +15,15 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -/** ChatMessagesInner */ +/** + * Response format that the model output should adhere to. This is the same as the OpenAI + * definition. Compatible with GPT-4o, GPT-4o mini, GPT-4 (Turbo) and all GPT-3.5 Turbo models newer + * than gpt-3.5-turbo-1106. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) @JsonSubTypes({ - @JsonSubTypes.Type(value = ChatMessage.class), - @JsonSubTypes.Type(value = MultiChatMessage.class), + @JsonSubTypes.Type(value = ResponseFormatJsonObject.class), + @JsonSubTypes.Type(value = ResponseFormatJsonSchema.class), + @JsonSubTypes.Type(value = ResponseFormatText.class), }) -public interface ChatMessagesInner {} +public interface TemplateResponseFormat {} 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 1296e753c..a73ea718b 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 @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TextContent.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TextContent.java index f6edfae34..a19f9761a 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TextContent.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TextContent.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TokenUsage.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TokenUsage.java index 8bdd9d209..aebb1a2d2 100644 --- a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TokenUsage.java +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/TokenUsage.java @@ -2,7 +2,7 @@ * Orchestration * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. * - * The version of the OpenAPI document: 0.43.0 + * The version of the OpenAPI document: 0.48.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ToolCallChunk.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ToolCallChunk.java new file mode 100644 index 000000000..8990d4e70 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ToolCallChunk.java @@ -0,0 +1,334 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.48.2 + * + * + * 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.orchestration.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 com.google.common.annotations.Beta; +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; + +/** ToolCallChunk */ +@Beta // CHECKSTYLE:OFF +public class ToolCallChunk +// CHECKSTYLE:ON +{ + @JsonProperty("index") + private Integer index; + + @JsonProperty("id") + private String id; + + /** The type of the tool. Currently, only `function` is supported. */ + public enum TypeEnum { + /** The FUNCTION option of this ToolCallChunk */ + FUNCTION("function"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this ToolCallChunk */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(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 ToolCallChunk + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("function") + private ToolCallChunkFunction function; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ToolCallChunk. */ + protected ToolCallChunk() {} + + /** + * Set the index of this {@link ToolCallChunk} instance and return the same instance. + * + * @param index The index of this {@link ToolCallChunk} + * @return The same instance of this {@link ToolCallChunk} class + */ + @Nonnull + public ToolCallChunk index(@Nonnull final Integer index) { + this.index = index; + return this; + } + + /** + * Get index + * + * @return index The index of this {@link ToolCallChunk} instance. + */ + @Nonnull + public Integer getIndex() { + return index; + } + + /** + * Set the index of this {@link ToolCallChunk} instance. + * + * @param index The index of this {@link ToolCallChunk} + */ + public void setIndex(@Nonnull final Integer index) { + this.index = index; + } + + /** + * Set the id of this {@link ToolCallChunk} instance and return the same instance. + * + * @param id The ID of the tool call. + * @return The same instance of this {@link ToolCallChunk} class + */ + @Nonnull + public ToolCallChunk id(@Nullable final String id) { + this.id = id; + return this; + } + + /** + * The ID of the tool call. + * + * @return id The id of this {@link ToolCallChunk} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link ToolCallChunk} instance. + * + * @param id The ID of the tool call. + */ + public void setId(@Nullable final String id) { + this.id = id; + } + + /** + * Set the type of this {@link ToolCallChunk} instance and return the same instance. + * + * @param type The type of the tool. Currently, only `function` is supported. + * @return The same instance of this {@link ToolCallChunk} class + */ + @Nonnull + public ToolCallChunk type(@Nullable final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the tool. Currently, only `function` is supported. + * + * @return type The type of this {@link ToolCallChunk} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link ToolCallChunk} instance. + * + * @param type The type of the tool. Currently, only `function` is supported. + */ + public void setType(@Nullable final TypeEnum type) { + this.type = type; + } + + /** + * Set the function of this {@link ToolCallChunk} instance and return the same instance. + * + * @param function The function of this {@link ToolCallChunk} + * @return The same instance of this {@link ToolCallChunk} class + */ + @Nonnull + public ToolCallChunk function(@Nullable final ToolCallChunkFunction function) { + this.function = function; + return this; + } + + /** + * Get function + * + * @return function The function of this {@link ToolCallChunk} instance. + */ + @Nonnull + public ToolCallChunkFunction getFunction() { + return function; + } + + /** + * Set the function of this {@link ToolCallChunk} instance. + * + * @param function The function of this {@link ToolCallChunk} + */ + public void setFunction(@Nullable final ToolCallChunkFunction function) { + this.function = function; + } + + /** + * Get the names of the unrecognizable properties of the {@link ToolCallChunk}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ToolCallChunk} instance. + * + * @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 + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("ToolCallChunk has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link ToolCallChunk} 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 ToolCallChunk toolCallChunk = (ToolCallChunk) o; + return Objects.equals(this.cloudSdkCustomFields, toolCallChunk.cloudSdkCustomFields) + && Objects.equals(this.index, toolCallChunk.index) + && Objects.equals(this.id, toolCallChunk.id) + && Objects.equals(this.type, toolCallChunk.type) + && Objects.equals(this.function, toolCallChunk.function); + } + + @Override + public int hashCode() { + return Objects.hash(index, id, type, function, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ToolCallChunk {\n"); + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" function: ").append(toIndentedString(function)).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 ToolCallChunk} instance + * with all required arguments. + */ + public static Builder create() { + return (index) -> new ToolCallChunk().index(index); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the index of this {@link ToolCallChunk} instance. + * + * @param index The index of this {@link ToolCallChunk} + * @return The ToolCallChunk instance. + */ + ToolCallChunk index(@Nonnull final Integer index); + } +} diff --git a/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ToolCallChunkFunction.java b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ToolCallChunkFunction.java new file mode 100644 index 000000000..b60242800 --- /dev/null +++ b/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model/ToolCallChunkFunction.java @@ -0,0 +1,201 @@ +/* + * Orchestration + * Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. + * + * The version of the OpenAPI document: 0.48.2 + * + * + * 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.orchestration.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.annotations.Beta; +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; + +/** ToolCallChunkFunction */ +@Beta // CHECKSTYLE:OFF +public class ToolCallChunkFunction +// CHECKSTYLE:ON +{ + @JsonProperty("name") + private String name; + + @JsonProperty("arguments") + private String arguments; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for ToolCallChunkFunction. */ + protected ToolCallChunkFunction() {} + + /** + * Set the name of this {@link ToolCallChunkFunction} instance and return the same instance. + * + * @param name The name of the function to call. + * @return The same instance of this {@link ToolCallChunkFunction} class + */ + @Nonnull + public ToolCallChunkFunction name(@Nullable final String name) { + this.name = name; + return this; + } + + /** + * The name of the function to call. + * + * @return name The name of this {@link ToolCallChunkFunction} instance. + */ + @Nonnull + public String getName() { + return name; + } + + /** + * Set the name of this {@link ToolCallChunkFunction} instance. + * + * @param name The name of the function to call. + */ + public void setName(@Nullable final String name) { + this.name = name; + } + + /** + * Set the arguments of this {@link ToolCallChunkFunction} instance and return the same instance. + * + * @param arguments The arguments to call the function with, as generated by the model in JSON + * format. Note that the model does not always generate valid JSON, and may hallucinate + * parameters not defined by your function schema. Validate the arguments in your code before + * calling your function. + * @return The same instance of this {@link ToolCallChunkFunction} class + */ + @Nonnull + public ToolCallChunkFunction arguments(@Nullable final String arguments) { + this.arguments = arguments; + return this; + } + + /** + * The arguments to call the function with, as generated by the model in JSON format. Note that + * the model does not always generate valid JSON, and may hallucinate parameters not defined by + * your function schema. Validate the arguments in your code before calling your function. + * + * @return arguments The arguments of this {@link ToolCallChunkFunction} instance. + */ + @Nonnull + public String getArguments() { + return arguments; + } + + /** + * Set the arguments of this {@link ToolCallChunkFunction} instance. + * + * @param arguments The arguments to call the function with, as generated by the model in JSON + * format. Note that the model does not always generate valid JSON, and may hallucinate + * parameters not defined by your function schema. Validate the arguments in your code before + * calling your function. + */ + public void setArguments(@Nullable final String arguments) { + this.arguments = arguments; + } + + /** + * Get the names of the unrecognizable properties of the {@link ToolCallChunkFunction}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link ToolCallChunkFunction} instance. + * + * @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 + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "ToolCallChunkFunction has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Set an unrecognizable property of this {@link ToolCallChunkFunction} 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 ToolCallChunkFunction toolCallChunkFunction = (ToolCallChunkFunction) o; + return Objects.equals(this.cloudSdkCustomFields, toolCallChunkFunction.cloudSdkCustomFields) + && Objects.equals(this.name, toolCallChunkFunction.name) + && Objects.equals(this.arguments, toolCallChunkFunction.arguments); + } + + @Override + public int hashCode() { + return Objects.hash(name, arguments, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class ToolCallChunkFunction {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" arguments: ").append(toIndentedString(arguments)).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 new {@link ToolCallChunkFunction} instance. No arguments are required. */ + public static ToolCallChunkFunction create() { + return new ToolCallChunkFunction(); + } +} diff --git a/orchestration/src/main/resources/spec/orchestration.yaml b/orchestration/src/main/resources/spec/orchestration.yaml index 9359b25ae..61d381142 100644 --- a/orchestration/src/main/resources/spec/orchestration.yaml +++ b/orchestration/src/main/resources/spec/orchestration.yaml @@ -1,41 +1,25 @@ openapi: 3.0.0 + info: title: Orchestration description: Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services. - version: 0.43.0 -x-sap-shortText: Enhance content generation with additional capabilities for business AI scenarios. + contact: + name: SAP AI Core + version: 0.48.2 + servers: -- url: https://api.ai.{region}.ml.hana.ondemand.com/v2/inference/deployments/{orchestration_deployment_id} - 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 -security: -- Oauth2: [] + - url: "/v1" + tags: - - name: Orchestrated Completion + - name: OrchestrationCompletion description: Run an orchestrated completion inference request + paths: /completion: post: tags: - - Orchestrated Completion + - OrchestrationCompletion + description: Run an orchestrated completion inference request operationId: orchestration.v1.endpoints.create requestBody: required: true @@ -44,13 +28,13 @@ paths: schema: $ref: "#/components/schemas/CompletionPostRequest" responses: - '200': + "200": description: "Successful response" content: application/json: schema: $ref: "#/components/schemas/CompletionPostResponse" - '400': + "400": $ref: "#/components/responses/BadRequest" default: $ref: "#/components/responses/CommonError" @@ -77,22 +61,23 @@ components: - $ref: "#/components/schemas/ChatMessages" description: History of chat messages. Can be used to provide system and assistant messages to set the context of the conversation. Will be merged with the template message + ChatMessage: + oneOf: + - $ref: "#/components/schemas/SingleChatMessage" + - $ref: "#/components/schemas/MultiChatMessage" + ChatMessages: type: array items: - oneOf: - - $ref: "#/components/schemas/ChatMessage" - - $ref: "#/components/schemas/MultiChatMessage" + $ref: "#/components/schemas/ChatMessage" TemplatingChatMessage: type: array minItems: 1 items: - oneOf: - - $ref: "#/components/schemas/ChatMessage" - - $ref: "#/components/schemas/MultiChatMessage" + $ref: "#/components/schemas/ChatMessage" - ChatMessage: + SingleChatMessage: type: object required: - role @@ -105,11 +90,63 @@ components: content: type: string + ResponseChatMessage: + allOf: + - $ref: "#/components/schemas/SingleChatMessage" + - type: object + additionalProperties: false + properties: + refusal: + type: string + example: "I'm sorry, I can't answer that question." + tool_calls: + $ref: "#/components/schemas/ResponseMessageToolCalls" + # below tool message definitions are copied from openai spec: https://github.com/openai/openai-openapi/blob/e0cb2d721753e13e69e918465795d6e9f87ab15a/openapi.yaml#L11007 + # only renaming them to differentiate them from the openai python classes + ResponseMessageToolCalls: + type: array + description: The tool calls generated by the model, such as function calls. + items: + $ref: "#/components/schemas/ResponseMessageToolCall" + ResponseMessageToolCall: + type: object + properties: + id: + type: string + description: The ID of the tool call. + type: + type: string + enum: + - function + description: The type of the tool. Currently, only `function` is supported. + function: + type: object + description: The function that the model called. + properties: + name: + type: string + description: The name of the function to call. + arguments: + type: string + description: The arguments to call the function with, as generated by the model + in JSON format. Note that the model does not always generate + valid JSON, and may hallucinate parameters not defined by your + function schema. Validate the arguments in your code before + calling your function. + required: + - name + - arguments + required: + - id + - type + - function + MultiChatMessage: type: object required: - role - content + additionalProperties: false properties: role: type: string @@ -117,18 +154,19 @@ components: content: type: array items: - $ref: "#/components/schemas/MultiChatMessageContent" + $ref: "#/components/schemas/MultiChatMessageContent" MultiChatMessageContent: - oneOf: - - $ref: "#/components/schemas/TextContent" - - $ref: "#/components/schemas/ImageContent" + oneOf: + - $ref: "#/components/schemas/TextContent" + - $ref: "#/components/schemas/ImageContent" TextContent: type: object required: - type - text + additionalProperties: false properties: type: type: string @@ -141,6 +179,7 @@ components: required: - type - image_url + additionalProperties: false properties: type: type: string @@ -149,13 +188,14 @@ components: type: object required: - url + additionalProperties: false properties: url: type: string detail: # keep? openai specific type: string default: "auto" - + ChatDelta: type: object required: @@ -166,6 +206,42 @@ components: content: type: string default: "" + refusal: + type: string + description: The refusal message generated by the model. + tool_calls: + type: array + items: + $ref: "#/components/schemas/ToolCallChunk" + # taken from: https://github.com/openai/openai-openapi/blob/e0cb2d721753e13e69e918465795d6e9f87ab15a/openapi.yaml#L10979C27-L10979C40 + ToolCallChunk: + type: object + properties: + index: + type: integer + id: + type: string + description: The ID of the tool call. + type: + type: string + enum: + - function + description: The type of the tool. Currently, only `function` is supported. + function: + type: object + properties: + name: + type: string + description: The name of the function to call. + arguments: + type: string + description: The arguments to call the function with, as generated by the model + in JSON format. Note that the model does not always generate + valid JSON, and may hallucinate parameters not defined by your + function schema. Validate the arguments in your code before + calling your function. + required: + - index CompletionPostResponse: type: object @@ -270,14 +346,13 @@ components: type: object required: - model_name - - model_params additionalProperties: false properties: model_name: description: Model name as in LLM Access configuration example: "gpt-4" type: string - model_params: + model_params: # optional, default values are used for mandatory model parameters description: Model parameters type: object example: @@ -286,6 +361,7 @@ components: frequency_penalty: 0 presence_penalty: 0 n: 2 + additionalProperties: true model_version: description: Version of the model to use type: string @@ -395,7 +471,7 @@ components: description: Index of the choice example: 0 message: - $ref: "#/components/schemas/ChatMessage" + $ref: "#/components/schemas/ResponseChatMessage" logprobs: type: object description: Log probabilities @@ -459,6 +535,8 @@ components: - $ref: "#/components/schemas/TemplateRef" # --- Templating Module with User Defined Template --- + # response_format api definition taken from: https://github.com/openai/openai-openapi/blob/e0cb2d721753e13e69e918465795d6e9f87ab15a/openapi.yaml#L12286 + # tools api definition taken from: https://github.com/openai/openai-openapi/blob/e0cb2d721753e13e69e918465795d6e9f87ab15a/openapi.yaml#L12406 Template: type: object required: @@ -472,6 +550,25 @@ components: defaults: description: Optional default values for the template. If a parameter has no default it is required. type: object + additionalProperties: + type: string + response_format: + description: > + Response format that the model output should adhere to. + This is the same as the OpenAI definition. + + Compatible with GPT-4o, GPT-4o mini, GPT-4 (Turbo) and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106. + oneOf: + - $ref: "#/components/schemas/ResponseFormatText" + - $ref: "#/components/schemas/ResponseFormatJsonObject" + - $ref: "#/components/schemas/ResponseFormatJsonSchema" + tools: + type: array + description: > + A list of tools the model may call. Used to provide a list of functions the model may generate JSON inputs for. + This is the same as the OpenAI definition. + items: + $ref: "#/components/schemas/ChatCompletionTool" example: template: - role: user @@ -479,6 +576,123 @@ components: defaults: inputContext: The default text that will be used in the template if inputContext is not set + # below ReponseFormats are copied from openapi spec: https://github.com/openai/openai-openapi/blob/e0cb2d721753e13e69e918465795d6e9f87ab15a/openapi.yaml#L12286 + ResponseFormatText: + type: object + additionalProperties: false + properties: + type: + type: string + description: "The type of response format being defined: `text`" + enum: + - text + required: + - type + ResponseFormatJsonObject: + type: object + additionalProperties: false + properties: + type: + type: string + description: "The type of response format being defined: `json_object`" + enum: + - json_object + required: + - type + ResponseFormatJsonSchema: + type: object + additionalProperties: false + properties: + type: + type: string + description: "The type of response format being defined: `json_schema`" + enum: + - json_schema + json_schema: + type: object + additionalProperties: false + properties: + description: + type: string + description: A description of what the response format is for, used by the model + to determine how to respond in the format. + name: + type: string + description: The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. + schema: + $ref: "#/components/schemas/ResponseFormatJsonSchemaSchema" + strict: + type: boolean + nullable: true + default: false + description: Whether to enable strict schema adherence when generating the + output. If set to true, the model will always follow the exact + schema defined in the `schema` field. Only a subset of JSON + Schema is supported when `strict` is `true`. To learn more, read + the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + required: + - name + required: + - type + - json_schema + ResponseFormatJsonSchemaSchema: + type: object + description: The schema for the response format, described as a JSON Schema object. + additionalProperties: true + + # below tool-related definitions are copied from openai spec: https://github.com/openai/openai-openapi/blob/e0cb2d721753e13e69e918465795d6e9f87ab15a/openapi.yaml#L11547 + ChatCompletionTool: + type: object + additionalProperties: false + properties: + type: + type: string + enum: + - function + description: The type of the tool. Currently, only `function` is supported. + function: + $ref: "#/components/schemas/FunctionObject" + required: + - type + - function + FunctionObject: + type: object + additionalProperties: false + properties: + description: + type: string + description: A description of what the function does, used by the model to + choose when and how to call the function. + name: + type: string + description: The name of the function to be called. Must be a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64. + parameters: + $ref: "#/components/schemas/FunctionParameters" + strict: + type: boolean + nullable: true + default: false + description: Whether to enable strict schema adherence when generating the + function call. If set to true, the model will follow the exact + schema defined in the `parameters` field. Only a subset of JSON + Schema is supported when `strict` is `true`. Learn more about + Structured Outputs in the [function calling + guide](docs/guides/function-calling). + required: + - name + FunctionParameters: + type: object + description: >- + The parameters the functions accepts, described as a JSON Schema object. + See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the + [JSON Schema + reference](https://json-schema.org/understanding-json-schema/) for + documentation about the format. + Omitting `parameters` defines a function with an empty parameter list. + additionalProperties: true + # --- Templating Module with reference to Prompt Registry --- TemplateRef: type: object @@ -487,7 +701,6 @@ components: additionalProperties: false properties: template_ref: - type: object description: Reference to a template in the prompt registry by ID or by scenario, name and version oneOf: - $ref: "#/components/schemas/TemplateRefByID" @@ -583,6 +796,7 @@ components: FilterConfig: oneOf: - $ref: "#/components/schemas/AzureContentSafetyFilterConfig" + - $ref: "#/components/schemas/LlamaGuard38bFilterConfig" AzureContentSafetyFilterConfig: type: object @@ -591,7 +805,7 @@ components: additionalProperties: false properties: type: - description: String represents name of the filter provider + description: Name of the filter provider type type: string enum: - azure_content_safety @@ -604,13 +818,13 @@ components: type: object additionalProperties: false properties: - "Hate": + Hate: $ref: "#/components/schemas/AzureThreshold" - "SelfHarm": + SelfHarm: $ref: "#/components/schemas/AzureThreshold" - "Sexual": + Sexual: $ref: "#/components/schemas/AzureThreshold" - "Violence": + Violence: $ref: "#/components/schemas/AzureThreshold" AzureThreshold: @@ -622,6 +836,56 @@ components: - 6 example: 0 + LlamaGuard38bFilterConfig: + type: object + required: + - type + - config + properties: + type: + description: Name of the filter provider type + type: string + enum: + - llama_guard_3_8b + example: llama_guard_3_8b + config: + $ref: "#/components/schemas/LlamaGuard38b" + + LlamaGuard38b: + description: Filter configuration for Llama Guard 3 8B + type: object + additionalProperties: false + minProperties: 1 + properties: + violent_crimes: + type: boolean + non_violent_crimes: + type: boolean + sex_crimes: + type: boolean + child_exploitation: + type: boolean + defamation: + type: boolean + specialized_advice: + type: boolean + privacy: + type: boolean + intellectual_property: + type: boolean + indiscriminate_weapons: + type: boolean + hate: + type: boolean + self_harm: + type: boolean + sexual_content: + type: boolean + elections: + type: boolean + code_interpreter_abuse: + type: boolean + # --- Masking module --- MaskingModuleConfig: @@ -674,6 +938,7 @@ components: type: string mask_grounding_input: type: object + additionalProperties: false properties: enabled: type: boolean @@ -781,9 +1046,7 @@ components: default: - "*" data_repository_type: - type: string $ref: "#/components/schemas/DataRepositoryType" - description: Only include DataRepositories with the given type. data_repository_metadata: type: array items: @@ -808,18 +1071,15 @@ components: title: Id description: Identifier of this SearchFilter - unique per request. GroundingFilterSearchConfiguration: - nullable: true additionalProperties: false properties: max_chunk_count: - nullable: true type: integer minimum: 0 exclusiveMinimum: true title: Maxchunkcount description: Maximum number of chunks to be returned. Cannot be used with 'maxDocumentCount'. max_document_count: - nullable: true type: integer minimum: 0 exclusiveMinimum: true @@ -831,9 +1091,11 @@ components: DataRepositoryType: type: string + description: Only include DataRepositories with the given type. anyOf: - enum: - vector + - help.sap.com - {} title: DataRepositoryType KeyValueListPair: diff --git a/orchestration/src/test/java/com/sap/ai/sdk/orchestration/OrchestrationUnitTest.java b/orchestration/src/test/java/com/sap/ai/sdk/orchestration/OrchestrationUnitTest.java index 2adca1dc5..8a5f419fc 100644 --- a/orchestration/src/test/java/com/sap/ai/sdk/orchestration/OrchestrationUnitTest.java +++ b/orchestration/src/test/java/com/sap/ai/sdk/orchestration/OrchestrationUnitTest.java @@ -37,7 +37,6 @@ import com.github.tomakehurst.wiremock.junit5.WireMockTest; import com.github.tomakehurst.wiremock.stubbing.Scenario; import com.sap.ai.sdk.orchestration.model.ChatMessage; -import com.sap.ai.sdk.orchestration.model.ChatMessagesInner; import com.sap.ai.sdk.orchestration.model.CompletionPostRequest; import com.sap.ai.sdk.orchestration.model.CompletionPostResponse; import com.sap.ai.sdk.orchestration.model.DPIEntities; @@ -53,11 +52,14 @@ import com.sap.ai.sdk.orchestration.model.LLMModuleConfig; import com.sap.ai.sdk.orchestration.model.LLMModuleResult; import com.sap.ai.sdk.orchestration.model.LLMModuleResultSynchronous; +import com.sap.ai.sdk.orchestration.model.LlamaGuard38b; +import com.sap.ai.sdk.orchestration.model.LlamaGuard38bFilterConfig; import com.sap.ai.sdk.orchestration.model.ModuleConfigs; import com.sap.ai.sdk.orchestration.model.MultiChatMessage; import com.sap.ai.sdk.orchestration.model.OrchestrationConfig; import com.sap.ai.sdk.orchestration.model.SearchDocumentKeyValueListPair; import com.sap.ai.sdk.orchestration.model.SearchSelectOptionEnum; +import com.sap.ai.sdk.orchestration.model.SingleChatMessage; import com.sap.ai.sdk.orchestration.model.Template; import com.sap.ai.sdk.orchestration.model.TextContent; import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; @@ -300,14 +302,22 @@ void filteringLoose() throws IOException { .withBodyFile("filteringLooseResponse.json") .withHeader("Content-Type", "application/json"))); - final var filter = + final var azureFilter = new AzureContentFilter() .hate(ALLOW_SAFE_LOW_MEDIUM) .selfHarm(ALLOW_SAFE_LOW_MEDIUM) .sexual(ALLOW_SAFE_LOW_MEDIUM) .violence(ALLOW_SAFE_LOW_MEDIUM); - client.chatCompletion(prompt, config.withInputFiltering(filter).withOutputFiltering(filter)); + final ContentFilter llamaFilter = + () -> + LlamaGuard38bFilterConfig.create() + .type(LlamaGuard38bFilterConfig.TypeEnum.LLAMA_GUARD_3_8B) + .config(LlamaGuard38b.create().selfHarm(true)); + + client.chatCompletion( + prompt, + config.withInputFiltering(azureFilter, llamaFilter).withOutputFiltering(azureFilter)); // the result is asserted in the verify step below // verify that null fields are absent from the sent request @@ -645,7 +655,7 @@ void streamChatCompletionDeltas() throws IOException { final var templating = deltaList.get(0).getModuleResults().getTemplating(); assertThat(templating).hasSize(1); - final var templateItem = (ChatMessage) templating.get(0); + final var templateItem = (SingleChatMessage) templating.get(0); assertThat(templateItem.getRole()).isEqualTo("user"); assertThat(templateItem.getContent()) .isEqualTo("Hello world! Why is this phrase so famous?"); @@ -797,10 +807,9 @@ void testOrchestrationChatResponseWithMultiChatMessage() { module.addDeserializer( LLMModuleResult.class, PolymorphicFallbackDeserializer.fromJsonSubTypes(LLMModuleResult.class)); - module.setMixInAnnotation(ChatMessagesInner.class, JacksonMixins.NoneTypeInfoMixin.class); + module.setMixInAnnotation(ChatMessage.class, JacksonMixins.NoneTypeInfoMixin.class); module.addDeserializer( - ChatMessagesInner.class, - PolymorphicFallbackDeserializer.fromJsonSubTypes(ChatMessagesInner.class)); + ChatMessage.class, PolymorphicFallbackDeserializer.fromJsonSubTypes(ChatMessage.class)); var orchestrationChatResponse = new OrchestrationChatResponse( diff --git a/orchestration/src/test/java/com/sap/ai/sdk/orchestration/spring/OrchestrationChatResponseTest.java b/orchestration/src/test/java/com/sap/ai/sdk/orchestration/spring/OrchestrationChatResponseTest.java index 5c2e10d82..c2d6b859c 100644 --- a/orchestration/src/test/java/com/sap/ai/sdk/orchestration/spring/OrchestrationChatResponseTest.java +++ b/orchestration/src/test/java/com/sap/ai/sdk/orchestration/spring/OrchestrationChatResponseTest.java @@ -2,9 +2,9 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.sap.ai.sdk.orchestration.model.ChatMessage; import com.sap.ai.sdk.orchestration.model.LLMChoice; import com.sap.ai.sdk.orchestration.model.LLMModuleResultSynchronous; +import com.sap.ai.sdk.orchestration.model.ResponseChatMessage; import com.sap.ai.sdk.orchestration.model.TokenUsage; import java.util.List; import org.junit.jupiter.api.Test; @@ -17,7 +17,7 @@ void testToAssistantMessage() { var choice = LLMChoice.create() .index(0) - .message(ChatMessage.create().role("assistant").content("Hello, world!")) + .message(ResponseChatMessage.create().role("assistant").content("Hello, world!")) .finishReason("stop"); AssistantMessage message = OrchestrationSpringChatResponse.toAssistantMessage(choice); diff --git a/orchestration/src/test/resources/filteringLooseRequest.json b/orchestration/src/test/resources/filteringLooseRequest.json index 8b350d94f..026a67395 100644 --- a/orchestration/src/test/resources/filteringLooseRequest.json +++ b/orchestration/src/test/resources/filteringLooseRequest.json @@ -19,7 +19,9 @@ "role": "user", "content": "Hello World! Why is this phrase so famous?" } - ] + ], + "defaults" : { }, + "tools" : [ ] }, "filtering_module_config": { "input": { @@ -32,6 +34,12 @@ "Sexual": 4, "Violence": 4 } + }, + { + "type": "llama_guard_3_8b", + "config": { + "self_harm": true + } } ] }, diff --git a/orchestration/src/test/resources/groundingRequest.json b/orchestration/src/test/resources/groundingRequest.json index 7e28c1bb7..fc880901a 100644 --- a/orchestration/src/test/resources/groundingRequest.json +++ b/orchestration/src/test/resources/groundingRequest.json @@ -17,7 +17,9 @@ "template" : [ { "role" : "system", "content" : "Context message with embedded grounding results. {{?results}}" - } ] + } ], + "defaults" : { }, + "tools" : [ ] }, "grounding_module_config" : { "type" : "document_grounding_service", diff --git a/orchestration/src/test/resources/maskingRequest.json b/orchestration/src/test/resources/maskingRequest.json index f6356d6bd..fb20aacfc 100644 --- a/orchestration/src/test/resources/maskingRequest.json +++ b/orchestration/src/test/resources/maskingRequest.json @@ -19,7 +19,9 @@ "role": "user", "content": "Hello World! Why is this phrase so famous?" } - ] + ], + "defaults" : { }, + "tools" : [ ] }, "masking_module_config": { "masking_providers": [ diff --git a/orchestration/src/test/resources/messagesHistoryRequest.json b/orchestration/src/test/resources/messagesHistoryRequest.json index f42674a2c..20f1787d2 100644 --- a/orchestration/src/test/resources/messagesHistoryRequest.json +++ b/orchestration/src/test/resources/messagesHistoryRequest.json @@ -19,7 +19,9 @@ "role": "user", "content": "What is the typical food there?" } - ] + ], + "defaults" : { }, + "tools" : [ ] } }, "stream": false diff --git a/orchestration/src/test/resources/multiChatMessageRequest.json b/orchestration/src/test/resources/multiChatMessageRequest.json index f7457c596..315ee8cf6 100644 --- a/orchestration/src/test/resources/multiChatMessageRequest.json +++ b/orchestration/src/test/resources/multiChatMessageRequest.json @@ -24,7 +24,9 @@ } ] } - ] + ], + "defaults" : { }, + "tools" : [ ] } }, "stream": false diff --git a/orchestration/src/test/resources/templatingRequest.json b/orchestration/src/test/resources/templatingRequest.json index 090e64f75..ec95d3fd2 100644 --- a/orchestration/src/test/resources/templatingRequest.json +++ b/orchestration/src/test/resources/templatingRequest.json @@ -7,7 +7,9 @@ "role": "user", "content": "{{?input}}" } - ] + ], + "defaults" : { }, + "tools" : [ ] }, "llm_module_config": { "model_name": "gpt-35-turbo-16k",