Skip to content

Commit d47385b

Browse files
committed
Full openapi generated code for openai module
1 parent 8704dea commit d47385b

File tree

78 files changed

+18177
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+18177
-0
lines changed
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
/*
2+
* Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved.
3+
*/
4+
5+
/*
6+
* Azure OpenAI Service API
7+
* Azure OpenAI APIs for completions and search
8+
*
9+
* The version of the OpenAPI document: 2024-10-21
10+
*
11+
*
12+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
13+
* https://openapi-generator.tech
14+
* Do not edit the class manually.
15+
*/
16+
17+
package com.sap.ai.sdk.foundationmodels.openai.model2;
18+
19+
import com.fasterxml.jackson.annotation.JsonAnyGetter;
20+
import com.fasterxml.jackson.annotation.JsonAnySetter;
21+
import com.fasterxml.jackson.annotation.JsonIgnore;
22+
import com.fasterxml.jackson.annotation.JsonProperty;
23+
import java.util.LinkedHashMap;
24+
import java.util.Map;
25+
import java.util.NoSuchElementException;
26+
import java.util.Objects;
27+
import java.util.Set;
28+
import javax.annotation.Nonnull;
29+
import javax.annotation.Nullable;
30+
31+
/**
32+
* Deprecated and replaced by `tool_calls`. The name and arguments of a function that
33+
* should be called, as generated by the model.
34+
*/
35+
// CHECKSTYLE:OFF
36+
@com.google.common.annotations.Beta
37+
public class ChatCompletionFunctionCall
38+
// CHECKSTYLE:ON
39+
{
40+
@JsonAnySetter @JsonAnyGetter
41+
private final Map<String, Object> cloudSdkCustomFields = new LinkedHashMap<>();
42+
@JsonProperty("name")
43+
private String name;
44+
@JsonProperty("arguments")
45+
private String arguments;
46+
47+
/**
48+
* Set the name of this {@link ChatCompletionFunctionCall} instance and return the same instance.
49+
*
50+
* @param name The name of the function to call.
51+
* @return The same instance of this {@link ChatCompletionFunctionCall} class
52+
*/
53+
@Nonnull
54+
public ChatCompletionFunctionCall name(@Nonnull final String name) {
55+
this.name = name;
56+
return this;
57+
}
58+
59+
/**
60+
* The name of the function to call.
61+
*
62+
* @return name The name of this {@link ChatCompletionFunctionCall} instance.
63+
*/
64+
@Nonnull
65+
public String getName() {
66+
return name;
67+
}
68+
69+
/**
70+
* Set the name of this {@link ChatCompletionFunctionCall} instance.
71+
*
72+
* @param name The name of the function to call.
73+
*/
74+
public void setName(@Nonnull final String name) {
75+
this.name = name;
76+
}
77+
78+
/**
79+
* Set the arguments of this {@link ChatCompletionFunctionCall} instance and return the same
80+
* instance.
81+
*
82+
* @param arguments The arguments to call the function with, as generated by the model in JSON
83+
* format. Note that the model does not always generate valid JSON, and may hallucinate
84+
* parameters not defined by your function schema. Validate the arguments in your code before
85+
* calling your function.
86+
* @return The same instance of this {@link ChatCompletionFunctionCall} class
87+
*/
88+
@Nonnull
89+
public ChatCompletionFunctionCall arguments(@Nonnull final String arguments) {
90+
this.arguments = arguments;
91+
return this;
92+
}
93+
94+
/**
95+
* The arguments to call the function with, as generated by the model in JSON format. Note that
96+
* the model does not always generate valid JSON, and may hallucinate parameters not defined by
97+
* your function schema. Validate the arguments in your code before calling your function.
98+
*
99+
* @return arguments The arguments of this {@link ChatCompletionFunctionCall} instance.
100+
*/
101+
@Nonnull
102+
public String getArguments() {
103+
return arguments;
104+
}
105+
106+
/**
107+
* Set the arguments of this {@link ChatCompletionFunctionCall} instance.
108+
*
109+
* @param arguments The arguments to call the function with, as generated by the model in JSON
110+
* format. Note that the model does not always generate valid JSON, and may hallucinate
111+
* parameters not defined by your function schema. Validate the arguments in your code before
112+
* calling your function.
113+
*/
114+
public void setArguments(@Nonnull final String arguments) {
115+
this.arguments = arguments;
116+
}
117+
118+
/**
119+
* Get the names of the unrecognizable properties of the {@link ChatCompletionFunctionCall}.
120+
*
121+
* @return The set of properties names
122+
*/
123+
@JsonIgnore
124+
@Nonnull
125+
public Set<String> getCustomFieldNames() {
126+
return cloudSdkCustomFields.keySet();
127+
}
128+
129+
/**
130+
* Get the value of an unrecognizable property of this {@link ChatCompletionFunctionCall}
131+
* instance.
132+
*
133+
* @param name The name of the property
134+
* @return The value of the property
135+
* @throws NoSuchElementException If no property with the given name could be found.
136+
*/
137+
@Nullable
138+
public Object getCustomField(@Nonnull final String name) throws NoSuchElementException {
139+
if (!cloudSdkCustomFields.containsKey(name)) {
140+
throw new NoSuchElementException(
141+
"ChatCompletionFunctionCall has no field with name '" + name + "'.");
142+
}
143+
return cloudSdkCustomFields.get(name);
144+
}
145+
146+
/**
147+
* Set an unrecognizable property of this {@link ChatCompletionFunctionCall} instance. If the map
148+
* previously contained a mapping for the key, the old value is replaced by the specified value.
149+
*
150+
* @param customFieldName The name of the property
151+
* @param customFieldValue The value of the property
152+
*/
153+
@JsonIgnore
154+
public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) {
155+
cloudSdkCustomFields.put(customFieldName, customFieldValue);
156+
}
157+
158+
@Override
159+
public boolean equals(@Nullable final Object o) {
160+
if (this == o) {
161+
return true;
162+
}
163+
if (o == null || getClass() != o.getClass()) {
164+
return false;
165+
}
166+
final ChatCompletionFunctionCall chatCompletionFunctionCall = (ChatCompletionFunctionCall) o;
167+
return Objects.equals(
168+
this.cloudSdkCustomFields, chatCompletionFunctionCall.cloudSdkCustomFields)
169+
&& Objects.equals(this.name, chatCompletionFunctionCall.name)
170+
&& Objects.equals(this.arguments, chatCompletionFunctionCall.arguments);
171+
}
172+
173+
@Override
174+
public int hashCode() {
175+
return Objects.hash(name, arguments, cloudSdkCustomFields);
176+
}
177+
178+
@Override
179+
@Nonnull
180+
public String toString() {
181+
final StringBuilder sb = new StringBuilder();
182+
sb.append("class ChatCompletionFunctionCall {\n");
183+
sb.append(" name: ").append(toIndentedString(name)).append("\n");
184+
sb.append(" arguments: ").append(toIndentedString(arguments)).append("\n");
185+
cloudSdkCustomFields.forEach(
186+
(k, v) ->
187+
sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
188+
sb.append("}");
189+
return sb.toString();
190+
}
191+
192+
/**
193+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
194+
*/
195+
private String toIndentedString(final Object o) {
196+
if (o == null) {
197+
return "null";
198+
}
199+
return o.toString().replace("\n", "\n ");
200+
}
201+
}
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
/*
2+
* Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved.
3+
*/
4+
5+
/*
6+
* Azure OpenAI Service API
7+
* Azure OpenAI APIs for completions and search
8+
*
9+
* The version of the OpenAPI document: 2024-10-21
10+
*
11+
*
12+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
13+
* https://openapi-generator.tech
14+
* Do not edit the class manually.
15+
*/
16+
17+
package com.sap.ai.sdk.foundationmodels.openai.model2;
18+
19+
import com.fasterxml.jackson.annotation.JsonAnyGetter;
20+
import com.fasterxml.jackson.annotation.JsonAnySetter;
21+
import com.fasterxml.jackson.annotation.JsonIgnore;
22+
import com.fasterxml.jackson.annotation.JsonProperty;
23+
import java.util.LinkedHashMap;
24+
import java.util.Map;
25+
import java.util.NoSuchElementException;
26+
import java.util.Objects;
27+
import java.util.Set;
28+
import javax.annotation.Nonnull;
29+
import javax.annotation.Nullable;
30+
31+
/**
32+
* Specifying a particular function via &#x60;{\&quot;name\&quot;: \&quot;my_function\&quot;}&#x60;
33+
* forces the model to call that function.
34+
*/
35+
// CHECKSTYLE:OFF
36+
@com.google.common.annotations.Beta
37+
public class ChatCompletionFunctionCallOption
38+
// CHECKSTYLE:ON
39+
{
40+
@JsonAnySetter @JsonAnyGetter
41+
private final Map<String, Object> cloudSdkCustomFields = new LinkedHashMap<>();
42+
@JsonProperty("name")
43+
private String name;
44+
45+
/**
46+
* Set the name of this {@link ChatCompletionFunctionCallOption} instance and return the same
47+
* instance.
48+
*
49+
* @param name The name of the function to call.
50+
* @return The same instance of this {@link ChatCompletionFunctionCallOption} class
51+
*/
52+
@Nonnull
53+
public ChatCompletionFunctionCallOption name(@Nonnull final String name) {
54+
this.name = name;
55+
return this;
56+
}
57+
58+
/**
59+
* The name of the function to call.
60+
*
61+
* @return name The name of this {@link ChatCompletionFunctionCallOption} instance.
62+
*/
63+
@Nonnull
64+
public String getName() {
65+
return name;
66+
}
67+
68+
/**
69+
* Set the name of this {@link ChatCompletionFunctionCallOption} instance.
70+
*
71+
* @param name The name of the function to call.
72+
*/
73+
public void setName(@Nonnull final String name) {
74+
this.name = name;
75+
}
76+
77+
/**
78+
* Get the names of the unrecognizable properties of the {@link ChatCompletionFunctionCallOption}.
79+
*
80+
* @return The set of properties names
81+
*/
82+
@JsonIgnore
83+
@Nonnull
84+
public Set<String> getCustomFieldNames() {
85+
return cloudSdkCustomFields.keySet();
86+
}
87+
88+
/**
89+
* Get the value of an unrecognizable property of this {@link ChatCompletionFunctionCallOption}
90+
* instance.
91+
*
92+
* @param name The name of the property
93+
* @return The value of the property
94+
* @throws NoSuchElementException If no property with the given name could be found.
95+
*/
96+
@Nullable
97+
public Object getCustomField(@Nonnull final String name) throws NoSuchElementException {
98+
if (!cloudSdkCustomFields.containsKey(name)) {
99+
throw new NoSuchElementException(
100+
"ChatCompletionFunctionCallOption has no field with name '" + name + "'.");
101+
}
102+
return cloudSdkCustomFields.get(name);
103+
}
104+
105+
/**
106+
* Set an unrecognizable property of this {@link ChatCompletionFunctionCallOption} instance. If
107+
* the map previously contained a mapping for the key, the old value is replaced by the specified
108+
* value.
109+
*
110+
* @param customFieldName The name of the property
111+
* @param customFieldValue The value of the property
112+
*/
113+
@JsonIgnore
114+
public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) {
115+
cloudSdkCustomFields.put(customFieldName, customFieldValue);
116+
}
117+
118+
@Override
119+
public boolean equals(@Nullable final Object o) {
120+
if (this == o) {
121+
return true;
122+
}
123+
if (o == null || getClass() != o.getClass()) {
124+
return false;
125+
}
126+
final ChatCompletionFunctionCallOption chatCompletionFunctionCallOption =
127+
(ChatCompletionFunctionCallOption) o;
128+
return Objects.equals(
129+
this.cloudSdkCustomFields, chatCompletionFunctionCallOption.cloudSdkCustomFields)
130+
&& Objects.equals(this.name, chatCompletionFunctionCallOption.name);
131+
}
132+
133+
@Override
134+
public int hashCode() {
135+
return Objects.hash(name, cloudSdkCustomFields);
136+
}
137+
138+
@Override
139+
@Nonnull
140+
public String toString() {
141+
final StringBuilder sb = new StringBuilder();
142+
sb.append("class ChatCompletionFunctionCallOption {\n");
143+
sb.append(" name: ").append(toIndentedString(name)).append("\n");
144+
cloudSdkCustomFields.forEach(
145+
(k, v) ->
146+
sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
147+
sb.append("}");
148+
return sb.toString();
149+
}
150+
151+
/**
152+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
153+
*/
154+
private String toIndentedString(final Object o) {
155+
if (o == null) {
156+
return "null";
157+
}
158+
return o.toString().replace("\n", "\n ");
159+
}
160+
}

0 commit comments

Comments
 (0)