-
Notifications
You must be signed in to change notification settings - Fork 19
chore: [OpenAI] use code generation #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
0c6e3ba
4de76e6
4d16a0e
e946af4
72a9f8f
f42a8c0
15ec9e5
1c05067
830f8d4
70df638
4d9ec0d
db8ce18
3413b6f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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<String> 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<String, Object> toMap() { | ||
| final Map<String, Object> 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) { | ||
|
Comment on lines
-161
to
+173
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Question)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting. Our generator has always (i.e. 2+ years) generated
My assumption is: When I originally pushed the model classes, I generated them once in Cloud SDK repo. Then I moved them to AI SDK. Very likely, IntelliJ did some reduction / unintentional improvement, to remove the redundant FQN for
Because some schema components may be called "Object" in the spec, leading to "Object" being generated. It's not a reserved keyword in java. Therefore, safest approach is to reference everything with fully-qualified-name. |
||
| 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"; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.