diff --git a/.pipeline/spotbugs-exclusions.xml b/.pipeline/spotbugs-exclusions.xml index d1366d3b7..819c669fb 100644 --- a/.pipeline/spotbugs-exclusions.xml +++ b/.pipeline/spotbugs-exclusions.xml @@ -7,6 +7,7 @@ + diff --git a/foundation-models/openai/pom.xml b/foundation-models/openai/pom.xml index bb3eb499a..96e7c181d 100644 --- a/foundation-models/openai/pom.xml +++ b/foundation-models/openai/pom.xml @@ -132,4 +132,65 @@ test + + + + generate + + false + + generate + + + + + + com.sap.cloud.sdk.datamodel + openapi-generator-maven-plugin + + ${project.basedir}/src/main/java + beta + true + COMPILE + true + + + + openai + + generate + + generate-sources + + ${project.basedir}/src/main/resources/spec/openapi-2024-10-21.yaml + com.sap.ai.sdk.foundationmodels.openai.generated.api + com.sap.ai.sdk.foundationmodels.openai.generated.model + false + + true + true + true + true + + + /deployments/{deployment-id}/completions + /deployments/{deployment-id}/audio/transcriptions + /deployments/{deployment-id}/audio/translations + /deployments/{deployment-id}/images/generations + + + chatCompletionResponseMessage.context + createChatCompletionRequest.data_sources + + + true + + + + + + + + + diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionFunctionCall.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionFunctionCall.java index ec2db4692..1ae9f2a00 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionFunctionCall.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionFunctionCall.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -32,8 +28,7 @@ * Deprecated and replaced by `tool_calls`. The name and arguments of a function that * should be called, as generated by the model. */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionFunctionCall // CHECKSTYLE:ON { @@ -132,11 +127,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link ChatCompletionFunctionCall} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -145,6 +142,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionFunctionCall} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (name != null) declaredFields.put("name", name); + if (arguments != null) declaredFields.put("arguments", arguments); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionFunctionCall} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. @@ -158,7 +170,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -194,7 +206,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionFunctionCallOption.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionFunctionCallOption.java index a7504908c..f1dc9874a 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionFunctionCallOption.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionFunctionCallOption.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -32,8 +28,7 @@ * Specifying a particular function via `{\"name\": \"my_function\"}` * forces the model to call that function. */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionFunctionCallOption // CHECKSTYLE:ON { @@ -90,11 +85,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link ChatCompletionFunctionCallOption} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -103,6 +100,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionFunctionCallOption} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (name != null) declaredFields.put("name", name); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionFunctionCallOption} instance. If * the map previously contained a mapping for the key, the old value is replaced by the specified @@ -117,7 +128,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -152,7 +163,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionFunctions.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionFunctions.java index a4a191897..1632e885b 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionFunctions.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionFunctions.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -35,8 +31,7 @@ * @deprecated */ @Deprecated -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionFunctions // CHECKSTYLE:ON { @@ -198,11 +193,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link ChatCompletionFunctions} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -211,6 +208,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionFunctions} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (description != null) declaredFields.put("description", description); + if (name != null) declaredFields.put("name", name); + if (parameters != null) declaredFields.put("parameters", parameters); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionFunctions} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. @@ -224,7 +237,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -261,7 +274,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCall.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCall.java index b04c1817e..d199d601b 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCall.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCall.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** ChatCompletionMessageToolCall */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionMessageToolCall // CHECKSTYLE:ON { @@ -157,11 +152,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link ChatCompletionMessageToolCall} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -170,6 +167,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionMessageToolCall} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (type != null) declaredFields.put("type", type); + if (function != null) declaredFields.put("function", function); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionMessageToolCall} instance. If the * map previously contained a mapping for the key, the old value is replaced by the specified @@ -184,7 +197,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -223,7 +236,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCallChunk.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCallChunk.java index 3482c303c..b005848d6 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCallChunk.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCallChunk.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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; @@ -31,8 +27,7 @@ import javax.annotation.Nullable; /** ChatCompletionMessageToolCallChunk */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionMessageToolCallChunk // CHECKSTYLE:ON { @@ -250,11 +245,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link ChatCompletionMessageToolCallChunk} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -263,6 +260,23 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionMessageToolCallChunk} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (index != null) declaredFields.put("index", index); + if (id != null) declaredFields.put("id", id); + if (type != null) declaredFields.put("type", type); + if (function != null) declaredFields.put("function", function); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionMessageToolCallChunk} instance. If * the map previously contained a mapping for the key, the old value is replaced by the specified @@ -277,7 +291,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -318,7 +332,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCallChunkFunction.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCallChunkFunction.java index cee960b07..cd2ebc2be 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCallChunkFunction.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCallChunkFunction.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** ChatCompletionMessageToolCallChunkFunction */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionMessageToolCallChunkFunction // CHECKSTYLE:ON { @@ -132,11 +127,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * ChatCompletionMessageToolCallChunkFunction} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -145,6 +142,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionMessageToolCallChunkFunction} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (name != null) declaredFields.put("name", name); + if (arguments != null) declaredFields.put("arguments", arguments); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionMessageToolCallChunkFunction} * instance. If the map previously contained a mapping for the key, the old value is replaced by @@ -159,7 +171,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -197,7 +209,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCallFunction.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCallFunction.java index 954e6770d..cfce6d304 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCallFunction.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCallFunction.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** The function that the model called. */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionMessageToolCallFunction // CHECKSTYLE:ON { @@ -131,11 +126,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * ChatCompletionMessageToolCallFunction} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -144,6 +141,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionMessageToolCallFunction} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (name != null) declaredFields.put("name", name); + if (arguments != null) declaredFields.put("arguments", arguments); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionMessageToolCallFunction} instance. * If the map previously contained a mapping for the key, the old value is replaced by the @@ -158,7 +170,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -195,7 +207,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionNamedToolChoice.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionNamedToolChoice.java index 3b3e75876..4aa899a74 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionNamedToolChoice.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionNamedToolChoice.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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; @@ -31,8 +27,7 @@ import javax.annotation.Nullable; /** Specifies a tool the model should use. Use to force the model to call a specific function. */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionNamedToolChoice // CHECKSTYLE:ON { @@ -179,11 +174,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link ChatCompletionNamedToolChoice} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -192,6 +189,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionNamedToolChoice} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (function != null) declaredFields.put("function", function); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionNamedToolChoice} instance. If the * map previously contained a mapping for the key, the old value is replaced by the specified @@ -206,7 +218,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -243,7 +255,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionNamedToolChoiceFunction.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionNamedToolChoiceFunction.java index 2f2424162..594f439ca 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionNamedToolChoiceFunction.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionNamedToolChoiceFunction.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** ChatCompletionNamedToolChoiceFunction */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionNamedToolChoiceFunction // CHECKSTYLE:ON { @@ -88,11 +83,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * ChatCompletionNamedToolChoiceFunction} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -101,6 +98,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionNamedToolChoiceFunction} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (name != null) declaredFields.put("name", name); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionNamedToolChoiceFunction} instance. * If the map previously contained a mapping for the key, the old value is replaced by the @@ -115,7 +126,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -150,7 +161,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestAssistantMessage.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestAssistantMessage.java index 8b7b40daf..b1a3d46c8 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestAssistantMessage.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestAssistantMessage.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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.ArrayList; import java.util.LinkedHashMap; import java.util.List; @@ -33,8 +29,7 @@ import javax.annotation.Nullable; /** ChatCompletionRequestAssistantMessage */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionRequestAssistantMessage implements ChatCompletionRequestMessage // CHECKSTYLE:ON { @@ -347,11 +342,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * ChatCompletionRequestAssistantMessage} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -360,6 +357,25 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionRequestAssistantMessage} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (content != null) declaredFields.put("content", content); + if (refusal != null) declaredFields.put("refusal", refusal); + if (role != null) declaredFields.put("role", role); + if (name != null) declaredFields.put("name", name); + if (toolCalls != null) declaredFields.put("toolCalls", toolCalls); + if (functionCall != null) declaredFields.put("functionCall", functionCall); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionRequestAssistantMessage} instance. * If the map previously contained a mapping for the key, the old value is replaced by the @@ -374,7 +390,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -420,7 +436,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestAssistantMessageContent.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestAssistantMessageContent.java index 5775026b7..1aa52e914 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestAssistantMessageContent.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestAssistantMessageContent.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -16,19 +11,21 @@ package com.sap.ai.sdk.foundationmodels.openai.generated.model; +import com.google.common.annotations.Beta; import java.util.List; +import javax.annotation.Nonnull; /** * The contents of the assistant message. Required unless `tool_calls` or * `function_call` is specified. */ -@com.google.common.annotations.Beta +@Beta public interface ChatCompletionRequestAssistantMessageContent { /** * Helper class to create a String that implements {@link * ChatCompletionRequestAssistantMessageContent}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue String value) + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements ChatCompletionRequestAssistantMessageContent {} /** @@ -38,7 +35,8 @@ record InnerString(@com.fasterxml.jackson.annotation.JsonValue String value) * @return a new instance of {@link InnerString}. */ @com.fasterxml.jackson.annotation.JsonCreator - static InnerString create(String val) { + @Nonnull + static InnerString create(@Nonnull final String val) { return new InnerString(val); } @@ -47,7 +45,7 @@ static InnerString create(String val) { * implements {@link ChatCompletionRequestAssistantMessageContent}. */ record InnerChatCompletionRequestAssistantMessageContentParts( - @com.fasterxml.jackson.annotation.JsonValue + @com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) implements ChatCompletionRequestAssistantMessageContent {} @@ -59,8 +57,9 @@ record InnerChatCompletionRequestAssistantMessageContentParts( * @return a new instance of {@link InnerChatCompletionRequestAssistantMessageContentParts}. */ @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull static InnerChatCompletionRequestAssistantMessageContentParts create( - List val) { + @Nonnull final List val) { return new InnerChatCompletionRequestAssistantMessageContentParts(val); } } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestAssistantMessageContentPart.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestAssistantMessageContentPart.java index 525967280..e79119d1f 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestAssistantMessageContentPart.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestAssistantMessageContentPart.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,12 +13,13 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; /** ChatCompletionRequestAssistantMessageContentPart */ +@Beta @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) @JsonSubTypes({ @JsonSubTypes.Type(value = ChatCompletionRequestMessageContentPartRefusal.class), @JsonSubTypes.Type(value = ChatCompletionRequestMessageContentPartText.class), }) -@com.google.common.annotations.Beta public interface ChatCompletionRequestAssistantMessageContentPart {} diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestAssistantMessageFunctionCall.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestAssistantMessageFunctionCall.java index ffc1f42b5..29f72949f 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestAssistantMessageFunctionCall.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestAssistantMessageFunctionCall.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -35,8 +31,7 @@ * @deprecated */ @Deprecated -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionRequestAssistantMessageFunctionCall // CHECKSTYLE:ON { @@ -142,11 +137,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * ChatCompletionRequestAssistantMessageFunctionCall} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -157,6 +154,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link + * ChatCompletionRequestAssistantMessageFunctionCall} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (arguments != null) declaredFields.put("arguments", arguments); + if (name != null) declaredFields.put("name", name); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link * ChatCompletionRequestAssistantMessageFunctionCall} instance. If the map previously contained a @@ -171,7 +183,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -211,7 +223,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestFunctionMessage.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestFunctionMessage.java index 60f4b431f..1a2de287b 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestFunctionMessage.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestFunctionMessage.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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; @@ -36,8 +32,7 @@ * @deprecated */ @Deprecated -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionRequestFunctionMessage implements ChatCompletionRequestMessage // CHECKSTYLE:ON { @@ -219,11 +214,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * ChatCompletionRequestFunctionMessage} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -232,6 +229,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionRequestFunctionMessage} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (role != null) declaredFields.put("role", role); + if (content != null) declaredFields.put("content", content); + if (name != null) declaredFields.put("name", name); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionRequestFunctionMessage} instance. * If the map previously contained a mapping for the key, the old value is replaced by the @@ -246,7 +259,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -285,7 +298,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessage.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessage.java index 7a81d0061..98e4464f6 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessage.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessage.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,8 +13,10 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; /** ChatCompletionRequestMessage */ +@Beta @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) @JsonSubTypes({ @JsonSubTypes.Type(value = ChatCompletionRequestAssistantMessage.class), @@ -28,5 +25,4 @@ @JsonSubTypes.Type(value = ChatCompletionRequestToolMessage.class), @JsonSubTypes.Type(value = ChatCompletionRequestUserMessage.class), }) -@com.google.common.annotations.Beta public interface ChatCompletionRequestMessage {} diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageContentPartImage.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageContentPartImage.java index d00dcf7c0..bb2b8a826 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageContentPartImage.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageContentPartImage.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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; @@ -31,8 +27,7 @@ import javax.annotation.Nullable; /** ChatCompletionRequestMessageContentPartImage */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionRequestMessageContentPartImage implements ChatCompletionRequestUserMessageContentPart // CHECKSTYLE:ON @@ -183,11 +178,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * ChatCompletionRequestMessageContentPartImage} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -196,6 +193,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionRequestMessageContentPartImage} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (imageUrl != null) declaredFields.put("imageUrl", imageUrl); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionRequestMessageContentPartImage} * instance. If the map previously contained a mapping for the key, the old value is replaced by @@ -210,7 +222,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -249,7 +261,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageContentPartImageImageUrl.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageContentPartImageImageUrl.java index 6b6f33649..b7e7b6cf4 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageContentPartImageImageUrl.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageContentPartImageImageUrl.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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.net.URI; import java.util.LinkedHashMap; import java.util.Map; @@ -32,8 +28,7 @@ import javax.annotation.Nullable; /** ChatCompletionRequestMessageContentPartImageImageUrl */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionRequestMessageContentPartImageImageUrl // CHECKSTYLE:ON { @@ -200,11 +195,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * ChatCompletionRequestMessageContentPartImageImageUrl} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -215,6 +212,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link + * ChatCompletionRequestMessageContentPartImageImageUrl} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (url != null) declaredFields.put("url", url); + if (detail != null) declaredFields.put("detail", detail); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link * ChatCompletionRequestMessageContentPartImageImageUrl} instance. If the map previously contained @@ -229,7 +242,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -268,7 +281,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageContentPartRefusal.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageContentPartRefusal.java index 6261748f7..3eb79379c 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageContentPartRefusal.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageContentPartRefusal.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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; @@ -31,8 +27,7 @@ import javax.annotation.Nullable; /** ChatCompletionRequestMessageContentPartRefusal */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionRequestMessageContentPartRefusal implements ChatCompletionRequestAssistantMessageContentPart // CHECKSTYLE:ON @@ -183,11 +178,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * ChatCompletionRequestMessageContentPartRefusal} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -196,6 +193,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionRequestMessageContentPartRefusal} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (refusal != null) declaredFields.put("refusal", refusal); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionRequestMessageContentPartRefusal} * instance. If the map previously contained a mapping for the key, the old value is replaced by @@ -210,7 +222,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -249,7 +261,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageContentPartText.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageContentPartText.java index 31a264360..5768a60e4 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageContentPartText.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageContentPartText.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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; @@ -31,8 +27,7 @@ import javax.annotation.Nullable; /** ChatCompletionRequestMessageContentPartText */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionRequestMessageContentPartText implements ChatCompletionRequestAssistantMessageContentPart, ChatCompletionRequestSystemMessageContentPart, @@ -183,11 +178,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * ChatCompletionRequestMessageContentPartText} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -196,6 +193,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionRequestMessageContentPartText} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (text != null) declaredFields.put("text", text); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionRequestMessageContentPartText} * instance. If the map previously contained a mapping for the key, the old value is replaced by @@ -210,7 +222,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -248,7 +260,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageFunction.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageFunction.java deleted file mode 100644 index e05164cdd..000000000 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageFunction.java +++ /dev/null @@ -1,463 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Azure OpenAI Service API - * Azure OpenAI APIs for completions and search - * - * The version of the OpenAPI document: 2024-10-21 - * - * - * 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.foundationmodels.openai.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.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; - -/** ChatCompletionRequestMessageFunction */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta -public class ChatCompletionRequestMessageFunction -// CHECKSTYLE:ON -{ - @JsonProperty("content") - private String content; - - /** The role of the messages author, in this case `function`. */ - public enum RoleEnum { - /** The FUNCTION option of this ChatCompletionRequestMessageFunction */ - FUNCTION("function"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this ChatCompletionRequestMessageFunction */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - RoleEnum(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 ChatCompletionRequestMessageFunction - */ - @JsonCreator - @Nonnull - public static RoleEnum fromValue(@Nonnull final String value) { - for (RoleEnum b : RoleEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("role") - private RoleEnum role; - - @JsonProperty("name") - private String name; - - @JsonProperty("refusal") - private String refusal; - - @JsonProperty("tool_calls") - private List toolCalls = new ArrayList<>(); - - @JsonProperty("function_call") - private ChatCompletionRequestAssistantMessageFunctionCall functionCall; - - @JsonProperty("tool_call_id") - private String toolCallId; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Set the content of this {@link ChatCompletionRequestMessageFunction} instance and return the - * same instance. - * - * @param content The contents of the message. - * @return The same instance of this {@link ChatCompletionRequestMessageFunction} class - */ - @Nonnull - public ChatCompletionRequestMessageFunction content(@Nullable final String content) { - this.content = content; - return this; - } - - /** - * The contents of the message. - * - * @return content The content of this {@link ChatCompletionRequestMessageFunction} instance. - */ - @Nullable - public String getContent() { - return content; - } - - /** - * Set the content of this {@link ChatCompletionRequestMessageFunction} instance. - * - * @param content The contents of the message. - */ - public void setContent(@Nullable final String content) { - this.content = content; - } - - /** - * Set the role of this {@link ChatCompletionRequestMessageFunction} instance and return the same - * instance. - * - * @param role The role of the messages author, in this case `function`. - * @return The same instance of this {@link ChatCompletionRequestMessageFunction} class - */ - @Nonnull - public ChatCompletionRequestMessageFunction role(@Nonnull final RoleEnum role) { - this.role = role; - return this; - } - - /** - * The role of the messages author, in this case `function`. - * - * @return role The role of this {@link ChatCompletionRequestMessageFunction} instance. - */ - @Nonnull - public RoleEnum getRole() { - return role; - } - - /** - * Set the role of this {@link ChatCompletionRequestMessageFunction} instance. - * - * @param role The role of the messages author, in this case `function`. - */ - public void setRole(@Nonnull final RoleEnum role) { - this.role = role; - } - - /** - * Set the name of this {@link ChatCompletionRequestMessageFunction} instance and return the same - * instance. - * - * @param name The contents of the message. - * @return The same instance of this {@link ChatCompletionRequestMessageFunction} class - */ - @Nonnull - public ChatCompletionRequestMessageFunction name(@Nonnull final String name) { - this.name = name; - return this; - } - - /** - * The contents of the message. - * - * @return name The name of this {@link ChatCompletionRequestMessageFunction} instance. - */ - @Nonnull - public String getName() { - return name; - } - - /** - * Set the name of this {@link ChatCompletionRequestMessageFunction} instance. - * - * @param name The contents of the message. - */ - public void setName(@Nonnull final String name) { - this.name = name; - } - - /** - * Set the refusal of this {@link ChatCompletionRequestMessageFunction} instance and return the - * same instance. - * - * @param refusal The refusal message by the assistant. - * @return The same instance of this {@link ChatCompletionRequestMessageFunction} class - */ - @Nonnull - public ChatCompletionRequestMessageFunction refusal(@Nullable final String refusal) { - this.refusal = refusal; - return this; - } - - /** - * The refusal message by the assistant. - * - * @return refusal The refusal of this {@link ChatCompletionRequestMessageFunction} instance. - */ - @Nullable - public String getRefusal() { - return refusal; - } - - /** - * Set the refusal of this {@link ChatCompletionRequestMessageFunction} instance. - * - * @param refusal The refusal message by the assistant. - */ - public void setRefusal(@Nullable final String refusal) { - this.refusal = refusal; - } - - /** - * Set the toolCalls of this {@link ChatCompletionRequestMessageFunction} 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 ChatCompletionRequestMessageFunction} class - */ - @Nonnull - public ChatCompletionRequestMessageFunction toolCalls( - @Nullable final List toolCalls) { - this.toolCalls = toolCalls; - return this; - } - - /** - * Add one toolCalls instance to this {@link ChatCompletionRequestMessageFunction}. - * - * @param toolCallsItem The toolCalls that should be added - * @return The same instance of type {@link ChatCompletionRequestMessageFunction} - */ - @Nonnull - public ChatCompletionRequestMessageFunction addToolCallsItem( - @Nonnull final ChatCompletionMessageToolCall 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 ChatCompletionRequestMessageFunction} instance. - */ - @Nonnull - public List getToolCalls() { - return toolCalls; - } - - /** - * Set the toolCalls of this {@link ChatCompletionRequestMessageFunction} instance. - * - * @param toolCalls The tool calls generated by the model, such as function calls. - */ - public void setToolCalls(@Nullable final List toolCalls) { - this.toolCalls = toolCalls; - } - - /** - * Set the functionCall of this {@link ChatCompletionRequestMessageFunction} instance and return - * the same instance. - * - * @param functionCall The functionCall of this {@link ChatCompletionRequestMessageFunction} - * @return The same instance of this {@link ChatCompletionRequestMessageFunction} class - */ - @Nonnull - public ChatCompletionRequestMessageFunction functionCall( - @Nullable final ChatCompletionRequestAssistantMessageFunctionCall functionCall) { - this.functionCall = functionCall; - return this; - } - - /** - * Get functionCall - * - * @return functionCall The functionCall of this {@link ChatCompletionRequestMessageFunction} - * instance. - * @deprecated - */ - @Deprecated - @Nullable - public ChatCompletionRequestAssistantMessageFunctionCall getFunctionCall() { - return functionCall; - } - - /** - * Set the functionCall of this {@link ChatCompletionRequestMessageFunction} instance. - * - * @param functionCall The functionCall of this {@link ChatCompletionRequestMessageFunction} - */ - public void setFunctionCall( - @Nullable final ChatCompletionRequestAssistantMessageFunctionCall functionCall) { - this.functionCall = functionCall; - } - - /** - * Set the toolCallId of this {@link ChatCompletionRequestMessageFunction} instance and return the - * same instance. - * - * @param toolCallId Tool call that this message is responding to. - * @return The same instance of this {@link ChatCompletionRequestMessageFunction} class - */ - @Nonnull - public ChatCompletionRequestMessageFunction toolCallId(@Nonnull final String toolCallId) { - this.toolCallId = toolCallId; - return this; - } - - /** - * Tool call that this message is responding to. - * - * @return toolCallId The toolCallId of this {@link ChatCompletionRequestMessageFunction} - * instance. - */ - @Nonnull - public String getToolCallId() { - return toolCallId; - } - - /** - * Set the toolCallId of this {@link ChatCompletionRequestMessageFunction} instance. - * - * @param toolCallId Tool call that this message is responding to. - */ - public void setToolCallId(@Nonnull final String toolCallId) { - this.toolCallId = toolCallId; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * ChatCompletionRequestMessageFunction}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * ChatCompletionRequestMessageFunction} 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( - "ChatCompletionRequestMessageFunction has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link ChatCompletionRequestMessageFunction} 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 Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final ChatCompletionRequestMessageFunction chatCompletionRequestMessageFunction = - (ChatCompletionRequestMessageFunction) o; - return Objects.equals( - this.cloudSdkCustomFields, chatCompletionRequestMessageFunction.cloudSdkCustomFields) - && Objects.equals(this.content, chatCompletionRequestMessageFunction.content) - && Objects.equals(this.role, chatCompletionRequestMessageFunction.role) - && Objects.equals(this.name, chatCompletionRequestMessageFunction.name) - && Objects.equals(this.refusal, chatCompletionRequestMessageFunction.refusal) - && Objects.equals(this.toolCalls, chatCompletionRequestMessageFunction.toolCalls) - && Objects.equals(this.functionCall, chatCompletionRequestMessageFunction.functionCall) - && Objects.equals(this.toolCallId, chatCompletionRequestMessageFunction.toolCallId); - } - - @Override - public int hashCode() { - return Objects.hash( - content, role, name, refusal, toolCalls, functionCall, toolCallId, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class ChatCompletionRequestMessageFunction {\n"); - sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" refusal: ").append(toIndentedString(refusal)).append("\n"); - sb.append(" toolCalls: ").append(toIndentedString(toolCalls)).append("\n"); - sb.append(" functionCall: ").append(toIndentedString(functionCall)).append("\n"); - sb.append(" toolCallId: ").append(toIndentedString(toolCallId)).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 Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageTool.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageTool.java deleted file mode 100644 index a73c5b2e2..000000000 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestMessageTool.java +++ /dev/null @@ -1,461 +0,0 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - -/* - * Azure OpenAI Service API - * Azure OpenAI APIs for completions and search - * - * The version of the OpenAPI document: 2024-10-21 - * - * - * 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.foundationmodels.openai.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.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; - -/** ChatCompletionRequestMessageTool */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta -public class ChatCompletionRequestMessageTool -// CHECKSTYLE:ON -{ - @JsonProperty("content") - private String content; - - /** The role of the messages author, in this case `function`. */ - public enum RoleEnum { - /** The FUNCTION option of this ChatCompletionRequestMessageTool */ - FUNCTION("function"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this ChatCompletionRequestMessageTool */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - RoleEnum(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 ChatCompletionRequestMessageTool - */ - @JsonCreator - @Nonnull - public static RoleEnum fromValue(@Nonnull final String value) { - for (RoleEnum b : RoleEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("role") - private RoleEnum role; - - @JsonProperty("name") - private String name; - - @JsonProperty("refusal") - private String refusal; - - @JsonProperty("tool_calls") - private List toolCalls = new ArrayList<>(); - - @JsonProperty("function_call") - private ChatCompletionRequestAssistantMessageFunctionCall functionCall; - - @JsonProperty("tool_call_id") - private String toolCallId; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Set the content of this {@link ChatCompletionRequestMessageTool} instance and return the same - * instance. - * - * @param content The contents of the message. - * @return The same instance of this {@link ChatCompletionRequestMessageTool} class - */ - @Nonnull - public ChatCompletionRequestMessageTool content(@Nullable final String content) { - this.content = content; - return this; - } - - /** - * The contents of the message. - * - * @return content The content of this {@link ChatCompletionRequestMessageTool} instance. - */ - @Nullable - public String getContent() { - return content; - } - - /** - * Set the content of this {@link ChatCompletionRequestMessageTool} instance. - * - * @param content The contents of the message. - */ - public void setContent(@Nullable final String content) { - this.content = content; - } - - /** - * Set the role of this {@link ChatCompletionRequestMessageTool} instance and return the same - * instance. - * - * @param role The role of the messages author, in this case `function`. - * @return The same instance of this {@link ChatCompletionRequestMessageTool} class - */ - @Nonnull - public ChatCompletionRequestMessageTool role(@Nonnull final RoleEnum role) { - this.role = role; - return this; - } - - /** - * The role of the messages author, in this case `function`. - * - * @return role The role of this {@link ChatCompletionRequestMessageTool} instance. - */ - @Nonnull - public RoleEnum getRole() { - return role; - } - - /** - * Set the role of this {@link ChatCompletionRequestMessageTool} instance. - * - * @param role The role of the messages author, in this case `function`. - */ - public void setRole(@Nonnull final RoleEnum role) { - this.role = role; - } - - /** - * Set the name of this {@link ChatCompletionRequestMessageTool} instance and return the same - * instance. - * - * @param name The name of the function to call. - * @return The same instance of this {@link ChatCompletionRequestMessageTool} class - */ - @Nonnull - public ChatCompletionRequestMessageTool name(@Nonnull final String name) { - this.name = name; - return this; - } - - /** - * The name of the function to call. - * - * @return name The name of this {@link ChatCompletionRequestMessageTool} instance. - */ - @Nonnull - public String getName() { - return name; - } - - /** - * Set the name of this {@link ChatCompletionRequestMessageTool} instance. - * - * @param name The name of the function to call. - */ - public void setName(@Nonnull final String name) { - this.name = name; - } - - /** - * Set the refusal of this {@link ChatCompletionRequestMessageTool} instance and return the same - * instance. - * - * @param refusal The refusal message by the assistant. - * @return The same instance of this {@link ChatCompletionRequestMessageTool} class - */ - @Nonnull - public ChatCompletionRequestMessageTool refusal(@Nullable final String refusal) { - this.refusal = refusal; - return this; - } - - /** - * The refusal message by the assistant. - * - * @return refusal The refusal of this {@link ChatCompletionRequestMessageTool} instance. - */ - @Nullable - public String getRefusal() { - return refusal; - } - - /** - * Set the refusal of this {@link ChatCompletionRequestMessageTool} instance. - * - * @param refusal The refusal message by the assistant. - */ - public void setRefusal(@Nullable final String refusal) { - this.refusal = refusal; - } - - /** - * Set the toolCalls of this {@link ChatCompletionRequestMessageTool} 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 ChatCompletionRequestMessageTool} class - */ - @Nonnull - public ChatCompletionRequestMessageTool toolCalls( - @Nullable final List toolCalls) { - this.toolCalls = toolCalls; - return this; - } - - /** - * Add one toolCalls instance to this {@link ChatCompletionRequestMessageTool}. - * - * @param toolCallsItem The toolCalls that should be added - * @return The same instance of type {@link ChatCompletionRequestMessageTool} - */ - @Nonnull - public ChatCompletionRequestMessageTool addToolCallsItem( - @Nonnull final ChatCompletionMessageToolCall 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 ChatCompletionRequestMessageTool} instance. - */ - @Nonnull - public List getToolCalls() { - return toolCalls; - } - - /** - * Set the toolCalls of this {@link ChatCompletionRequestMessageTool} instance. - * - * @param toolCalls The tool calls generated by the model, such as function calls. - */ - public void setToolCalls(@Nullable final List toolCalls) { - this.toolCalls = toolCalls; - } - - /** - * Set the functionCall of this {@link ChatCompletionRequestMessageTool} instance and return the - * same instance. - * - * @param functionCall The functionCall of this {@link ChatCompletionRequestMessageTool} - * @return The same instance of this {@link ChatCompletionRequestMessageTool} class - */ - @Nonnull - public ChatCompletionRequestMessageTool functionCall( - @Nullable final ChatCompletionRequestAssistantMessageFunctionCall functionCall) { - this.functionCall = functionCall; - return this; - } - - /** - * Get functionCall - * - * @return functionCall The functionCall of this {@link ChatCompletionRequestMessageTool} - * instance. - * @deprecated - */ - @Deprecated - @Nullable - public ChatCompletionRequestAssistantMessageFunctionCall getFunctionCall() { - return functionCall; - } - - /** - * Set the functionCall of this {@link ChatCompletionRequestMessageTool} instance. - * - * @param functionCall The functionCall of this {@link ChatCompletionRequestMessageTool} - */ - public void setFunctionCall( - @Nullable final ChatCompletionRequestAssistantMessageFunctionCall functionCall) { - this.functionCall = functionCall; - } - - /** - * Set the toolCallId of this {@link ChatCompletionRequestMessageTool} instance and return the - * same instance. - * - * @param toolCallId Tool call that this message is responding to. - * @return The same instance of this {@link ChatCompletionRequestMessageTool} class - */ - @Nonnull - public ChatCompletionRequestMessageTool toolCallId(@Nonnull final String toolCallId) { - this.toolCallId = toolCallId; - return this; - } - - /** - * Tool call that this message is responding to. - * - * @return toolCallId The toolCallId of this {@link ChatCompletionRequestMessageTool} instance. - */ - @Nonnull - public String getToolCallId() { - return toolCallId; - } - - /** - * Set the toolCallId of this {@link ChatCompletionRequestMessageTool} instance. - * - * @param toolCallId Tool call that this message is responding to. - */ - public void setToolCallId(@Nonnull final String toolCallId) { - this.toolCallId = toolCallId; - } - - /** - * Get the names of the unrecognizable properties of the {@link ChatCompletionRequestMessageTool}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link ChatCompletionRequestMessageTool} - * 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( - "ChatCompletionRequestMessageTool has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Set an unrecognizable property of this {@link ChatCompletionRequestMessageTool} 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 Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final ChatCompletionRequestMessageTool chatCompletionRequestMessageTool = - (ChatCompletionRequestMessageTool) o; - return Objects.equals( - this.cloudSdkCustomFields, chatCompletionRequestMessageTool.cloudSdkCustomFields) - && Objects.equals(this.content, chatCompletionRequestMessageTool.content) - && Objects.equals(this.role, chatCompletionRequestMessageTool.role) - && Objects.equals(this.name, chatCompletionRequestMessageTool.name) - && Objects.equals(this.refusal, chatCompletionRequestMessageTool.refusal) - && Objects.equals(this.toolCalls, chatCompletionRequestMessageTool.toolCalls) - && Objects.equals(this.functionCall, chatCompletionRequestMessageTool.functionCall) - && Objects.equals(this.toolCallId, chatCompletionRequestMessageTool.toolCallId); - } - - @Override - public int hashCode() { - return Objects.hash( - content, role, name, refusal, toolCalls, functionCall, toolCallId, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class ChatCompletionRequestMessageTool {\n"); - sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" refusal: ").append(toIndentedString(refusal)).append("\n"); - sb.append(" toolCalls: ").append(toIndentedString(toolCalls)).append("\n"); - sb.append(" functionCall: ").append(toIndentedString(functionCall)).append("\n"); - sb.append(" toolCallId: ").append(toIndentedString(toolCallId)).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 Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestSystemMessage.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestSystemMessage.java index 523fc4312..6104f55a6 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestSystemMessage.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestSystemMessage.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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; @@ -31,8 +27,7 @@ import javax.annotation.Nullable; /** ChatCompletionRequestSystemMessage */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionRequestSystemMessage implements ChatCompletionRequestMessage // CHECKSTYLE:ON { @@ -218,11 +213,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link ChatCompletionRequestSystemMessage} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -231,6 +228,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionRequestSystemMessage} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (content != null) declaredFields.put("content", content); + if (role != null) declaredFields.put("role", role); + if (name != null) declaredFields.put("name", name); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionRequestSystemMessage} instance. If * the map previously contained a mapping for the key, the old value is replaced by the specified @@ -245,7 +258,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -284,7 +297,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestSystemMessageContent.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestSystemMessageContent.java index 82806d147..149a4c50c 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestSystemMessageContent.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestSystemMessageContent.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -16,16 +11,18 @@ package com.sap.ai.sdk.foundationmodels.openai.generated.model; +import com.google.common.annotations.Beta; import java.util.List; +import javax.annotation.Nonnull; /** The contents of the system message. */ -@com.google.common.annotations.Beta +@Beta public interface ChatCompletionRequestSystemMessageContent { /** * Helper class to create a String that implements {@link * ChatCompletionRequestSystemMessageContent}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue String value) + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements ChatCompletionRequestSystemMessageContent {} /** @@ -35,7 +32,8 @@ record InnerString(@com.fasterxml.jackson.annotation.JsonValue String value) * @return a new instance of {@link InnerString}. */ @com.fasterxml.jackson.annotation.JsonCreator - static InnerString create(String val) { + @Nonnull + static InnerString create(@Nonnull final String val) { return new InnerString(val); } @@ -44,7 +42,7 @@ static InnerString create(String val) { * {@link ChatCompletionRequestSystemMessageContent}. */ record InnerChatCompletionRequestSystemMessageContentParts( - @com.fasterxml.jackson.annotation.JsonValue + @com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) implements ChatCompletionRequestSystemMessageContent {} @@ -55,8 +53,9 @@ record InnerChatCompletionRequestSystemMessageContentParts( * @return a new instance of {@link InnerChatCompletionRequestSystemMessageContentParts}. */ @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull static InnerChatCompletionRequestSystemMessageContentParts create( - List val) { + @Nonnull final List val) { return new InnerChatCompletionRequestSystemMessageContentParts(val); } } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestSystemMessageContentPart.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestSystemMessageContentPart.java index e5d96cff8..6a2d954f0 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestSystemMessageContentPart.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestSystemMessageContentPart.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,11 +13,12 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; /** ChatCompletionRequestSystemMessageContentPart */ +@Beta @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) @JsonSubTypes({ @JsonSubTypes.Type(value = ChatCompletionRequestMessageContentPartText.class), }) -@com.google.common.annotations.Beta public interface ChatCompletionRequestSystemMessageContentPart {} diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestToolMessage.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestToolMessage.java index 61b729dfd..5466a395a 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestToolMessage.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestToolMessage.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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; @@ -31,8 +27,7 @@ import javax.annotation.Nullable; /** ChatCompletionRequestToolMessage */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionRequestToolMessage implements ChatCompletionRequestMessage // CHECKSTYLE:ON { @@ -214,11 +209,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link ChatCompletionRequestToolMessage} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -227,6 +224,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionRequestToolMessage} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (role != null) declaredFields.put("role", role); + if (content != null) declaredFields.put("content", content); + if (toolCallId != null) declaredFields.put("toolCallId", toolCallId); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionRequestToolMessage} instance. If * the map previously contained a mapping for the key, the old value is replaced by the specified @@ -241,7 +254,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -280,7 +293,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestToolMessageContent.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestToolMessageContent.java index 47426e78a..a40cf2a34 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestToolMessageContent.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestToolMessageContent.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -16,16 +11,18 @@ package com.sap.ai.sdk.foundationmodels.openai.generated.model; +import com.google.common.annotations.Beta; import java.util.List; +import javax.annotation.Nonnull; /** The contents of the tool message. */ -@com.google.common.annotations.Beta +@Beta public interface ChatCompletionRequestToolMessageContent { /** * Helper class to create a String that implements {@link * ChatCompletionRequestToolMessageContent}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue String value) + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements ChatCompletionRequestToolMessageContent {} /** @@ -35,7 +32,8 @@ record InnerString(@com.fasterxml.jackson.annotation.JsonValue String value) * @return a new instance of {@link InnerString}. */ @com.fasterxml.jackson.annotation.JsonCreator - static InnerString create(String val) { + @Nonnull + static InnerString create(@Nonnull final String val) { return new InnerString(val); } @@ -44,7 +42,7 @@ static InnerString create(String val) { * {@link ChatCompletionRequestToolMessageContent}. */ record InnerChatCompletionRequestToolMessageContentParts( - @com.fasterxml.jackson.annotation.JsonValue + @com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) implements ChatCompletionRequestToolMessageContent {} @@ -55,8 +53,9 @@ record InnerChatCompletionRequestToolMessageContentParts( * @return a new instance of {@link InnerChatCompletionRequestToolMessageContentParts}. */ @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull static InnerChatCompletionRequestToolMessageContentParts create( - List val) { + @Nonnull final List val) { return new InnerChatCompletionRequestToolMessageContentParts(val); } } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestToolMessageContentPart.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestToolMessageContentPart.java index 7210b6f13..c5b2a6904 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestToolMessageContentPart.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestToolMessageContentPart.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,11 +13,12 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; /** ChatCompletionRequestToolMessageContentPart */ +@Beta @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) @JsonSubTypes({ @JsonSubTypes.Type(value = ChatCompletionRequestMessageContentPartText.class), }) -@com.google.common.annotations.Beta public interface ChatCompletionRequestToolMessageContentPart {} diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestUserMessage.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestUserMessage.java index b0b6f92d9..373b9922c 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestUserMessage.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestUserMessage.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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; @@ -31,8 +27,7 @@ import javax.annotation.Nullable; /** ChatCompletionRequestUserMessage */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionRequestUserMessage implements ChatCompletionRequestMessage // CHECKSTYLE:ON { @@ -217,11 +212,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link ChatCompletionRequestUserMessage} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -230,6 +227,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionRequestUserMessage} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (content != null) declaredFields.put("content", content); + if (role != null) declaredFields.put("role", role); + if (name != null) declaredFields.put("name", name); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionRequestUserMessage} instance. If * the map previously contained a mapping for the key, the old value is replaced by the specified @@ -244,7 +257,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -283,7 +296,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestUserMessageContent.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestUserMessageContent.java index 38980a408..741a0ea52 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestUserMessageContent.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestUserMessageContent.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -16,16 +11,18 @@ package com.sap.ai.sdk.foundationmodels.openai.generated.model; +import com.google.common.annotations.Beta; import java.util.List; +import javax.annotation.Nonnull; /** The contents of the user message. */ -@com.google.common.annotations.Beta +@Beta public interface ChatCompletionRequestUserMessageContent { /** * Helper class to create a String that implements {@link * ChatCompletionRequestUserMessageContent}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue String value) + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements ChatCompletionRequestUserMessageContent {} /** @@ -35,7 +32,8 @@ record InnerString(@com.fasterxml.jackson.annotation.JsonValue String value) * @return a new instance of {@link InnerString}. */ @com.fasterxml.jackson.annotation.JsonCreator - static InnerString create(String val) { + @Nonnull + static InnerString create(@Nonnull final String val) { return new InnerString(val); } @@ -44,7 +42,7 @@ static InnerString create(String val) { * {@link ChatCompletionRequestUserMessageContent}. */ record InnerChatCompletionRequestUserMessageContentParts( - @com.fasterxml.jackson.annotation.JsonValue + @com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) implements ChatCompletionRequestUserMessageContent {} @@ -55,8 +53,9 @@ record InnerChatCompletionRequestUserMessageContentParts( * @return a new instance of {@link InnerChatCompletionRequestUserMessageContentParts}. */ @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull static InnerChatCompletionRequestUserMessageContentParts create( - List val) { + @Nonnull final List val) { return new InnerChatCompletionRequestUserMessageContentParts(val); } } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestUserMessageContentPart.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestUserMessageContentPart.java index 69be81b85..bf9512f2d 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestUserMessageContentPart.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionRequestUserMessageContentPart.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,12 +13,13 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; /** ChatCompletionRequestUserMessageContentPart */ +@Beta @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) @JsonSubTypes({ @JsonSubTypes.Type(value = ChatCompletionRequestMessageContentPartImage.class), @JsonSubTypes.Type(value = ChatCompletionRequestMessageContentPartText.class), }) -@com.google.common.annotations.Beta public interface ChatCompletionRequestUserMessageContentPart {} diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionResponseMessage.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionResponseMessage.java index 350b7e694..64f0da801 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionResponseMessage.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionResponseMessage.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -31,8 +27,7 @@ import javax.annotation.Nullable; /** A chat completion message generated by the model. */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionResponseMessage // CHECKSTYLE:ON { @@ -51,9 +46,6 @@ public class ChatCompletionResponseMessage @JsonProperty("function_call") private ChatCompletionFunctionCall functionCall; - // @JsonProperty("context") // TODO: add context - // private AzureChatExtensionsMessageContext context; - @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); @@ -250,11 +242,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link ChatCompletionResponseMessage} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -263,6 +257,24 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionResponseMessage} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (role != null) declaredFields.put("role", role); + if (refusal != null) declaredFields.put("refusal", refusal); + if (content != null) declaredFields.put("content", content); + if (toolCalls != null) declaredFields.put("toolCalls", toolCalls); + if (functionCall != null) declaredFields.put("functionCall", functionCall); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionResponseMessage} instance. If the * map previously contained a mapping for the key, the old value is replaced by the specified @@ -277,7 +289,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -320,7 +332,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionResponseMessageRole.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionResponseMessageRole.java index a7d85d920..4cc0b9957 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionResponseMessageRole.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionResponseMessageRole.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,16 +13,14 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; import javax.annotation.Nonnull; /** The role of the author of the response message. */ -@com.google.common.annotations.Beta +@Beta public enum ChatCompletionResponseMessageRole { - - /** ASSISTANT option of this ChatCompletionResponseMessageRole */ ASSISTANT("assistant"), - /** UNKNOWN_DEFAULT_OPEN_API option of this ChatCompletionResponseMessageRole */ UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); private final String value; diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionStreamOptions.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionStreamOptions.java index 0c85ce361..a7482677c 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionStreamOptions.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionStreamOptions.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** Options for streaming response. Only set this when you set `stream: true`. */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionStreamOptions // CHECKSTYLE:ON { @@ -98,11 +93,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link ChatCompletionStreamOptions} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -111,6 +108,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionStreamOptions} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (includeUsage != null) declaredFields.put("includeUsage", includeUsage); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionStreamOptions} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. @@ -124,7 +135,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -158,7 +169,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionStreamResponseDelta.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionStreamResponseDelta.java index 9ccd92d8b..9283a67a7 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionStreamResponseDelta.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionStreamResponseDelta.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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.ArrayList; import java.util.LinkedHashMap; import java.util.List; @@ -33,8 +29,7 @@ import javax.annotation.Nullable; /** A chat completion delta generated by streamed model responses. */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionStreamResponseDelta // CHECKSTYLE:ON { @@ -317,11 +312,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link ChatCompletionStreamResponseDelta} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -330,6 +327,24 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionStreamResponseDelta} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (content != null) declaredFields.put("content", content); + if (functionCall != null) declaredFields.put("functionCall", functionCall); + if (toolCalls != null) declaredFields.put("toolCalls", toolCalls); + if (role != null) declaredFields.put("role", role); + if (refusal != null) declaredFields.put("refusal", refusal); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionStreamResponseDelta} instance. If * the map previously contained a mapping for the key, the old value is replaced by the specified @@ -344,7 +359,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -387,7 +402,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionStreamResponseDeltaFunctionCall.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionStreamResponseDeltaFunctionCall.java index 43c83f532..2fb0e2d72 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionStreamResponseDeltaFunctionCall.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionStreamResponseDeltaFunctionCall.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -35,8 +31,7 @@ * @deprecated */ @Deprecated -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionStreamResponseDeltaFunctionCall // CHECKSTYLE:ON { @@ -138,11 +133,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * ChatCompletionStreamResponseDeltaFunctionCall} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -151,6 +148,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionStreamResponseDeltaFunctionCall} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (arguments != null) declaredFields.put("arguments", arguments); + if (name != null) declaredFields.put("name", name); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionStreamResponseDeltaFunctionCall} * instance. If the map previously contained a mapping for the key, the old value is replaced by @@ -165,7 +177,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -204,7 +216,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionTokenLogprob.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionTokenLogprob.java index 9340f3335..dbd5008d4 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionTokenLogprob.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionTokenLogprob.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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.math.BigDecimal; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -32,8 +28,7 @@ import javax.annotation.Nullable; /** ChatCompletionTokenLogprob */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionTokenLogprob // CHECKSTYLE:ON { @@ -240,11 +235,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link ChatCompletionTokenLogprob} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -253,6 +250,23 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionTokenLogprob} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (token != null) declaredFields.put("token", token); + if (logprob != null) declaredFields.put("logprob", logprob); + if (bytes != null) declaredFields.put("bytes", bytes); + if (topLogprobs != null) declaredFields.put("topLogprobs", topLogprobs); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionTokenLogprob} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. @@ -266,7 +280,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -306,7 +320,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionTokenLogprobTopLogprobsInner.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionTokenLogprobTopLogprobsInner.java index 6a62d2ab1..8f0b9ddb4 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionTokenLogprobTopLogprobsInner.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionTokenLogprobTopLogprobsInner.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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.math.BigDecimal; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -32,8 +28,7 @@ import javax.annotation.Nullable; /** ChatCompletionTokenLogprobTopLogprobsInner */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionTokenLogprobTopLogprobsInner // CHECKSTYLE:ON { @@ -186,11 +181,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * ChatCompletionTokenLogprobTopLogprobsInner} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -199,6 +196,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionTokenLogprobTopLogprobsInner} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (token != null) declaredFields.put("token", token); + if (logprob != null) declaredFields.put("logprob", logprob); + if (bytes != null) declaredFields.put("bytes", bytes); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionTokenLogprobTopLogprobsInner} * instance. If the map previously contained a mapping for the key, the old value is replaced by @@ -213,7 +226,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -253,7 +266,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionTool.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionTool.java index 8124d7b39..bf845bccb 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionTool.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionTool.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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; @@ -31,8 +27,7 @@ import javax.annotation.Nullable; /** ChatCompletionTool */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionTool // CHECKSTYLE:ON { @@ -175,11 +170,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link ChatCompletionTool} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("ChatCompletionTool has no field with name '" + name + "'."); @@ -187,6 +184,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionTool} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (function != null) declaredFields.put("function", function); + return declaredFields; + } + /** * 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. @@ -200,7 +212,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -235,7 +247,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionToolChoiceOption.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionToolChoiceOption.java index 30ab46fdd..e5691af80 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionToolChoiceOption.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionToolChoiceOption.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -16,8 +11,8 @@ package com.sap.ai.sdk.foundationmodels.openai.generated.model; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; +import javax.annotation.Nonnull; /** * Controls which (if any) tool is called by the model. `none` means the model will not @@ -28,13 +23,14 @@ * \"my_function\"}}` forces the model to call that tool. `none` is the * default when no tools are present. `auto` is the default if tools are present. */ -@com.google.common.annotations.Beta +@Beta public interface ChatCompletionToolChoiceOption { /** * Helper class to create a ChatCompletionNamedToolChoice that implements {@link * ChatCompletionToolChoiceOption}. */ - record InnerChatCompletionNamedToolChoice(@JsonValue ChatCompletionNamedToolChoice value) + record InnerChatCompletionNamedToolChoice( + @com.fasterxml.jackson.annotation.JsonValue @Nonnull ChatCompletionNamedToolChoice value) implements ChatCompletionToolChoiceOption {} /** @@ -43,13 +39,16 @@ record InnerChatCompletionNamedToolChoice(@JsonValue ChatCompletionNamedToolChoi * @param val the value to use * @return a new instance of {@link InnerChatCompletionNamedToolChoice}. */ - @JsonCreator - static InnerChatCompletionNamedToolChoice create(ChatCompletionNamedToolChoice val) { + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerChatCompletionNamedToolChoice create( + @Nonnull final ChatCompletionNamedToolChoice val) { return new InnerChatCompletionNamedToolChoice(val); } /** Helper class to create a String that implements {@link ChatCompletionToolChoiceOption}. */ - record InnerString(@JsonValue String value) implements ChatCompletionToolChoiceOption {} + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) + implements ChatCompletionToolChoiceOption {} /** * Creator to enable deserialization of a String. @@ -57,8 +56,9 @@ record InnerString(@JsonValue String value) implements ChatCompletionToolChoiceO * @param val the value to use * @return a new instance of {@link InnerString}. */ - @JsonCreator - static InnerString create(String val) { + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerString create(@Nonnull final String val) { return new InnerString(val); } } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionsCreate200Response.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionsCreate200Response.java index 34d6df501..5f8acecc1 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionsCreate200Response.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionsCreate200Response.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,12 +13,13 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; /** ChatCompletionsCreate200Response */ +@Beta @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) @JsonSubTypes({ @JsonSubTypes.Type(value = CreateChatCompletionResponse.class), @JsonSubTypes.Type(value = CreateChatCompletionStreamResponse.class), }) -@com.google.common.annotations.Beta public interface ChatCompletionsCreate200Response {} diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionsRequestCommon.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionsRequestCommon.java index cf325bde1..5f6b8275e 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionsRequestCommon.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionsRequestCommon.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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.math.BigDecimal; import java.util.LinkedHashMap; import java.util.Map; @@ -30,8 +26,7 @@ import javax.annotation.Nullable; /** ChatCompletionsRequestCommon */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ChatCompletionsRequestCommon // CHECKSTYLE:ON { @@ -472,11 +467,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link ChatCompletionsRequestCommon} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -485,6 +482,29 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ChatCompletionsRequestCommon} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (temperature != null) declaredFields.put("temperature", temperature); + if (topP != null) declaredFields.put("topP", topP); + if (stream != null) declaredFields.put("stream", stream); + if (stop != null) declaredFields.put("stop", stop); + if (maxTokens != null) declaredFields.put("maxTokens", maxTokens); + if (maxCompletionTokens != null) declaredFields.put("maxCompletionTokens", maxCompletionTokens); + if (presencePenalty != null) declaredFields.put("presencePenalty", presencePenalty); + if (frequencyPenalty != null) declaredFields.put("frequencyPenalty", frequencyPenalty); + if (logitBias != null) declaredFields.put("logitBias", logitBias); + if (user != null) declaredFields.put("user", user); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ChatCompletionsRequestCommon} instance. If the * map previously contained a mapping for the key, the old value is replaced by the specified @@ -499,7 +519,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -566,7 +586,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionsRequestCommonStop.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionsRequestCommonStop.java index 17ddfb438..f74ffaf00 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionsRequestCommonStop.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionsRequestCommonStop.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -16,13 +11,15 @@ package com.sap.ai.sdk.foundationmodels.openai.generated.model; +import com.google.common.annotations.Beta; import java.util.List; +import javax.annotation.Nonnull; /** Up to 4 sequences where the API will stop generating further tokens. */ -@com.google.common.annotations.Beta +@Beta public interface ChatCompletionsRequestCommonStop { /** Helper class to create a String that implements {@link ChatCompletionsRequestCommonStop}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue String value) + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements ChatCompletionsRequestCommonStop {} /** @@ -32,7 +29,8 @@ record InnerString(@com.fasterxml.jackson.annotation.JsonValue String value) * @return a new instance of {@link InnerString}. */ @com.fasterxml.jackson.annotation.JsonCreator - static InnerString create(String val) { + @Nonnull + static InnerString create(@Nonnull final String val) { return new InnerString(val); } @@ -40,7 +38,7 @@ static InnerString create(String val) { * Helper class to create a list of String that implements {@link * ChatCompletionsRequestCommonStop}. */ - record InnerStrings(@com.fasterxml.jackson.annotation.JsonValue List values) + record InnerStrings(@com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) implements ChatCompletionsRequestCommonStop {} /** @@ -50,7 +48,8 @@ record InnerStrings(@com.fasterxml.jackson.annotation.JsonValue List val * @return a new instance of {@link InnerStrings}. */ @com.fasterxml.jackson.annotation.JsonCreator - static InnerStrings create(List val) { + @Nonnull + static InnerStrings create(@Nonnull final List val) { return new InnerStrings(val); } } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CompletionUsage.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CompletionUsage.java index 04419e417..e7d06d60f 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CompletionUsage.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CompletionUsage.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** Usage statistics for the completion request. */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class CompletionUsage // CHECKSTYLE:ON { @@ -191,11 +186,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link CompletionUsage} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("CompletionUsage has no field with name '" + name + "'."); @@ -203,6 +200,24 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link CompletionUsage} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (promptTokens != null) declaredFields.put("promptTokens", promptTokens); + if (completionTokens != null) declaredFields.put("completionTokens", completionTokens); + if (totalTokens != null) declaredFields.put("totalTokens", totalTokens); + if (completionTokensDetails != null) + declaredFields.put("completionTokensDetails", completionTokensDetails); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link CompletionUsage} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. @@ -216,7 +231,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -258,7 +273,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CompletionUsageCompletionTokensDetails.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CompletionUsageCompletionTokensDetails.java index b5b93fbfd..e13f739be 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CompletionUsageCompletionTokensDetails.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CompletionUsageCompletionTokensDetails.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** Breakdown of tokens used in a completion. */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class CompletionUsageCompletionTokensDetails // CHECKSTYLE:ON { @@ -90,11 +85,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * CompletionUsageCompletionTokensDetails} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -103,6 +100,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link CompletionUsageCompletionTokensDetails} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (reasoningTokens != null) declaredFields.put("reasoningTokens", reasoningTokens); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link CompletionUsageCompletionTokensDetails} instance. * If the map previously contained a mapping for the key, the old value is replaced by the @@ -117,7 +128,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -153,7 +164,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterChoiceResults.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterChoiceResults.java index 67e34cdba..9ff852f91 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterChoiceResults.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterChoiceResults.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -35,8 +31,7 @@ * about third party text and profanity, if it has been detected, and if it has been filtered or * not. And information about customer block list, if it has been filtered and its id. */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ContentFilterChoiceResults // CHECKSTYLE:ON { @@ -347,11 +342,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link ContentFilterChoiceResults} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -360,6 +357,29 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ContentFilterChoiceResults} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (sexual != null) declaredFields.put("sexual", sexual); + if (violence != null) declaredFields.put("violence", violence); + if (hate != null) declaredFields.put("hate", hate); + if (selfHarm != null) declaredFields.put("selfHarm", selfHarm); + if (profanity != null) declaredFields.put("profanity", profanity); + if (error != null) declaredFields.put("error", error); + if (protectedMaterialText != null) + declaredFields.put("protectedMaterialText", protectedMaterialText); + if (protectedMaterialCode != null) + declaredFields.put("protectedMaterialCode", protectedMaterialCode); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ContentFilterChoiceResults} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. @@ -373,7 +393,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -436,7 +456,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterDetectedResult.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterDetectedResult.java index 86036ca79..3b4b7ab03 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterDetectedResult.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterDetectedResult.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** ContentFilterDetectedResult */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ContentFilterDetectedResult // CHECKSTYLE:ON { @@ -122,11 +117,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link ContentFilterDetectedResult} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -135,6 +132,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ContentFilterDetectedResult} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filtered != null) declaredFields.put("filtered", filtered); + if (detected != null) declaredFields.put("detected", detected); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ContentFilterDetectedResult} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. @@ -148,7 +160,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -184,7 +196,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterDetectedWithCitationResult.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterDetectedWithCitationResult.java index 18717f63a..223d435c3 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterDetectedWithCitationResult.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterDetectedWithCitationResult.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** ContentFilterDetectedWithCitationResult */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ContentFilterDetectedWithCitationResult // CHECKSTYLE:ON { @@ -160,11 +155,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * ContentFilterDetectedWithCitationResult} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -173,6 +170,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ContentFilterDetectedWithCitationResult} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filtered != null) declaredFields.put("filtered", filtered); + if (detected != null) declaredFields.put("detected", detected); + if (citation != null) declaredFields.put("citation", citation); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ContentFilterDetectedWithCitationResult} * instance. If the map previously contained a mapping for the key, the old value is replaced by @@ -187,7 +200,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -226,7 +239,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterDetectedWithCitationResultAllOfCitation.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterDetectedWithCitationResultAllOfCitation.java index 97bcad999..262da2c80 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterDetectedWithCitationResultAllOfCitation.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterDetectedWithCitationResultAllOfCitation.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** ContentFilterDetectedWithCitationResultAllOfCitation */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ContentFilterDetectedWithCitationResultAllOfCitation // CHECKSTYLE:ON { @@ -128,11 +123,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * ContentFilterDetectedWithCitationResultAllOfCitation} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -143,6 +140,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link + * ContentFilterDetectedWithCitationResultAllOfCitation} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (URL != null) declaredFields.put("URL", URL); + if (license != null) declaredFields.put("license", license); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link * ContentFilterDetectedWithCitationResultAllOfCitation} instance. If the map previously contained @@ -157,7 +170,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -197,7 +210,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterPromptResults.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterPromptResults.java index 619e16e46..aac5e16d3 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterPromptResults.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterPromptResults.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -35,8 +31,7 @@ * about jailbreak content and profanity, if it has been detected, and if it has been filtered or * not. And information about customer block list, if it has been filtered and its id. */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ContentFilterPromptResults // CHECKSTYLE:ON { @@ -303,11 +298,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link ContentFilterPromptResults} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -316,6 +313,26 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ContentFilterPromptResults} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (sexual != null) declaredFields.put("sexual", sexual); + if (violence != null) declaredFields.put("violence", violence); + if (hate != null) declaredFields.put("hate", hate); + if (selfHarm != null) declaredFields.put("selfHarm", selfHarm); + if (profanity != null) declaredFields.put("profanity", profanity); + if (error != null) declaredFields.put("error", error); + if (jailbreak != null) declaredFields.put("jailbreak", jailbreak); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ContentFilterPromptResults} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. @@ -329,7 +346,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -376,7 +393,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterResultBase.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterResultBase.java index d25703d53..4d6369eba 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterResultBase.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterResultBase.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** ContentFilterResultBase */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ContentFilterResultBase // CHECKSTYLE:ON { @@ -85,11 +80,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link ContentFilterResultBase} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -98,6 +95,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ContentFilterResultBase} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filtered != null) declaredFields.put("filtered", filtered); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ContentFilterResultBase} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. @@ -111,7 +122,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -144,7 +155,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterResultsBase.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterResultsBase.java index b2b5fcd8d..da3935388 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterResultsBase.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterResultsBase.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** Information about the content filtering results. */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ContentFilterResultsBase // CHECKSTYLE:ON { @@ -258,11 +253,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link ContentFilterResultsBase} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -271,6 +268,25 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ContentFilterResultsBase} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (sexual != null) declaredFields.put("sexual", sexual); + if (violence != null) declaredFields.put("violence", violence); + if (hate != null) declaredFields.put("hate", hate); + if (selfHarm != null) declaredFields.put("selfHarm", selfHarm); + if (profanity != null) declaredFields.put("profanity", profanity); + if (error != null) declaredFields.put("error", error); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ContentFilterResultsBase} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. @@ -284,7 +300,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -327,7 +343,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterSeverityResult.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterSeverityResult.java index 33a883022..d7bae8322 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterSeverityResult.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ContentFilterSeverityResult.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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; @@ -31,8 +27,7 @@ import javax.annotation.Nullable; /** ContentFilterSeverityResult */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ContentFilterSeverityResult // CHECKSTYLE:ON { @@ -187,11 +182,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link ContentFilterSeverityResult} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -200,6 +197,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ContentFilterSeverityResult} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filtered != null) declaredFields.put("filtered", filtered); + if (severity != null) declaredFields.put("severity", severity); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ContentFilterSeverityResult} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. @@ -213,7 +225,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -249,7 +261,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionRequest.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionRequest.java index 8f8f3ca5c..508d2e903 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionRequest.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionRequest.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; @@ -33,8 +29,7 @@ import javax.annotation.Nullable; /** CreateChatCompletionRequest */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class CreateChatCompletionRequest // CHECKSTYLE:ON { @@ -71,9 +66,6 @@ public class CreateChatCompletionRequest @JsonProperty("messages") private List messages = new ArrayList<>(); - // @JsonProperty("data_sources") // IGNORED TODO - // private List dataSources = new ArrayList<>(); - @JsonProperty("logprobs") private Boolean logprobs = false; @@ -1021,11 +1013,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link CreateChatCompletionRequest} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -1034,6 +1028,41 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link CreateChatCompletionRequest} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (temperature != null) declaredFields.put("temperature", temperature); + if (topP != null) declaredFields.put("topP", topP); + if (stream != null) declaredFields.put("stream", stream); + if (stop != null) declaredFields.put("stop", stop); + if (maxTokens != null) declaredFields.put("maxTokens", maxTokens); + if (maxCompletionTokens != null) declaredFields.put("maxCompletionTokens", maxCompletionTokens); + if (presencePenalty != null) declaredFields.put("presencePenalty", presencePenalty); + if (frequencyPenalty != null) declaredFields.put("frequencyPenalty", frequencyPenalty); + if (logitBias != null) declaredFields.put("logitBias", logitBias); + if (user != null) declaredFields.put("user", user); + if (messages != null) declaredFields.put("messages", messages); + if (logprobs != null) declaredFields.put("logprobs", logprobs); + if (topLogprobs != null) declaredFields.put("topLogprobs", topLogprobs); + if (n != null) declaredFields.put("n", n); + if (parallelToolCalls != null) declaredFields.put("parallelToolCalls", parallelToolCalls); + if (responseFormat != null) declaredFields.put("responseFormat", responseFormat); + if (seed != null) declaredFields.put("seed", seed); + if (streamOptions != null) declaredFields.put("streamOptions", streamOptions); + if (tools != null) declaredFields.put("tools", tools); + if (toolChoice != null) declaredFields.put("toolChoice", toolChoice); + if (functionCall != null) declaredFields.put("functionCall", functionCall); + if (functions != null) declaredFields.put("functions", functions); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link CreateChatCompletionRequest} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. @@ -1047,7 +1076,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -1148,7 +1177,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionRequestAllOfFunctionCall.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionRequestAllOfFunctionCall.java index 90bb8fa08..7edfa6b19 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionRequestAllOfFunctionCall.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionRequestAllOfFunctionCall.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -16,8 +11,8 @@ package com.sap.ai.sdk.foundationmodels.openai.generated.model; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; +import javax.annotation.Nonnull; /** * Deprecated in favor of `tool_choice`. Controls which (if any) function is called by the @@ -30,13 +25,14 @@ * @deprecated */ @Deprecated -@com.google.common.annotations.Beta +@Beta public interface CreateChatCompletionRequestAllOfFunctionCall { /** * Helper class to create a ChatCompletionFunctionCallOption that implements {@link * CreateChatCompletionRequestAllOfFunctionCall}. */ - record InnerChatCompletionFunctionCallOption(@JsonValue ChatCompletionFunctionCallOption value) + record InnerChatCompletionFunctionCallOption( + @com.fasterxml.jackson.annotation.JsonValue @Nonnull ChatCompletionFunctionCallOption value) implements CreateChatCompletionRequestAllOfFunctionCall {} /** @@ -45,8 +41,10 @@ record InnerChatCompletionFunctionCallOption(@JsonValue ChatCompletionFunctionCa * @param val the value to use * @return a new instance of {@link InnerChatCompletionFunctionCallOption}. */ - @JsonCreator - static InnerChatCompletionFunctionCallOption create(ChatCompletionFunctionCallOption val) { + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerChatCompletionFunctionCallOption create( + @Nonnull final ChatCompletionFunctionCallOption val) { return new InnerChatCompletionFunctionCallOption(val); } @@ -54,7 +52,7 @@ static InnerChatCompletionFunctionCallOption create(ChatCompletionFunctionCallOp * Helper class to create a String that implements {@link * CreateChatCompletionRequestAllOfFunctionCall}. */ - record InnerString(@JsonValue String value) + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements CreateChatCompletionRequestAllOfFunctionCall {} /** @@ -63,8 +61,9 @@ record InnerString(@JsonValue String value) * @param val the value to use * @return a new instance of {@link InnerString}. */ - @JsonCreator - static InnerString create(String val) { + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerString create(@Nonnull final String val) { return new InnerString(val); } } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionRequestAllOfResponseFormat.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionRequestAllOfResponseFormat.java index 316ff6694..be7520f5b 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionRequestAllOfResponseFormat.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionRequestAllOfResponseFormat.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.google.common.annotations.Beta; /** * An object specifying the format that the model must output. Compatible with @@ -40,11 +36,11 @@ * indicates the generation exceeded `max_tokens` or the conversation exceeded the max * context length. */ +@Beta @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) @JsonSubTypes({ @JsonSubTypes.Type(value = ResponseFormatJsonObject.class), @JsonSubTypes.Type(value = ResponseFormatJsonSchema.class), @JsonSubTypes.Type(value = ResponseFormatText.class), }) -@com.google.common.annotations.Beta public interface CreateChatCompletionRequestAllOfResponseFormat {} diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionRequestAllOfStop.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionRequestAllOfStop.java index eb5c506ba..7e85f1620 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionRequestAllOfStop.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionRequestAllOfStop.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -16,15 +11,17 @@ package com.sap.ai.sdk.foundationmodels.openai.generated.model; +import com.google.common.annotations.Beta; import java.util.List; +import javax.annotation.Nonnull; /** Up to 4 sequences where the API will stop generating further tokens. */ -@com.google.common.annotations.Beta +@Beta public interface CreateChatCompletionRequestAllOfStop { /** * Helper class to create a String that implements {@link CreateChatCompletionRequestAllOfStop}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue String value) + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) implements CreateChatCompletionRequestAllOfStop {} /** @@ -34,7 +31,8 @@ record InnerString(@com.fasterxml.jackson.annotation.JsonValue String value) * @return a new instance of {@link InnerString}. */ @com.fasterxml.jackson.annotation.JsonCreator - static InnerString create(String val) { + @Nonnull + static InnerString create(@Nonnull final String val) { return new InnerString(val); } @@ -42,7 +40,7 @@ static InnerString create(String val) { * Helper class to create a list of String that implements {@link * CreateChatCompletionRequestAllOfStop}. */ - record InnerStrings(@com.fasterxml.jackson.annotation.JsonValue List values) + record InnerStrings(@com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) implements CreateChatCompletionRequestAllOfStop {} /** @@ -52,7 +50,8 @@ record InnerStrings(@com.fasterxml.jackson.annotation.JsonValue List val * @return a new instance of {@link InnerStrings}. */ @com.fasterxml.jackson.annotation.JsonCreator - static InnerStrings create(List val) { + @Nonnull + static InnerStrings create(@Nonnull final List val) { return new InnerStrings(val); } } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionResponse.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionResponse.java index 84974cdd1..a302d94df 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionResponse.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionResponse.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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.ArrayList; import java.util.LinkedHashMap; import java.util.List; @@ -33,8 +29,7 @@ import javax.annotation.Nullable; /** Represents a chat completion response returned by model, based on the provided input. */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class CreateChatCompletionResponse implements ChatCompletionsCreate200Response // CHECKSTYLE:ON { @@ -60,6 +55,7 @@ public class CreateChatCompletionResponse implements ChatCompletionsCreate200Res public enum ObjectEnum { /** The CHAT_COMPLETION option of this CreateChatCompletionResponse */ CHAT_COMPLETION("chat.completion"), + /** The UNKNOWN_DEFAULT_OPEN_API option of this CreateChatCompletionResponse */ UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); @@ -437,11 +433,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link CreateChatCompletionResponse} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -450,6 +448,27 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link CreateChatCompletionResponse} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (promptFilterResults != null) declaredFields.put("promptFilterResults", promptFilterResults); + if (choices != null) declaredFields.put("choices", choices); + if (created != null) declaredFields.put("created", created); + if (model != null) declaredFields.put("model", model); + if (systemFingerprint != null) declaredFields.put("systemFingerprint", systemFingerprint); + if (_object != null) declaredFields.put("_object", _object); + if (usage != null) declaredFields.put("usage", usage); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link CreateChatCompletionResponse} instance. If the * map previously contained a mapping for the key, the old value is replaced by the specified @@ -464,7 +483,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -525,7 +544,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionResponseChoicesInner.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionResponseChoicesInner.java index 75a79d708..b1b3ae10f 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionResponseChoicesInner.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionResponseChoicesInner.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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; @@ -31,8 +27,7 @@ import javax.annotation.Nullable; /** CreateChatCompletionResponseChoicesInner */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class CreateChatCompletionResponseChoicesInner // CHECKSTYLE:ON { @@ -327,11 +322,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * CreateChatCompletionResponseChoicesInner} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -340,6 +337,25 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link CreateChatCompletionResponseChoicesInner} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (finishReason != null) declaredFields.put("finishReason", finishReason); + if (index != null) declaredFields.put("index", index); + if (message != null) declaredFields.put("message", message); + if (contentFilterResults != null) + declaredFields.put("contentFilterResults", contentFilterResults); + if (logprobs != null) declaredFields.put("logprobs", logprobs); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link CreateChatCompletionResponseChoicesInner} * instance. If the map previously contained a mapping for the key, the old value is replaced by @@ -354,7 +370,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -403,7 +419,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionResponseChoicesInnerLogprobs.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionResponseChoicesInnerLogprobs.java index a42cabedd..30e3f6f86 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionResponseChoicesInnerLogprobs.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionResponseChoicesInnerLogprobs.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -31,8 +27,7 @@ import javax.annotation.Nullable; /** Log probability information for the choice. */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class CreateChatCompletionResponseChoicesInnerLogprobs // CHECKSTYLE:ON { @@ -163,11 +158,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * CreateChatCompletionResponseChoicesInnerLogprobs} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -178,6 +175,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link + * CreateChatCompletionResponseChoicesInnerLogprobs} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (content != null) declaredFields.put("content", content); + if (refusal != null) declaredFields.put("refusal", refusal); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link CreateChatCompletionResponseChoicesInnerLogprobs} * instance. If the map previously contained a mapping for the key, the old value is replaced by @@ -192,7 +204,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -231,7 +243,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionStreamResponse.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionStreamResponse.java index 1be2ddcef..b2d04e4cf 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionStreamResponse.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionStreamResponse.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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.ArrayList; import java.util.LinkedHashMap; import java.util.List; @@ -36,8 +32,7 @@ * Represents a streamed chunk of a chat completion response returned by model, based on the * provided input. */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class CreateChatCompletionStreamResponse implements ChatCompletionsCreate200Response // CHECKSTYLE:ON { @@ -356,11 +351,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link CreateChatCompletionStreamResponse} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -369,6 +366,25 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link CreateChatCompletionStreamResponse} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (choices != null) declaredFields.put("choices", choices); + if (created != null) declaredFields.put("created", created); + if (model != null) declaredFields.put("model", model); + if (systemFingerprint != null) declaredFields.put("systemFingerprint", systemFingerprint); + if (_object != null) declaredFields.put("_object", _object); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link CreateChatCompletionStreamResponse} instance. If * the map previously contained a mapping for the key, the old value is replaced by the specified @@ -383,7 +399,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -430,7 +446,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionStreamResponseChoicesInner.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionStreamResponseChoicesInner.java index 3028e174f..a12436cfa 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionStreamResponseChoicesInner.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/CreateChatCompletionStreamResponseChoicesInner.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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; @@ -31,8 +27,7 @@ import javax.annotation.Nullable; /** CreateChatCompletionStreamResponseChoicesInner */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class CreateChatCompletionStreamResponseChoicesInner // CHECKSTYLE:ON { @@ -105,14 +100,14 @@ public String toString() { * @return The enum value of type CreateChatCompletionStreamResponseChoicesInner */ @JsonCreator - @Nonnull + @Nullable public static FinishReasonEnum fromValue(@Nonnull final String value) { for (FinishReasonEnum b : FinishReasonEnum.values()) { if (b.value.equals(value)) { return b; } } - return UNKNOWN_DEFAULT_OPEN_API; + return null; } } @@ -291,11 +286,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * CreateChatCompletionStreamResponseChoicesInner} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -304,6 +301,23 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link CreateChatCompletionStreamResponseChoicesInner} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (delta != null) declaredFields.put("delta", delta); + if (logprobs != null) declaredFields.put("logprobs", logprobs); + if (finishReason != null) declaredFields.put("finishReason", finishReason); + if (index != null) declaredFields.put("index", index); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link CreateChatCompletionStreamResponseChoicesInner} * instance. If the map previously contained a mapping for the key, the old value is replaced by @@ -318,7 +332,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -362,7 +376,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreate200Response.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreate200Response.java index 23abcc63e..58d857275 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreate200Response.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreate200Response.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -31,8 +27,7 @@ import javax.annotation.Nullable; /** EmbeddingsCreate200Response */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class EmbeddingsCreate200Response // CHECKSTYLE:ON { @@ -210,11 +205,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link EmbeddingsCreate200Response} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -223,6 +220,23 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link EmbeddingsCreate200Response} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (_object != null) declaredFields.put("_object", _object); + if (model != null) declaredFields.put("model", model); + if (data != null) declaredFields.put("data", data); + if (usage != null) declaredFields.put("usage", usage); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link EmbeddingsCreate200Response} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. @@ -236,7 +250,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -276,7 +290,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreate200ResponseDataInner.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreate200ResponseDataInner.java index 049ed7a17..5dd87f4b3 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreate200ResponseDataInner.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreate200ResponseDataInner.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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.Arrays; import java.util.LinkedHashMap; import java.util.Map; @@ -30,8 +26,7 @@ import javax.annotation.Nullable; /** EmbeddingsCreate200ResponseDataInner */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class EmbeddingsCreate200ResponseDataInner // CHECKSTYLE:ON { @@ -159,11 +154,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link * EmbeddingsCreate200ResponseDataInner} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -172,6 +169,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link EmbeddingsCreate200ResponseDataInner} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (index != null) declaredFields.put("index", index); + if (_object != null) declaredFields.put("_object", _object); + if (embedding != null) declaredFields.put("embedding", embedding); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link EmbeddingsCreate200ResponseDataInner} instance. * If the map previously contained a mapping for the key, the old value is replaced by the @@ -186,7 +199,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -225,7 +238,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreate200ResponseUsage.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreate200ResponseUsage.java index 2ca1cbc66..334fca6f8 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreate200ResponseUsage.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreate200ResponseUsage.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** EmbeddingsCreate200ResponseUsage */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class EmbeddingsCreate200ResponseUsage // CHECKSTYLE:ON { @@ -123,11 +118,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link EmbeddingsCreate200ResponseUsage} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -136,6 +133,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link EmbeddingsCreate200ResponseUsage} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (promptTokens != null) declaredFields.put("promptTokens", promptTokens); + if (totalTokens != null) declaredFields.put("totalTokens", totalTokens); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link EmbeddingsCreate200ResponseUsage} instance. If * the map previously contained a mapping for the key, the old value is replaced by the specified @@ -150,7 +162,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -187,7 +199,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreateRequest.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreateRequest.java index 223c7a340..b93f6eeea 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreateRequest.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreateRequest.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** EmbeddingsCreateRequest */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class EmbeddingsCreateRequest // CHECKSTYLE:ON { @@ -232,11 +227,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link EmbeddingsCreateRequest} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -245,6 +242,24 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link EmbeddingsCreateRequest} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (input != null) declaredFields.put("input", input); + if (user != null) declaredFields.put("user", user); + if (inputType != null) declaredFields.put("inputType", inputType); + if (encodingFormat != null) declaredFields.put("encodingFormat", encodingFormat); + if (dimensions != null) declaredFields.put("dimensions", dimensions); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link EmbeddingsCreateRequest} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. @@ -258,7 +273,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -271,14 +286,12 @@ public boolean equals(@Nullable final Object o) { && Objects.equals(this.user, embeddingsCreateRequest.user) && Objects.equals(this.inputType, embeddingsCreateRequest.inputType) && Objects.equals(this.encodingFormat, embeddingsCreateRequest.encodingFormat) - && Objects.equals(this.dimensions, embeddingsCreateRequest.dimensions) - && super.equals(o); + && Objects.equals(this.dimensions, embeddingsCreateRequest.dimensions); } @Override public int hashCode() { - return Objects.hash( - input, user, inputType, encodingFormat, dimensions, cloudSdkCustomFields, super.hashCode()); + return Objects.hash(input, user, inputType, encodingFormat, dimensions, cloudSdkCustomFields); } @Override @@ -286,7 +299,6 @@ public int hashCode() { public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("class EmbeddingsCreateRequest {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" input: ").append(toIndentedString(input)).append("\n"); sb.append(" user: ").append(toIndentedString(user)).append("\n"); sb.append(" inputType: ").append(toIndentedString(inputType)).append("\n"); @@ -302,7 +314,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreateRequestInput.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreateRequestInput.java index 88fd35ff0..aa0ca1164 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreateRequestInput.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/EmbeddingsCreateRequestInput.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -16,7 +11,9 @@ package com.sap.ai.sdk.foundationmodels.openai.generated.model; +import com.google.common.annotations.Beta; import java.util.List; +import javax.annotation.Nonnull; /** * Input text to get embeddings for, encoded as a string. To get embeddings for multiple inputs in a @@ -24,16 +21,11 @@ * Unless you are embedding code, we suggest replacing newlines (\\n) in your input with a single * space, as we have observed inferior results when newlines are present. */ -@com.google.common.annotations.Beta +@Beta public interface EmbeddingsCreateRequestInput { /** Helper class to create a String that implements {@link EmbeddingsCreateRequestInput}. */ - class InnerString implements EmbeddingsCreateRequestInput { - @com.fasterxml.jackson.annotation.JsonValue String value; - - InnerString(String value) { - this.value = value; - } - } + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) + implements EmbeddingsCreateRequestInput {} /** * Creator to enable deserialization of a String. @@ -42,14 +34,15 @@ class InnerString implements EmbeddingsCreateRequestInput { * @return a new instance of {@link InnerString}. */ @com.fasterxml.jackson.annotation.JsonCreator - static InnerString create(String val) { + @Nonnull + static InnerString create(@Nonnull final String val) { return new InnerString(val); } /** * Helper class to create a list of String that implements {@link EmbeddingsCreateRequestInput}. */ - record InnerStrings(@com.fasterxml.jackson.annotation.JsonValue List values) + record InnerStrings(@com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) implements EmbeddingsCreateRequestInput {} /** @@ -59,7 +52,8 @@ record InnerStrings(@com.fasterxml.jackson.annotation.JsonValue List val * @return a new instance of {@link InnerStrings}. */ @com.fasterxml.jackson.annotation.JsonCreator - static InnerStrings create(List val) { + @Nonnull + static InnerStrings create(@Nonnull final List val) { return new InnerStrings(val); } } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/Error.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/Error.java index ad5c15210..3e9bc1d17 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/Error.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/Error.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** Error */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class Error // CHECKSTYLE:ON { @@ -221,11 +216,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link Error} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("Error has no field with name '" + name + "'."); @@ -233,6 +230,24 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link Error} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (param != null) declaredFields.put("param", param); + if (type != null) declaredFields.put("type", type); + if (innerError != null) declaredFields.put("innerError", innerError); + if (code != null) declaredFields.put("code", code); + if (message != null) declaredFields.put("message", message); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link Error} instance. If the map previously contained * a mapping for the key, the old value is replaced by the specified value. @@ -246,7 +261,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -287,7 +302,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ErrorBase.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ErrorBase.java index 05f335292..54bc2dcaf 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ErrorBase.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ErrorBase.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** ErrorBase */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ErrorBase // CHECKSTYLE:ON { @@ -119,11 +114,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link ErrorBase} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("ErrorBase has no field with name '" + name + "'."); @@ -131,6 +128,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ErrorBase} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (code != null) declaredFields.put("code", code); + if (message != null) declaredFields.put("message", message); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ErrorBase} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. @@ -144,7 +156,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -179,7 +191,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ErrorResponse.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ErrorResponse.java index 65b53b096..90f42f3c8 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ErrorResponse.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ErrorResponse.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** ErrorResponse */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ErrorResponse // CHECKSTYLE:ON { @@ -85,11 +80,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link ErrorResponse} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("ErrorResponse has no field with name '" + name + "'."); @@ -97,6 +94,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ErrorResponse} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (error != null) declaredFields.put("error", error); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link ErrorResponse} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. @@ -110,7 +121,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -143,7 +154,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/FunctionObject.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/FunctionObject.java index a19d5bec6..c9d7ecaef 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/FunctionObject.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/FunctionObject.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -30,8 +26,7 @@ import javax.annotation.Nullable; /** FunctionObject */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class FunctionObject // CHECKSTYLE:ON { @@ -236,11 +231,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link FunctionObject} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("FunctionObject has no field with name '" + name + "'."); @@ -248,6 +245,23 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link FunctionObject} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (description != null) declaredFields.put("description", description); + if (name != null) declaredFields.put("name", name); + if (parameters != null) declaredFields.put("parameters", parameters); + if (strict != null) declaredFields.put("strict", strict); + return declaredFields; + } + /** * 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. @@ -261,7 +275,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -300,7 +314,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/InnerError.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/InnerError.java index 5f3332eaa..dd7476d65 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/InnerError.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/InnerError.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** Inner error with additional details. */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class InnerError // CHECKSTYLE:ON { @@ -121,11 +116,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link InnerError} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("InnerError has no field with name '" + name + "'."); @@ -133,6 +130,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link InnerError} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (code != null) declaredFields.put("code", code); + if (contentFilterResults != null) + declaredFields.put("contentFilterResults", contentFilterResults); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link InnerError} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. @@ -146,7 +159,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -183,7 +196,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/InnerErrorCode.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/InnerErrorCode.java index 9e504e49e..829158c33 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/InnerErrorCode.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/InnerErrorCode.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,15 +13,14 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; import javax.annotation.Nonnull; /** Error codes for the inner error object. */ -@com.google.common.annotations.Beta +@Beta public enum InnerErrorCode { - /** The RESPONSIBLE_AI_POLICY_VIOLATION option of this InnerErrorCode. */ RESPONSIBLE_AI_POLICY_VIOLATION("ResponsibleAIPolicyViolation"), - /** The UNKNOWN_DEFAULT_OPEN_API option of this InnerErrorCode. */ UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); private final String value; diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/PromptFilterResult.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/PromptFilterResult.java index d350317ff..f1467053a 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/PromptFilterResult.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/PromptFilterResult.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -29,8 +25,7 @@ import javax.annotation.Nullable; /** Content filtering results for a single prompt in the request. */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class PromptFilterResult // CHECKSTYLE:ON { @@ -123,11 +118,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link PromptFilterResult} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("PromptFilterResult has no field with name '" + name + "'."); @@ -135,6 +132,22 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link PromptFilterResult} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (promptIndex != null) declaredFields.put("promptIndex", promptIndex); + if (contentFilterResults != null) + declaredFields.put("contentFilterResults", contentFilterResults); + return declaredFields; + } + /** * Set an unrecognizable property of this {@link PromptFilterResult} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. @@ -148,7 +161,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -185,7 +198,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ResponseFormatJsonObject.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ResponseFormatJsonObject.java index 5e71a40bf..eba81b392 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ResponseFormatJsonObject.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ResponseFormatJsonObject.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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; @@ -31,8 +27,7 @@ import javax.annotation.Nullable; /** ResponseFormatJsonObject */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ResponseFormatJsonObject implements CreateChatCompletionRequestAllOfResponseFormat // CHECKSTYLE:ON { @@ -141,11 +136,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link ResponseFormatJsonObject} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -154,6 +151,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ResponseFormatJsonObject} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + return declaredFields; + } + /** * 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. @@ -167,7 +178,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -200,7 +211,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ResponseFormatJsonSchema.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ResponseFormatJsonSchema.java index 436ac065e..64b8b478e 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ResponseFormatJsonSchema.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ResponseFormatJsonSchema.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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; @@ -31,8 +27,7 @@ import javax.annotation.Nullable; /** ResponseFormatJsonSchema */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ResponseFormatJsonSchema implements CreateChatCompletionRequestAllOfResponseFormat // CHECKSTYLE:ON { @@ -177,11 +172,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link ResponseFormatJsonSchema} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -190,6 +187,21 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ResponseFormatJsonSchema} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (jsonSchema != null) declaredFields.put("jsonSchema", jsonSchema); + return declaredFields; + } + /** * 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. @@ -203,7 +215,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -238,7 +250,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ResponseFormatJsonSchemaJsonSchema.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ResponseFormatJsonSchemaJsonSchema.java index 9b29da1fd..e60503e2c 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ResponseFormatJsonSchemaJsonSchema.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ResponseFormatJsonSchemaJsonSchema.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,6 +15,7 @@ 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; @@ -30,8 +26,7 @@ import javax.annotation.Nullable; /** ResponseFormatJsonSchemaJsonSchema */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ResponseFormatJsonSchemaJsonSchema // CHECKSTYLE:ON { @@ -226,11 +221,13 @@ public Set getCustomFieldNames() { * Get the value of an unrecognizable property of this {@link ResponseFormatJsonSchemaJsonSchema} * instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( @@ -239,6 +236,23 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ResponseFormatJsonSchemaJsonSchema} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (description != null) declaredFields.put("description", description); + if (name != null) declaredFields.put("name", name); + if (schema != null) declaredFields.put("schema", schema); + if (strict != null) declaredFields.put("strict", strict); + return declaredFields; + } + /** * 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 @@ -253,7 +267,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -294,7 +308,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ResponseFormatText.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ResponseFormatText.java index e783ddd42..de99adc49 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ResponseFormatText.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ResponseFormatText.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +17,7 @@ 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; @@ -31,8 +27,7 @@ import javax.annotation.Nullable; /** ResponseFormatText */ -// CHECKSTYLE:OFF -@com.google.common.annotations.Beta +@Beta // CHECKSTYLE:OFF public class ResponseFormatText implements CreateChatCompletionRequestAllOfResponseFormat // CHECKSTYLE:ON { @@ -141,11 +136,13 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link ResponseFormatText} instance. * + * @deprecated Use {@link #toMap()} instead. * @param name The name of the property * @return The value of the property * @throws NoSuchElementException If no property with the given name could be found. */ @Nullable + @Deprecated public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException("ResponseFormatText has no field with name '" + name + "'."); @@ -153,6 +150,20 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc return cloudSdkCustomFields.get(name); } + /** + * Get the value of all properties of this {@link ResponseFormatText} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + return declaredFields; + } + /** * 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. @@ -166,7 +177,7 @@ public void setCustomField(@Nonnull String customFieldName, @Nullable Object cus } @Override - public boolean equals(@Nullable final Object o) { + public boolean equals(@Nullable final java.lang.Object o) { if (this == o) { return true; } @@ -199,7 +210,7 @@ public String toString() { /** * Convert the given object to string with each line indented by 4 spaces (except the first line). */ - private String toIndentedString(final Object o) { + private String toIndentedString(final java.lang.Object o) { if (o == null) { return "null"; } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ToolCallType.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ToolCallType.java index 5c38a9fa9..ccedc88fb 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ToolCallType.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ToolCallType.java @@ -1,12 +1,7 @@ -/* - * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. - */ - /* * Azure OpenAI Service API * Azure OpenAI APIs for completions and search * - * The version of the OpenAPI document: 2024-10-21 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,15 +13,14 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.google.common.annotations.Beta; import javax.annotation.Nonnull; /** The type of the tool call, in this case `function`. */ -@com.google.common.annotations.Beta +@Beta public enum ToolCallType { - /** The FUNCTION option of this ToolCallType. */ FUNCTION("function"), - /** The UNKNOWN_DEFAULT_OPEN_API option of this ToolCallType. */ UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); private final String value; diff --git a/foundation-models/openai/src/main/resources/spec/openapi-2024-10-21.yaml b/foundation-models/openai/src/main/resources/spec/openapi-2024-10-21.yaml new file mode 100644 index 000000000..22eb458af --- /dev/null +++ b/foundation-models/openai/src/main/resources/spec/openapi-2024-10-21.yaml @@ -0,0 +1,2600 @@ +openapi: 3.0.0 +info: + title: Azure OpenAI Service API + description: Azure OpenAI APIs for completions and search + version: '2024-10-21' +servers: + - url: https://{endpoint}/openai + variables: + endpoint: + default: your-resource-name.openai.azure.com +security: + - bearer: + - api.read + - apiKey: [] +paths: + /deployments/{deployment-id}/completions: + post: + summary: Creates a completion for the provided prompt, parameters and chosen model. + operationId: Completions_Create + parameters: + - in: path + name: deployment-id + required: true + schema: + type: string + example: davinci + description: Deployment id of the model which was deployed. + - in: query + name: api-version + required: true + schema: + type: string + example: 2024-10-21 + description: api version + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/createCompletionRequest" + example: + prompt: |- + Negate the following sentence.The price for bubblegum increased on thursday. + + Negated Sentence: + max_tokens: 50 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/createCompletionResponse" + example: + model: davinci + object: text_completion + id: cmpl-4509KAos68kxOqpE2uYGw81j6m7uo + created: 1637097562 + choices: + - index: 0 + text: The price for bubblegum decreased on thursday. + logprobs: null + finish_reason: stop + headers: + apim-request-id: + description: Request ID for troubleshooting purposes + schema: + type: string + default: + description: Service unavailable + content: + application/json: + schema: + $ref: "#/components/schemas/errorResponse" + headers: + apim-request-id: + description: Request ID for troubleshooting purposes + schema: + type: string + /deployments/{deployment-id}/embeddings: + post: + summary: Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. + operationId: embeddings_create + parameters: + - in: path + name: deployment-id + required: true + schema: + type: string + example: ada-search-index-v1 + description: The deployment id of the model which was deployed. + - in: query + name: api-version + required: true + schema: + type: string + example: '2024-10-21' + description: api version + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: true + properties: + input: + description: |- + Input text to get embeddings for, encoded as a string. To get embeddings for multiple inputs in a single request, pass an array of strings. Each input must not exceed 2048 tokens in length. + Unless you are embedding code, we suggest replacing newlines (\n) in your input with a single space, as we have observed inferior results when newlines are present. + oneOf: + - type: string + default: "" + example: This is a test. + nullable: true + - type: array + minItems: 1 + maxItems: 2048 + items: + type: string + minLength: 1 + example: This is a test. + nullable: false + user: + description: A unique identifier representing your end-user, which can help monitoring and detecting abuse. + type: string + nullable: false + input_type: + description: input type of embedding search to use + type: string + example: query + encoding_format: + description: The format to return the embeddings in. Can be either `float` or `base64`. Defaults to `float`. + type: string + example: base64 + nullable: true + dimensions: + description: The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models. + type: integer + example: 1 + nullable: true + required: + - input + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + object: + type: string + model: + type: string + data: + type: array + items: + type: object + properties: + index: + type: integer + object: + type: string + embedding: + type: array + items: + type: number + required: + - index + - object + - embedding + usage: + type: object + properties: + prompt_tokens: + type: integer + total_tokens: + type: integer + required: + - prompt_tokens + - total_tokens + required: + - object + - model + - data + - usage + x-ms-examples: + Create a embeddings.: + $ref: ./examples/embeddings.yaml + /deployments/{deployment-id}/chat/completions: + post: + summary: Creates a completion for the chat message + operationId: ChatCompletions_Create + parameters: + - in: path + name: deployment-id + required: true + schema: + type: string + description: Deployment id of the model which was deployed. + - in: query + name: api-version + required: true + schema: + type: string + example: '2024-10-21' + description: api version + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/createChatCompletionRequest" + responses: + "200": + description: OK + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/createChatCompletionResponse" + - $ref: "#/components/schemas/createChatCompletionStreamResponse" + headers: + apim-request-id: + description: Request ID for troubleshooting purposes + schema: + type: string + default: + description: Service unavailable + content: + application/json: + schema: + $ref: "#/components/schemas/errorResponse" + headers: + apim-request-id: + description: Request ID for troubleshooting purposes + schema: + type: string + x-ms-examples: + Create a chat completion.: + $ref: ./examples/chat_completions.yaml + Creates a completion based on Azure Search data and system-assigned managed identity.: + $ref: ./examples/chat_completions_azure_search_minimum.yaml + Creates a completion based on Azure Search vector data, previous assistant message and user-assigned managed identity.: + $ref: ./examples/chat_completions_azure_search_advanced.yaml + Creates a completion for the provided Azure Cosmos DB.: + $ref: ./examples/chat_completions_cosmos_db.yaml + /deployments/{deployment-id}/audio/transcriptions: + post: + summary: Transcribes audio into the input language. + operationId: Transcriptions_Create + parameters: + - in: path + name: deployment-id + required: true + schema: + type: string + example: whisper + description: Deployment id of the whisper model. + - in: query + name: api-version + required: true + schema: + type: string + example: '2024-10-21' + description: api version + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/createTranscriptionRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/audioResponse' + - $ref: '#/components/schemas/audioVerboseResponse' + text/plain: + schema: + type: string + description: Transcribed text in the output format (when response_format was one of text, vtt or srt). + x-ms-examples: + Create an audio transcription with json response format.: + $ref: ./examples/audio_transcription_object.yaml + Create an audio transcription with text response format.: + $ref: ./examples/audio_transcription_text.yaml + /deployments/{deployment-id}/audio/translations: + post: + summary: Transcribes and translates input audio into English text. + operationId: Translations_Create + parameters: + - in: path + name: deployment-id + required: true + schema: + type: string + example: whisper + description: Deployment id of the whisper model which was deployed. + - in: query + name: api-version + required: true + schema: + type: string + example: '2024-10-21' + description: api version + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/createTranslationRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/audioResponse' + - $ref: '#/components/schemas/audioVerboseResponse' + text/plain: + schema: + type: string + description: Transcribed text in the output format (when response_format was one of text, vtt or srt). + x-ms-examples: + Create an audio translation with json response format.: + $ref: ./examples/audio_translation_object.yaml + Create an audio translation with text response format.: + $ref: ./examples/audio_translation_text.yaml + /deployments/{deployment-id}/images/generations: + post: + summary: Generates a batch of images from a text caption on a given DALLE model deployment + operationId: ImageGenerations_Create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/imageGenerationsRequest' + parameters: + - in: path + name: deployment-id + required: true + schema: + type: string + example: dalle-deployment + description: Deployment id of the dalle model which was deployed. + - in: query + name: api-version + required: true + schema: + type: string + example: '2024-10-21' + description: api version + responses: + '200': + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/generateImagesResponse' + default: + description: An error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/dalleErrorResponse' + x-ms-examples: + Create an image.: + $ref: ./examples/image_generation.yaml +components: + schemas: + errorResponse: + type: object + properties: + error: + $ref: "#/components/schemas/error" + errorBase: + type: object + properties: + code: + type: string + message: + type: string + error: + type: object + allOf: + - $ref: "#/components/schemas/errorBase" + properties: + param: + type: string + type: + type: string + inner_error: + $ref: "#/components/schemas/innerError" + innerError: + description: Inner error with additional details. + type: object + properties: + code: + $ref: "#/components/schemas/innerErrorCode" + content_filter_results: + $ref: "#/components/schemas/contentFilterPromptResults" + innerErrorCode: + description: Error codes for the inner error object. + enum: + - ResponsibleAIPolicyViolation + type: string + x-ms-enum: + name: InnerErrorCode + modelAsString: true + values: + - value: ResponsibleAIPolicyViolation + description: The prompt violated one of more content filter rules. + dalleErrorResponse: + type: object + properties: + error: + $ref: "#/components/schemas/dalleError" + dalleError: + type: object + allOf: + - $ref: "#/components/schemas/errorBase" + properties: + param: + type: string + type: + type: string + inner_error: + $ref: "#/components/schemas/dalleInnerError" + dalleInnerError: + description: Inner error with additional details. + type: object + properties: + code: + $ref: "#/components/schemas/innerErrorCode" + content_filter_results: + $ref: "#/components/schemas/dalleFilterResults" + revised_prompt: + type: string + description: The prompt that was used to generate the image, if there was any revision to the prompt. + contentFilterResultBase: + type: object + properties: + filtered: + type: boolean + required: + - filtered + contentFilterSeverityResult: + type: object + allOf: + - $ref: "#/components/schemas/contentFilterResultBase" + - properties: + severity: + type: string + enum: + - safe + - low + - medium + - high + x-ms-enum: + name: ContentFilterSeverity + modelAsString: true + values: + - value: safe + description: General content or related content in generic or non-harmful contexts. + - value: low + description: Harmful content at a low intensity and risk level. + - value: medium + description: Harmful content at a medium intensity and risk level. + - value: high + description: Harmful content at a high intensity and risk level. + required: + - severity + - filtered + contentFilterDetectedResult: + type: object + allOf: + - $ref: "#/components/schemas/contentFilterResultBase" + - properties: + detected: + type: boolean + required: + - detected + - filtered + contentFilterDetectedWithCitationResult: + type: object + allOf: + - $ref: "#/components/schemas/contentFilterDetectedResult" + - properties: + citation: + type: object + properties: + URL: + type: string + license: + type: string + required: + - detected + - filtered + contentFilterResultsBase: + type: object + description: Information about the content filtering results. + properties: + sexual: + $ref: "#/components/schemas/contentFilterSeverityResult" + violence: + $ref: "#/components/schemas/contentFilterSeverityResult" + hate: + $ref: "#/components/schemas/contentFilterSeverityResult" + self_harm: + $ref: "#/components/schemas/contentFilterSeverityResult" + profanity: + $ref: "#/components/schemas/contentFilterDetectedResult" + error: + $ref: "#/components/schemas/errorBase" + contentFilterPromptResults: + type: object + description: Information about the content filtering category (hate, sexual, violence, self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that determines the intensity and risk level of harmful content) and if it has been filtered or not. Information about jailbreak content and profanity, if it has been detected, and if it has been filtered or not. And information about customer block list, if it has been filtered and its id. + allOf: + - $ref: "#/components/schemas/contentFilterResultsBase" + - properties: + jailbreak: + $ref: "#/components/schemas/contentFilterDetectedResult" + contentFilterChoiceResults: + type: object + description: Information about the content filtering category (hate, sexual, violence, self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that determines the intensity and risk level of harmful content) and if it has been filtered or not. Information about third party text and profanity, if it has been detected, and if it has been filtered or not. And information about customer block list, if it has been filtered and its id. + allOf: + - $ref: "#/components/schemas/contentFilterResultsBase" + - properties: + protected_material_text: + $ref: "#/components/schemas/contentFilterDetectedResult" + - properties: + protected_material_code: + $ref: "#/components/schemas/contentFilterDetectedWithCitationResult" + promptFilterResult: + type: object + description: Content filtering results for a single prompt in the request. + properties: + prompt_index: + type: integer + content_filter_results: + $ref: "#/components/schemas/contentFilterPromptResults" + promptFilterResults: + type: array + description: Content filtering results for zero or more prompts in the request. In a streaming request, results for different prompts may arrive at different times or in different orders. + items: + $ref: "#/components/schemas/promptFilterResult" + dalleContentFilterResults: + type: object + description: Information about the content filtering results. + properties: + sexual: + $ref: "#/components/schemas/contentFilterSeverityResult" + violence: + $ref: "#/components/schemas/contentFilterSeverityResult" + hate: + $ref: "#/components/schemas/contentFilterSeverityResult" + self_harm: + $ref: "#/components/schemas/contentFilterSeverityResult" + dalleFilterResults: + type: object + description: Information about the content filtering category (hate, sexual, violence, self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that determines the intensity and risk level of harmful content) and if it has been filtered or not. Information about jailbreak content and profanity, if it has been detected, and if it has been filtered or not. And information about customer block list, if it has been filtered and its id. + allOf: + - $ref: "#/components/schemas/dalleContentFilterResults" + - properties: + profanity: + $ref: "#/components/schemas/contentFilterDetectedResult" + jailbreak: + $ref: "#/components/schemas/contentFilterDetectedResult" + chatCompletionsRequestCommon: + type: object + properties: + temperature: + description: |- + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + We generally recommend altering this or `top_p` but not both. + type: number + minimum: 0 + maximum: 2 + default: 1 + example: 1 + nullable: true + top_p: + description: |- + An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + We generally recommend altering this or `temperature` but not both. + type: number + minimum: 0 + maximum: 1 + default: 1 + example: 1 + nullable: true + stream: + description: "If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a `data: [DONE]` message." + type: boolean + nullable: true + default: false + stop: + description: Up to 4 sequences where the API will stop generating further tokens. + oneOf: + - type: string + nullable: true + - type: array + items: + type: string + nullable: false + minItems: 1 + maxItems: 4 + description: Array minimum size of 1 and maximum of 4 + default: null + max_tokens: + description: | + The maximum number of tokens allowed for the generated answer. By default, the number of tokens the model can return will be (4096 - prompt tokens). + + This value is now deprecated in favor of `max_completion_tokens`, and is not compatible with o1 series models. + type: integer + default: 4096 + max_completion_tokens: + description: | + An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. + + type: integer + nullable: true + presence_penalty: + description: Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + type: number + default: 0 + minimum: -2 + maximum: 2 + frequency_penalty: + description: Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + type: number + default: 0 + minimum: -2 + maximum: 2 + logit_bias: + description: Modify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. + type: object + nullable: true + user: + description: A unique identifier representing your end-user, which can help Azure OpenAI to monitor and detect abuse. + type: string + example: user-1234 + nullable: false + createCompletionRequest: + type: object + properties: + prompt: + description: &completions_prompt_description | + The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays. + + Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document. + default: "<|endoftext|>" + nullable: true + oneOf: + - type: string + default: "" + example: "This is a test." + - type: array + items: + type: string + default: "" + example: "This is a test." + best_of: + type: integer + default: 1 + minimum: 0 + maximum: 20 + nullable: true + description: &completions_best_of_description | + Generates `best_of` completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed. + + When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`. + + **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. + echo: + type: boolean + default: false + nullable: true + description: &completions_echo_description > + Echo back the prompt in addition to the completion + frequency_penalty: + type: number + default: 0 + minimum: -2 + maximum: 2 + nullable: true + description: &completions_frequency_penalty_description | + Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + + logit_bias: &completions_logit_bias + type: object + x-oaiTypeLabel: map + default: null + nullable: true + additionalProperties: + type: integer + description: &completions_logit_bias_description | + Modify the likelihood of specified tokens appearing in the completion. + + Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](https://platform.openai.com/tokenizer?view=bpe) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. + + As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token from being generated. + logprobs: &completions_logprobs_configuration + type: integer + minimum: 0 + maximum: 5 + default: null + nullable: true + description: &completions_logprobs_description | + Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. + + The maximum value for `logprobs` is 5. + max_tokens: + type: integer + minimum: 0 + default: 16 + example: 16 + nullable: true + description: &completions_max_tokens_description | + The maximum number of [tokens](https://platform.openai.com/tokenizer) that can be generated in the completion. + + The token count of your prompt plus `max_tokens` cannot exceed the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. + n: + type: integer + minimum: 1 + maximum: 128 + default: 1 + example: 1 + nullable: true + description: &completions_completions_description | + How many completions to generate for each prompt. + + **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. + presence_penalty: + type: number + default: 0 + minimum: -2 + maximum: 2 + nullable: true + description: &completions_presence_penalty_description | + Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + seed: &completions_seed_param + type: integer + minimum: -9223372036854775808 + maximum: 9223372036854775807 + nullable: true + description: | + If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. + + Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. + stop: + description: &completions_stop_description > + Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + default: null + nullable: true + oneOf: + - type: string + default: <|endoftext|> + example: "\n" + nullable: true + - type: array + minItems: 1 + maxItems: 4 + items: + type: string + example: '["\n"]' + stream: + description: > + Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) + as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). + type: boolean + nullable: true + default: false + suffix: + description: | + The suffix that comes after a completion of inserted text. + + This parameter is only supported for `gpt-3.5-turbo-instruct`. + default: null + nullable: true + type: string + example: "test." + stream_options: + $ref: "#/components/schemas/chatCompletionStreamOptions" + temperature: + type: number + minimum: 0 + maximum: 2 + default: 1 + example: 1 + nullable: true + description: &completions_temperature_description | + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + + We generally recommend altering this or `top_p` but not both. + top_p: + type: number + minimum: 0 + maximum: 1 + default: 1 + example: 1 + nullable: true + description: &completions_top_p_description | + An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or `temperature` but not both. + user: &end_user_param_configuration + type: string + example: user-1234 + description: | + A unique identifier representing your end-user, which can help to monitor and detect abuse. + required: + - prompt + + createCompletionResponse: + type: object + description: | + Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint). + properties: + id: + type: string + description: A unique identifier for the completion. + choices: + type: array + description: The list of completion choices the model generated for the input prompt. + items: + type: object + required: + - finish_reason + - index + - logprobs + - text + properties: + finish_reason: + type: string + description: &completion_finish_reason_description | + The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, + `length` if the maximum number of tokens specified in the request was reached, + or `content_filter` if content was omitted due to a flag from our content filters. + enum: ["stop", "length", "content_filter"] + index: + type: integer + logprobs: + type: object + nullable: true + properties: + text_offset: + type: array + items: + type: integer + token_logprobs: + type: array + items: + type: number + tokens: + type: array + items: + type: string + top_logprobs: + type: array + items: + type: object + additionalProperties: + type: number + text: + type: string + content_filter_results: + $ref: "#/components/schemas/contentFilterChoiceResults" + created: + type: integer + description: The Unix timestamp (in seconds) of when the completion was created. + model: + type: string + description: The model used for completion. + prompt_filter_results: + $ref: "#/components/schemas/promptFilterResults" + system_fingerprint: + type: string + description: | + This fingerprint represents the backend configuration that the model runs with. + + Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + object: + type: string + description: The object type, which is always "text_completion" + enum: [text_completion] + usage: + $ref: "#/components/schemas/completionUsage" + required: + - id + - object + - created + - model + - choices + + createChatCompletionRequest: + type: object + allOf: + - $ref: "#/components/schemas/chatCompletionsRequestCommon" + - properties: + messages: + description: A list of messages comprising the conversation so far. [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_format_inputs_to_ChatGPT_models.ipynb). + type: array + minItems: 1 + items: + $ref: "#/components/schemas/chatCompletionRequestMessage" + data_sources: + type: array + description: |2- + The configuration entries for Azure OpenAI chat extensions that use them. + This additional specification is only compatible with Azure OpenAI. + items: + $ref: "#/components/schemas/azureChatExtensionConfiguration" + frequency_penalty: + type: number + default: 0 + minimum: -2 + maximum: 2 + nullable: true + description: *completions_frequency_penalty_description + logit_bias: + type: object + default: null + nullable: true + additionalProperties: + type: integer + description: | + Modify the likelihood of specified tokens appearing in the completion. + + Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. + logprobs: + description: Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`. + type: boolean + default: false + nullable: true + top_logprobs: + description: An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used. + type: integer + minimum: 0 + maximum: 20 + nullable: true + max_tokens: + description: | + The maximum number of [tokens](/tokenizer) that can be generated in the chat completion. + + The total length of input tokens and generated tokens is limited by the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. + type: integer + nullable: true + n: + type: integer + minimum: 1 + maximum: 128 + default: 1 + example: 1 + nullable: true + description: How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs. + parallel_tool_calls: + $ref: "#/components/schemas/ParallelToolCalls" + presence_penalty: + type: number + default: 0 + minimum: -2 + maximum: 2 + nullable: true + description: *completions_presence_penalty_description + response_format: + description: | + An object specifying the format that the model must output. Compatible with [GPT-4o](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#gpt-4-and-gpt-4-turbo-models), [GPT-4o mini](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#gpt-4-and-gpt-4-turbo-models), [GPT-4 Turbo](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#gpt-4-and-gpt-4-turbo-models) and all [GPT-3.5](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#gpt-35) Turbo models newer than `gpt-3.5-turbo-1106`. + + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which guarantees the model will match your supplied JSON schema. + + Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON. + + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + oneOf: + - $ref: "#/components/schemas/ResponseFormatText" + - $ref: "#/components/schemas/ResponseFormatJsonObject" + - $ref: "#/components/schemas/ResponseFormatJsonSchema" + x-oaiExpandable: true + seed: + type: integer + minimum: -9223372036854775808 + maximum: 9223372036854775807 + nullable: true + description: | + This feature is in Beta. + If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. + Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. + stop: + description: | + Up to 4 sequences where the API will stop generating further tokens. + default: null + oneOf: + - type: string + nullable: true + - type: array + minItems: 1 + maxItems: 4 + items: + type: string + stream: + description: > + If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) + as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). + type: boolean + nullable: true + default: false + stream_options: + $ref: "#/components/schemas/chatCompletionStreamOptions" + temperature: + type: number + minimum: 0 + maximum: 2 + default: 1 + example: 1 + nullable: true + description: *completions_temperature_description + top_p: + type: number + minimum: 0 + maximum: 1 + default: 1 + example: 1 + nullable: true + description: *completions_top_p_description + tools: + type: array + description: > + A list of tools the model may call. Currently, only functions are supported as a tool. + Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported. + items: + $ref: "#/components/schemas/chatCompletionTool" + tool_choice: + $ref: "#/components/schemas/chatCompletionToolChoiceOption" + function_call: + deprecated: true + description: | + Deprecated in favor of `tool_choice`. + + Controls which (if any) function is called by the model. + `none` means the model will not call a function and instead generates a message. + `auto` means the model can pick between generating a message or calling a function. + Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. + + `none` is the default when no functions are present. `auto` is the default if functions are present. + oneOf: + - type: string + description: > + `none` means the model will not call a function and instead generates a message. + `auto` means the model can pick between generating a message or calling a function. + enum: [none, auto] + - $ref: "#/components/schemas/chatCompletionFunctionCallOption" + x-oaiExpandable: true + functions: + deprecated: true + description: | + Deprecated in favor of `tools`. + + A list of functions the model may generate JSON inputs for. + type: array + minItems: 1 + maxItems: 128 + items: + $ref: "#/components/schemas/chatCompletionFunctions" + user: *end_user_param_configuration + + required: + - messages + + chatCompletionFunctions: + type: object + deprecated: true + 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" + required: + - name + + chatCompletionFunctionCallOption: + type: object + description: > + Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. + properties: + name: + type: string + description: The name of the function to call. + required: + - name + + + chatCompletionRequestMessage: + oneOf: + - $ref: "#/components/schemas/chatCompletionRequestSystemMessage" + - $ref: "#/components/schemas/chatCompletionRequestUserMessage" + - $ref: "#/components/schemas/chatCompletionRequestAssistantMessage" + - $ref: "#/components/schemas/chatCompletionRequestToolMessage" + - $ref: "#/components/schemas/chatCompletionRequestFunctionMessage" + + chatCompletionRequestSystemMessage: + type: object + title: System message + properties: + content: + description: The contents of the system message. + oneOf: + - type: string + description: The contents of the system message. + title: Text content + - type: array + description: An array of content parts with a defined type. For system messages, only type `text` is supported. + title: Array of content parts + items: + $ref: "#/components/schemas/chatCompletionRequestSystemMessageContentPart" + minItems: 1 + role: + type: string + enum: ["system"] + description: The role of the messages author, in this case `system`. + name: + type: string + description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. + required: + - content + - role + + chatCompletionRequestUserMessage: + type: object + title: User message + properties: + content: + description: | + The contents of the user message. + oneOf: + - type: string + description: The text contents of the message. + title: Text content + - type: array + description: An array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts. Image input is only supported when using the `gpt-4o` model. + title: Array of content parts + items: + $ref: "#/components/schemas/chatCompletionRequestUserMessageContentPart" + minItems: 1 + x-oaiExpandable: true + role: + type: string + enum: ["user"] + description: The role of the messages author, in this case `user`. + name: + type: string + description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. + required: + - content + - role + + chatCompletionRequestAssistantMessage: + type: object + title: Assistant message + properties: + content: + nullable: true + oneOf: + - type: string + description: The contents of the assistant message. + title: Text content + - type: array + description: An array of content parts with a defined type. Can be one or more of type `text`, or exactly one of type `refusal`. + title: Array of content parts + items: + $ref: "#/components/schemas/chatCompletionRequestAssistantMessageContentPart" + minItems: 1 + description: | + The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified. + refusal: + nullable: true + type: string + description: The refusal message by the assistant. + role: + type: string + enum: ["assistant"] + description: The role of the messages author, in this case `assistant`. + name: + type: string + description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. + tool_calls: + $ref: "#/components/schemas/chatCompletionMessageToolCalls" + function_call: + type: object + deprecated: true + description: "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model." + nullable: true + properties: + 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. + name: + type: string + description: The name of the function to call. + required: + - arguments + - name + required: + - role + + chatCompletionRequestToolMessage: + type: object + title: Tool message + properties: + role: + type: string + enum: ["tool"] + description: The role of the messages author, in this case `tool`. + content: + oneOf: + - type: string + description: The contents of the tool message. + title: Text content + - type: array + description: An array of content parts with a defined type. For tool messages, only type `text` is supported. + title: Array of content parts + items: + $ref: "#/components/schemas/chatCompletionRequestToolMessageContentPart" + minItems: 1 + description: The contents of the tool message. + tool_call_id: + type: string + description: Tool call that this message is responding to. + required: + - role + - content + - tool_call_id + + chatCompletionRequestFunctionMessage: + type: object + title: Function message + deprecated: true + properties: + role: + type: string + enum: ["function"] + description: The role of the messages author, in this case `function`. + content: + nullable: true + type: string + description: The contents of the function message. + name: + type: string + description: The name of the function to call. + required: + - role + - content + - name + + chatCompletionRequestSystemMessageContentPart: + oneOf: + - $ref: "#/components/schemas/chatCompletionRequestMessageContentPartText" + + chatCompletionRequestUserMessageContentPart: + oneOf: + - $ref: "#/components/schemas/chatCompletionRequestMessageContentPartText" + - $ref: "#/components/schemas/chatCompletionRequestMessageContentPartImage" + + chatCompletionRequestAssistantMessageContentPart: + oneOf: + - $ref: "#/components/schemas/chatCompletionRequestMessageContentPartText" + - $ref: "#/components/schemas/chatCompletionRequestMessageContentPartRefusal" + + chatCompletionRequestToolMessageContentPart: + oneOf: + - $ref: "#/components/schemas/chatCompletionRequestMessageContentPartText" + + chatCompletionRequestMessageContentPartText: + type: object + title: Text content part + properties: + type: + type: string + enum: ["text"] + description: The type of the content part. + text: + type: string + description: The text content. + required: + - type + - text + + chatCompletionRequestMessageContentPartImage: + type: object + title: Image content part + properties: + type: + type: string + enum: ["image_url"] + description: The type of the content part. + image_url: + type: object + properties: + url: + type: string + description: Either a URL of the image or the base64 encoded image data. + format: uri + detail: + type: string + description: Specifies the detail level of the image. Learn more in the [Vision guide](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/gpt-with-vision?tabs=rest%2Csystem-assigned%2Cresource#detail-parameter-settings-in-image-processing-low-high-auto). + enum: ["auto", "low", "high"] + default: "auto" + required: + - url + required: + - type + - image_url + + chatCompletionRequestMessageContentPartRefusal: + type: object + title: Refusal content part + properties: + type: + type: string + enum: ["refusal"] + description: The type of the content part. + refusal: + type: string + description: The refusal message generated by the model. + required: + - type + - refusal + "azureChatExtensionConfiguration": + required: + - type + type: object + properties: + type: + $ref: "#/components/schemas/azureChatExtensionType" + description: |2- + A representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chat + completions request that should use Azure OpenAI chat extensions to augment the response behavior. + The use of this configuration is compatible only with Azure OpenAI. + discriminator: + propertyName: type + mapping: + azure_search: "#/components/schemas/azureSearchChatExtensionConfiguration" + azure_cosmos_db: "#/components/schemas/azureCosmosDBChatExtensionConfiguration" + azureChatExtensionType: + type: string + description: |2- + A representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chat + completions request that should use Azure OpenAI chat extensions to augment the response behavior. + The use of this configuration is compatible only with Azure OpenAI. + enum: + - azure_search + - azure_cosmos_db + x-ms-enum: + name: AzureChatExtensionType + modelAsString: true + values: + - name: azureSearch + value: azure_search + description: Represents the use of Azure Search as an Azure OpenAI chat extension. + - name: azureCosmosDB + value: azure_cosmos_db + description: Represents the use of Azure Cosmos DB as an Azure OpenAI chat extension. + azureSearchChatExtensionConfiguration: + required: + - parameters + description: |- + A specific representation of configurable options for Azure Search when using it as an Azure OpenAI chat + extension. + allOf: + - $ref: "#/components/schemas/azureChatExtensionConfiguration" + - properties: + parameters: + $ref: "#/components/schemas/azureSearchChatExtensionParameters" + x-ms-discriminator-value: azure_search + azureSearchChatExtensionParameters: + required: + - authentication + - endpoint + - index_name + type: object + properties: + authentication: + oneOf: + - $ref: "#/components/schemas/onYourDataApiKeyAuthenticationOptions" + - $ref: "#/components/schemas/onYourDataSystemAssignedManagedIdentityAuthenticationOptions" + - $ref: "#/components/schemas/onYourDataUserAssignedManagedIdentityAuthenticationOptions" + top_n_documents: + type: integer + description: The configured top number of documents to feature for the configured query. + format: int32 + in_scope: + type: boolean + description: Whether queries should be restricted to use of indexed data. + strictness: + maximum: 5 + minimum: 1 + type: integer + description: The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. + format: int32 + role_information: + type: string + description: Give the model instructions about how it should behave and any context it should reference when generating a response. You can describe the assistant's personality and tell it how to format responses. There's a 100 token limit for it, and it counts against the overall token limit. + endpoint: + type: string + description: The absolute endpoint path for the Azure Search resource to use. + format: uri + index_name: + type: string + description: The name of the index to use as available in the referenced Azure Search resource. + fields_mapping: + $ref: "#/components/schemas/azureSearchIndexFieldMappingOptions" + query_type: + $ref: "#/components/schemas/azureSearchQueryType" + semantic_configuration: + type: string + description: The additional semantic configuration for the query. + filter: + type: string + description: Search filter. + embedding_dependency: + oneOf: + - $ref: "#/components/schemas/onYourDataEndpointVectorizationSource" + - $ref: "#/components/schemas/onYourDataDeploymentNameVectorizationSource" + description: Parameters for Azure Search when used as an Azure OpenAI chat extension. + azureSearchIndexFieldMappingOptions: + type: object + properties: + title_field: + type: string + description: The name of the index field to use as a title. + url_field: + type: string + description: The name of the index field to use as a URL. + filepath_field: + type: string + description: The name of the index field to use as a filepath. + content_fields: + type: array + description: The names of index fields that should be treated as content. + items: + type: string + content_fields_separator: + type: string + description: The separator pattern that content fields should use. + vector_fields: + type: array + description: The names of fields that represent vector data. + items: + type: string + description: Optional settings to control how fields are processed when using a configured Azure Search resource. + azureSearchQueryType: + type: string + description: The type of Azure Search retrieval query that should be executed when using it as an Azure OpenAI chat extension. + enum: + - simple + - semantic + - vector + - vector_simple_hybrid + - vector_semantic_hybrid + x-ms-enum: + name: AzureSearchQueryType + modelAsString: true + values: + - name: simple + value: simple + description: Represents the default, simple query parser. + - name: semantic + value: semantic + description: Represents the semantic query parser for advanced semantic modeling. + - name: vector + value: vector + description: Represents vector search over computed data. + - name: vectorSimpleHybrid + value: vector_simple_hybrid + description: Represents a combination of the simple query strategy with vector data. + - name: vectorSemanticHybrid + value: vector_semantic_hybrid + description: Represents a combination of semantic search and vector data querying. + azureCosmosDBChatExtensionConfiguration: + required: + - parameters + description: |- + A specific representation of configurable options for Azure Cosmos DB when using it as an Azure OpenAI chat + extension. + allOf: + - $ref: "#/components/schemas/azureChatExtensionConfiguration" + - properties: + parameters: + $ref: "#/components/schemas/azureCosmosDBChatExtensionParameters" + x-ms-discriminator-value: azure_cosmos_db + azureCosmosDBChatExtensionParameters: + required: + - authentication + - container_name + - database_name + - embedding_dependency + - fields_mapping + - index_name + type: object + properties: + authentication: + $ref: '#/components/schemas/onYourDataConnectionStringAuthenticationOptions' + top_n_documents: + type: integer + description: The configured top number of documents to feature for the configured query. + format: int32 + in_scope: + type: boolean + description: Whether queries should be restricted to use of indexed data. + strictness: + maximum: 5 + minimum: 1 + type: integer + description: The configured strictness of the search relevance filtering. The higher of strictness, the higher of the precision but lower recall of the answer. + format: int32 + role_information: + type: string + description: Give the model instructions about how it should behave and any context it should reference when generating a response. You can describe the assistant's personality and tell it how to format responses. There's a 100 token limit for it, and it counts against the overall token limit. + database_name: + type: string + description: The MongoDB vCore database name to use with Azure Cosmos DB. + container_name: + type: string + description: The name of the Azure Cosmos DB resource container. + index_name: + type: string + description: The MongoDB vCore index name to use with Azure Cosmos DB. + fields_mapping: + $ref: "#/components/schemas/azureCosmosDBFieldMappingOptions" + embedding_dependency: + oneOf: + - $ref: "#/components/schemas/onYourDataEndpointVectorizationSource" + - $ref: "#/components/schemas/onYourDataDeploymentNameVectorizationSource" + description: |- + Parameters to use when configuring Azure OpenAI On Your Data chat extensions when using Azure Cosmos DB for + MongoDB vCore. + azureCosmosDBFieldMappingOptions: + required: + - content_fields + - vector_fields + type: object + properties: + title_field: + type: string + description: The name of the index field to use as a title. + url_field: + type: string + description: The name of the index field to use as a URL. + filepath_field: + type: string + description: The name of the index field to use as a filepath. + content_fields: + type: array + description: The names of index fields that should be treated as content. + items: + type: string + content_fields_separator: + type: string + description: The separator pattern that content fields should use. + vector_fields: + type: array + description: The names of fields that represent vector data. + items: + type: string + description: Optional settings to control how fields are processed when using a configured Azure Cosmos DB resource. + onYourDataAuthenticationOptions: + required: + - type + type: object + properties: + type: + $ref: "#/components/schemas/onYourDataAuthenticationType" + description: The authentication options for Azure OpenAI On Your Data. + discriminator: + propertyName: type + mapping: + api_key: "#/components/schemas/onYourDataApiKeyAuthenticationOptions" + connection_string: "#/components/schemas/onYourDataConnectionStringAuthenticationOptions" + system_assigned_managed_identity: "#/components/schemas/onYourDataSystemAssignedManagedIdentityAuthenticationOptions" + user_assigned_managed_identity: "#/components/schemas/onYourDataUserAssignedManagedIdentityAuthenticationOptions" + onYourDataAuthenticationType: + type: string + description: The authentication types supported with Azure OpenAI On Your Data. + enum: + - api_key + - connection_string + - system_assigned_managed_identity + - user_assigned_managed_identity + x-ms-enum: + name: OnYourDataAuthenticationType + modelAsString: true + values: + - name: apiKey + value: api_key + description: Authentication via API key. + - name: connectionString + value: connection_string + description: Authentication via connection string. + - name: systemAssignedManagedIdentity + value: system_assigned_managed_identity + description: Authentication via system-assigned managed identity. + - name: userAssignedManagedIdentity + value: user_assigned_managed_identity + description: Authentication via user-assigned managed identity. + onYourDataApiKeyAuthenticationOptions: + required: + - key + description: The authentication options for Azure OpenAI On Your Data when using an API key. + allOf: + - $ref: "#/components/schemas/onYourDataAuthenticationOptions" + - properties: + key: + type: string + description: The API key to use for authentication. + x-ms-discriminator-value: api_key + onYourDataConnectionStringAuthenticationOptions: + required: + - connection_string + description: The authentication options for Azure OpenAI On Your Data when using a connection string. + allOf: + - $ref: "#/components/schemas/onYourDataAuthenticationOptions" + - properties: + connection_string: + type: string + description: The connection string to use for authentication. + x-ms-discriminator-value: connection_string + onYourDataSystemAssignedManagedIdentityAuthenticationOptions: + description: The authentication options for Azure OpenAI On Your Data when using a system-assigned managed identity. + allOf: + - $ref: "#/components/schemas/onYourDataAuthenticationOptions" + x-ms-discriminator-value: system_assigned_managed_identity + onYourDataUserAssignedManagedIdentityAuthenticationOptions: + required: + - managed_identity_resource_id + description: The authentication options for Azure OpenAI On Your Data when using a user-assigned managed identity. + allOf: + - $ref: "#/components/schemas/onYourDataAuthenticationOptions" + - properties: + managed_identity_resource_id: + type: string + description: The resource ID of the user-assigned managed identity to use for authentication. + x-ms-discriminator-value: user_assigned_managed_identity + onYourDataVectorizationSource: + required: + - type + type: object + properties: + type: + $ref: "#/components/schemas/onYourDataVectorizationSourceType" + description: An abstract representation of a vectorization source for Azure OpenAI On Your Data with vector search. + discriminator: + propertyName: type + mapping: + endpoint: "#/components/schemas/onYourDataEndpointVectorizationSource" + deployment_name: "#/components/schemas/onYourDataDeploymentNameVectorizationSource" + onYourDataVectorizationSourceType: + type: string + description: |- + Represents the available sources Azure OpenAI On Your Data can use to configure vectorization of data for use with + vector search. + enum: + - endpoint + - deployment_name + x-ms-enum: + name: OnYourDataVectorizationSourceType + modelAsString: true + values: + - name: endpoint + value: endpoint + description: Represents vectorization performed by public service calls to an Azure OpenAI embedding model. + - name: deploymentName + value: deployment_name + description: |- + Represents an Ada model deployment name to use. This model deployment must be in the same Azure OpenAI resource, but + On Your Data will use this model deployment via an internal call rather than a public one, which enables vector + search even in private networks. + onYourDataDeploymentNameVectorizationSource: + required: + - deployment_name + description: |- + The details of a a vectorization source, used by Azure OpenAI On Your Data when applying vector search, that is based + on an internal embeddings model deployment name in the same Azure OpenAI resource. + allOf: + - $ref: "#/components/schemas/onYourDataVectorizationSource" + - properties: + deployment_name: + type: string + description: Specifies the name of the model deployment to use for vectorization. This model deployment must be in the same Azure OpenAI resource, but On Your Data will use this model deployment via an internal call rather than a public one, which enables vector search even in private networks. + x-ms-discriminator-value: deployment_name + onYourDataEndpointVectorizationSource: + required: + - authentication + - endpoint + description: |- + The details of a a vectorization source, used by Azure OpenAI On Your Data when applying vector search, that is based + on a public Azure OpenAI endpoint call for embeddings. + allOf: + - $ref: "#/components/schemas/onYourDataVectorizationSource" + - properties: + authentication: + $ref: '#/components/schemas/onYourDataApiKeyAuthenticationOptions' + endpoint: + type: string + description: Specifies the endpoint to use for vectorization. This endpoint must be in the same Azure OpenAI resource, but On Your Data will use this endpoint via an internal call rather than a public one, which enables vector search even in private networks. + format: uri + x-ms-discriminator-value: endpoint + azureChatExtensionsMessageContext: + type: object + properties: + citations: + type: array + description: The data source retrieval result, used to generate the assistant message in the response. + items: + $ref: "#/components/schemas/citation" + x-ms-identifiers: [] + intent: + type: string + description: The detected intent from the chat history, used to pass to the next turn to carry over the context. + description: |2- + A representation of the additional context information available when Azure OpenAI chat extensions are involved + in the generation of a corresponding chat completions response. This context information is only populated when + using an Azure OpenAI request configured to use a matching extension. + citation: + required: + - content + type: object + properties: + content: + type: string + description: The content of the citation. + title: + type: string + description: The title of the citation. + url: + type: string + description: The URL of the citation. + filepath: + type: string + description: The file path of the citation. + chunk_id: + type: string + description: The chunk ID of the citation. + description: citation information for a chat completions response message. + chatCompletionMessageToolCall: + type: object + properties: + id: + type: string + description: The ID of the tool call. + type: + $ref: "#/components/schemas/toolCallType" + 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 + toolCallType: + type: string + enum: + - function + description: The type of the tool call, in this case `function`. + x-ms-enum: + name: ToolCallType + modelAsString: true + values: + - value: function + description: The tool call type is function. + chatCompletionRequestMessageTool: + allOf: + - $ref: "#/components/schemas/chatCompletionRequestMessage" + - type: object + nullable: true + properties: + tool_call_id: + type: string + description: Tool call that this message is responding to. + content: + type: string + description: The contents of the message. + nullable: true + required: + - tool_call_id + - content + chatCompletionRequestMessageFunction: + allOf: + - $ref: "#/components/schemas/chatCompletionRequestMessage" + - type: object + description: Deprecated. Message that represents a function. + nullable: true + properties: + role: + type: string + enum: + - function + description: The role of the messages author, in this case `function`. + name: + type: string + description: The contents of the message. + content: + type: string + description: The contents of the message. + nullable: true + required: + - function_call_id + - content + createChatCompletionResponse: + type: object + description: Represents a chat completion response returned by model, based on the provided input. + properties: + id: + type: string + description: A unique identifier for the chat completion. + prompt_filter_results: + $ref: "#/components/schemas/promptFilterResults" + choices: + type: array + description: A list of chat completion choices. Can be more than one if `n` is greater than 1. + items: + type: object + required: + - finish_reason + - index + - message + - logprobs + properties: + finish_reason: + type: string + description: &chat_completion_finish_reason_description | + The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, + `length` if the maximum number of tokens specified in the request was reached, + `content_filter` if content was omitted due to a flag from our content filters, + `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. + enum: + [ + "stop", + "length", + "tool_calls", + "content_filter", + "function_call", + ] + index: + type: integer + description: The index of the choice in the list of choices. + message: + $ref: "#/components/schemas/chatCompletionResponseMessage" + content_filter_results: + $ref: "#/components/schemas/contentFilterChoiceResults" + logprobs: &chat_completion_response_logprobs + description: Log probability information for the choice. + type: object + nullable: true + properties: + content: + description: A list of message content tokens with log probability information. + type: array + items: + $ref: "#/components/schemas/chatCompletionTokenLogprob" + nullable: true + refusal: + description: A list of message refusal tokens with log probability information. + type: array + items: + $ref: "#/components/schemas/chatCompletionTokenLogprob" + nullable: true + required: + - content + - refusal + created: + type: integer + description: The Unix timestamp (in seconds) of when the chat completion was created. + model: + type: string + description: The model used for the chat completion. + system_fingerprint: + type: string + description: | + This fingerprint represents the backend configuration that the model runs with. + + Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + object: + type: string + description: The object type, which is always `chat.completion`. + enum: [chat.completion] + usage: + $ref: "#/components/schemas/completionUsage" + required: + - choices + - created + - id + - model + - object + + createChatCompletionStreamResponse: + type: object + description: Represents a streamed chunk of a chat completion response returned by model, based on the provided input. + properties: + id: + type: string + description: A unique identifier for the chat completion. Each chunk has the same ID. + choices: + type: array + description: | + A list of chat completion choices. Can contain more than one elements if `n` is greater than 1. + items: + type: object + required: + - delta + - finish_reason + - index + properties: + delta: + $ref: "#/components/schemas/chatCompletionStreamResponseDelta" + logprobs: *chat_completion_response_logprobs + finish_reason: + type: string + description: *chat_completion_finish_reason_description + enum: + [ + "stop", + "length", + "tool_calls", + "content_filter", + "function_call", + ] + nullable: true + index: + type: integer + description: The index of the choice in the list of choices. + created: + type: integer + description: The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp. + model: + type: string + description: The model to generate the completion. + system_fingerprint: + type: string + description: | + This fingerprint represents the backend configuration that the model runs with. + Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + object: + type: string + description: The object type, which is always `chat.completion.chunk`. + enum: [chat.completion.chunk] + required: + - prompt_tokens + - completion_tokens + - total_tokens + required: + - choices + - created + - id + - model + - object + + chatCompletionStreamResponseDelta: + type: object + description: A chat completion delta generated by streamed model responses. + properties: + content: + type: string + description: The contents of the chunk message. + nullable: true + function_call: + deprecated: true + type: object + description: "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model." + properties: + 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. + name: + type: string + description: The name of the function to call. + tool_calls: + type: array + items: + $ref: "#/components/schemas/chatCompletionMessageToolCallChunk" + role: + type: string + enum: ["system", "user", "assistant", "tool"] + description: The role of the author of this message. + refusal: + type: string + description: The refusal message generated by the model. + nullable: true + + chatCompletionMessageToolCallChunk: + 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 + + chatCompletionStreamOptions: + description: | + Options for streaming response. Only set this when you set `stream: true`. + type: object + nullable: true + default: null + properties: + include_usage: + type: boolean + description: | + If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value. + + chatCompletionChoiceLogProbs: + description: Log probability information for the choice. + type: object + nullable: true + properties: + content: + description: A list of message content tokens with log probability information. + type: array + items: + $ref: "#/components/schemas/chatCompletionTokenLogprob" + nullable: true + refusal: + description: A list of message refusal tokens with log probability information. + type: array + items: + $ref: "#/components/schemas/chatCompletionTokenLogprob" + nullable: true + required: + - content + chatCompletionTokenLogprob: + type: object + properties: + token: + description: The token. + type: string + logprob: + description: The log probability of this token. + type: number + bytes: + description: A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token. + type: array + items: + type: integer + nullable: true + top_logprobs: + description: List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned. + type: array + items: + type: object + properties: + token: + description: The token. + type: string + logprob: + description: The log probability of this token. + type: number + bytes: + description: A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token. + type: array + items: + type: integer + nullable: true + required: + - token + - logprob + - bytes + required: + - token + - logprob + - bytes + - top_logprobs + + chatCompletionResponseMessage: + type: object + description: A chat completion message generated by the model. + properties: + role: + $ref: "#/components/schemas/chatCompletionResponseMessageRole" + refusal: + type: string + description: The refusal message generated by the model. + nullable: true + content: + type: string + description: The contents of the message. + nullable: true + tool_calls: + type: array + description: The tool calls generated by the model, such as function calls. + items: + $ref: "#/components/schemas/chatCompletionMessageToolCall" + function_call: + $ref: "#/components/schemas/chatCompletionFunctionCall" + context: + $ref: "#/components/schemas/azureChatExtensionsMessageContext" + required: + - role + - content + - refusal + chatCompletionResponseMessageRole: + type: string + enum: + - assistant + description: The role of the author of the response message. + chatCompletionToolChoiceOption: + description: | + Controls which (if any) tool is called by the model. + `none` means the model will not call any tool and instead generates a message. + `auto` means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools. + Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + `none` is the default when no tools are present. `auto` is the default if tools are present. + oneOf: + - type: string + description: > + `none` means the model will not call any tool and instead generates a message. + `auto` means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools. + enum: + - none + - auto + - required + - $ref: "#/components/schemas/chatCompletionNamedToolChoice" + chatCompletionNamedToolChoice: + type: object + description: Specifies a tool the model should use. Use to force the model to call a specific function. + properties: + 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. + required: + - name + required: + - type + - function + + ParallelToolCalls: + description: Whether to enable parallel function calling during tool use. + type: boolean + default: true + + chatCompletionMessageToolCalls: + type: array + description: The tool calls generated by the model, such as function calls. + items: + $ref: "#/components/schemas/chatCompletionMessageToolCall" + + chatCompletionFunctionCall: + type: object + description: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. + 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 + completionUsage: + type: object + description: Usage statistics for the completion request. + properties: + prompt_tokens: + type: integer + description: Number of tokens in the prompt. + completion_tokens: + type: integer + description: Number of tokens in the generated completion. + total_tokens: + type: integer + description: Total number of tokens used in the request (prompt + completion). + completion_tokens_details: + type: object + description: Breakdown of tokens used in a completion. + properties: + reasoning_tokens: + type: integer + description: Tokens generated by the model for reasoning. + required: + - prompt_tokens + - completion_tokens + - total_tokens + chatCompletionTool: + type: object + 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 + + FunctionParameters: + type: object + description: "The parameters the functions accepts, described as a JSON Schema object. See the guide](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a function with an empty parameter list." + additionalProperties: true + + FunctionObject: + type: object + 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 + + ResponseFormatText: + type: object + properties: + type: + type: string + description: "The type of response format being defined: `text`" + enum: ["text"] + required: + - type + + ResponseFormatJsonObject: + type: object + properties: + type: + type: string + description: "The type of response format being defined: `json_object`" + enum: ["json_object"] + required: + - type + + ResponseFormatJsonSchemaSchema: + type: object + description: "The schema for the response format, described as a JSON Schema object." + additionalProperties: true + + ResponseFormatJsonSchema: + type: object + properties: + type: + type: string + description: "The type of response format being defined: `json_schema`" + enum: ["json_schema"] + json_schema: + type: object + 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`. + required: + - type + - name + required: + - type + - json_schema + + chatCompletionChoiceCommon: + type: object + properties: + index: + type: integer + finish_reason: + type: string + createTranslationRequest: + type: object + description: Translation request. + properties: + file: + type: string + description: The audio file to translate. + format: binary + prompt: + type: string + description: An optional text to guide the model's style or continue a previous audio segment. The prompt should be in English. + response_format: + $ref: "#/components/schemas/audioResponseFormat" + temperature: + type: number + default: 0 + description: The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit. + required: + - file + audioResponse: + description: Translation or transcription response when response_format was json + type: object + properties: + text: + type: string + description: Translated or transcribed text. + required: + - text + audioVerboseResponse: + description: Translation or transcription response when response_format was verbose_json + type: object + allOf: + - $ref: "#/components/schemas/audioResponse" + - properties: + task: + type: string + description: Type of audio task. + enum: + - transcribe + - translate + x-ms-enum: + modelAsString: true + language: + type: string + description: Language. + duration: + type: number + description: Duration. + segments: + type: array + items: + $ref: "#/components/schemas/audioSegment" + required: + - text + audioResponseFormat: + title: AudioResponseFormat + description: Defines the format of the output. + enum: + - json + - text + - srt + - verbose_json + - vtt + type: string + x-ms-enum: + modelAsString: true + createTranscriptionRequest: + type: object + description: Transcription request. + properties: + file: + type: string + description: The audio file object to transcribe. + format: binary + prompt: + type: string + description: An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language. + response_format: + $ref: "#/components/schemas/audioResponseFormat" + temperature: + type: number + default: 0 + description: The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit. + language: + type: string + description: The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency. + required: + - file + audioSegment: + type: object + description: Transcription or translation segment. + properties: + id: + type: integer + description: Segment identifier. + seek: + type: number + description: Offset of the segment. + start: + type: number + description: Segment start offset. + end: + type: number + description: Segment end offset. + text: + type: string + description: Segment text. + tokens: + type: array + items: + type: number + nullable: false + description: Tokens of the text. + temperature: + type: number + description: Temperature. + avg_logprob: + type: number + description: Average log probability. + compression_ratio: + type: number + description: Compression ratio. + no_speech_prob: + type: number + description: Probability of 'no speech'. + imageQuality: + description: The quality of the image that will be generated. + type: string + enum: + - standard + - hd + default: standard + x-ms-enum: + name: Quality + modelAsString: true + values: + - value: standard + description: Standard quality creates images with standard quality. + name: Standard + - value: hd + description: HD quality creates images with finer details and greater consistency across the image. + name: HD + imagesResponseFormat: + description: The format in which the generated images are returned. + type: string + enum: + - url + - b64_json + default: url + x-ms-enum: + name: ImagesResponseFormat + modelAsString: true + values: + - value: url + description: The URL that provides temporary access to download the generated images. + name: Url + - value: b64_json + description: The generated images are returned as base64 encoded string. + name: Base64Json + imageSize: + description: The size of the generated images. + type: string + enum: + - 1792x1024 + - 1024x1792 + - 1024x1024 + default: 1024x1024 + x-ms-enum: + name: Size + modelAsString: true + values: + - value: 1792x1024 + description: The desired size of the generated image is 1792x1024 pixels. + name: Size1792x1024 + - value: 1024x1792 + description: The desired size of the generated image is 1024x1792 pixels. + name: Size1024x1792 + - value: 1024x1024 + description: The desired size of the generated image is 1024x1024 pixels. + name: Size1024x1024 + imageStyle: + description: The style of the generated images. + type: string + enum: + - vivid + - natural + default: vivid + x-ms-enum: + name: Style + modelAsString: true + values: + - value: vivid + description: Vivid creates images that are hyper-realistic and dramatic. + name: Vivid + - value: natural + description: Natural creates images that are more natural and less hyper-realistic. + name: Natural + imageGenerationsRequest: + type: object + properties: + prompt: + description: A text description of the desired image(s). The maximum length is 4000 characters. + type: string + format: string + example: a corgi in a field + minLength: 1 + "n": + description: The number of images to generate. + type: integer + minimum: 1 + maximum: 1 + default: 1 + size: + $ref: "#/components/schemas/imageSize" + response_format: + $ref: "#/components/schemas/imagesResponseFormat" + user: + description: A unique identifier representing your end-user, which can help to monitor and detect abuse. + type: string + format: string + example: user123456 + quality: + $ref: "#/components/schemas/imageQuality" + style: + $ref: "#/components/schemas/imageStyle" + required: + - prompt + generateImagesResponse: + type: object + properties: + created: + type: integer + format: unixtime + description: The unix timestamp when the operation was created. + example: "1676540381" + data: + type: array + description: The result data of the operation, if successful + items: + $ref: "#/components/schemas/imageResult" + required: + - created + - data + imageResult: + type: object + description: The image url or encoded image if successful, and an error otherwise. + properties: + url: + type: string + description: The image url. + example: https://www.contoso.com + b64_json: + type: string + description: The base64 encoded image + content_filter_results: + $ref: "#/components/schemas/dalleContentFilterResults" + revised_prompt: + type: string + description: The prompt that was used to generate the image, if there was any revision to the prompt. + prompt_filter_results: + $ref: "#/components/schemas/dalleFilterResults" + securitySchemes: + bearer: + type: oauth2 + flows: + implicit: + authorizationUrl: https://login.microsoftonline.com/common/oauth2/v2.0/authorize + scopes: {} + x-tokenInfoFunc: api.middleware.auth.bearer_auth + x-scopeValidateFunc: api.middleware.auth.validate_scopes + apiKey: + type: apiKey + name: api-key + in: header \ No newline at end of file