Skip to content

Commit 304f126

Browse files
committed
fixed a few variable that were int instead of double + added additional testing
1 parent e44e26f commit 304f126

22 files changed

+136
-148
lines changed

src/main/java/io/github/jetkai/openai/api/data/audio/AudioData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public interface Builder {
110110
*/
111111
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
112112
@JsonProperty("temperature")
113-
public abstract Double getTemperature();
113+
public abstract double getTemperature();
114114

115115
/**
116116
* language

src/main/java/io/github/jetkai/openai/api/data/audio/AudioImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public String getResponseFormat() {
5151
}
5252

5353
@Override
54-
public Double getTemperature() {
54+
public double getTemperature() {
5555
return this.temperature;
5656
}
5757

src/main/java/io/github/jetkai/openai/api/data/audio/response/AudioResponseData.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* AudioResponseData
1313
*
1414
* @author <a href="https://github.com/jetkai">Kai</a>
15-
* @version 1.1.0
15+
* @version 1.1.1
1616
* {@code - 07/03/2023}
1717
* @since 1.0.0
1818
* {@code - 02/03/2023}
@@ -22,15 +22,6 @@ public abstract class AudioResponseData {
2222

2323
public AudioResponseData() { }
2424

25-
public static AudioResponseData.Builder builder() {
26-
return new AudioResponseBuilderImpl();
27-
}
28-
29-
public static AudioResponseData create() {
30-
return builder().build();
31-
}
32-
33-
3425
@JsonPOJOBuilder(withPrefix = "set")
3526
public interface Builder {
3627
@JsonProperty("text")

src/main/java/io/github/jetkai/openai/api/data/audio/response/AudioResponseImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* AudioResponseImpl
88
*
99
* @author <a href="https://github.com/jetkai">Kai</a>
10-
* @version 1.1.0
10+
* @version 1.1.1
1111
* {@code - 07/03/2023}
1212
* @since 1.1.0
1313
* {@code - 07/03/2023}
@@ -16,7 +16,6 @@ final class AudioResponseImpl extends AudioResponseData {
1616

1717
private final String text;
1818

19-
2019
private AudioResponseImpl(AudioResponseBuilderImpl builder) {
2120
this.text = builder.text;
2221
}

src/main/java/io/github/jetkai/openai/api/data/completion/CompletionData.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public interface Builder {
8484
*/
8585
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
8686
@JsonProperty("echo")
87-
public abstract Boolean getEcho();
87+
public abstract boolean isEcho();
8888

8989
/**
9090
* logprobs
@@ -119,7 +119,7 @@ public interface Builder {
119119
*/
120120
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
121121
@JsonProperty("max_tokens")
122-
public abstract Integer getMaxTokens();
122+
public abstract int getMaxTokens();
123123

124124
/**
125125
* model
@@ -147,7 +147,7 @@ public interface Builder {
147147
*/
148148
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
149149
@JsonProperty("n")
150-
public abstract Integer getN();
150+
public abstract int getN();
151151

152152
/**
153153
* prompt
@@ -192,7 +192,7 @@ public interface Builder {
192192
*/
193193
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
194194
@JsonProperty("stream")
195-
public abstract Boolean isStream();
195+
public abstract boolean isStream();
196196

197197
/**
198198
* temperature
@@ -208,7 +208,7 @@ public interface Builder {
208208
*/
209209
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
210210
@JsonProperty("temperature")
211-
public abstract Double getTemperature();
211+
public abstract double getTemperature();
212212

213213

214214
/**
@@ -226,7 +226,7 @@ public interface Builder {
226226
*/
227227
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
228228
@JsonProperty("top_p")
229-
public abstract Double getTopP();
229+
public abstract double getTopP();
230230

231231
/**
232232
* suffix
@@ -255,7 +255,7 @@ public interface Builder {
255255
*/
256256
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
257257
@JsonProperty("frequency_penalty")
258-
public abstract Double getFrequencyPenalty();
258+
public abstract double getFrequencyPenalty();
259259

260260
/**
261261
* presence_penalty
@@ -272,7 +272,7 @@ public interface Builder {
272272
*/
273273
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
274274
@JsonProperty("presence_penalty")
275-
public abstract Double getPresencePenalty();
275+
public abstract double getPresencePenalty();
276276

277277
/**
278278
* best_of
@@ -292,7 +292,7 @@ public interface Builder {
292292
*/
293293
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
294294
@JsonProperty("best_of")
295-
public abstract Integer getBestOf();
295+
public abstract int getBestOf();
296296

297297
/**
298298
* logit_bias

src/main/java/io/github/jetkai/openai/api/data/completion/CompletionImpl.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private CompletionImpl(CompletionBuilderImpl builder) {
5656
}
5757

5858
@Override
59-
public Boolean getEcho() {
59+
public boolean isEcho() {
6060
return this.echo;
6161
}
6262

@@ -66,7 +66,7 @@ public String getLogprobs() {
6666
}
6767

6868
@Override
69-
public Integer getMaxTokens() {
69+
public int getMaxTokens() {
7070
return this.maxTokens;
7171
}
7272

@@ -76,7 +76,7 @@ public String getModel() {
7676
}
7777

7878
@Override
79-
public Integer getN() {
79+
public int getN() {
8080
return this.n;
8181
}
8282

@@ -91,17 +91,17 @@ public List<String> getStop() {
9191
}
9292

9393
@Override
94-
public Boolean isStream() {
94+
public boolean isStream() {
9595
return this.stream;
9696
}
9797

9898
@Override
99-
public Double getTemperature() {
99+
public double getTemperature() {
100100
return this.temperature;
101101
}
102102

103103
@Override
104-
public Double getTopP() {
104+
public double getTopP() {
105105
return this.topP;
106106
}
107107

@@ -111,17 +111,17 @@ public String getSuffix() {
111111
}
112112

113113
@Override
114-
public Double getFrequencyPenalty() {
114+
public double getFrequencyPenalty() {
115115
return this.frequencyPenalty;
116116
}
117117

118118
@Override
119-
public Double getPresencePenalty() {
119+
public double getPresencePenalty() {
120120
return this.presencePenalty;
121121
}
122122

123123
@Override
124-
public Integer getBestOf() {
124+
public int getBestOf() {
125125
return this.bestOf;
126126
}
127127

src/main/java/io/github/jetkai/openai/api/data/completion/chat/ChatCompletionBuilderImpl.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ final class ChatCompletionBuilderImpl implements ChatCompletionData.Builder {
6060
* <p>
6161
* We generally recommend altering this or temperature but not both.
6262
*/
63-
int topP;
63+
double topP;
6464

6565
/**
6666
* n
@@ -120,7 +120,7 @@ final class ChatCompletionBuilderImpl implements ChatCompletionData.Builder {
120120
* See more information about frequency and presence penalties.
121121
* </a>
122122
*/
123-
int presencePenalty;
123+
double presencePenalty;
124124

125125
/**
126126
* frequency_penalty
@@ -134,7 +134,7 @@ final class ChatCompletionBuilderImpl implements ChatCompletionData.Builder {
134134
* See more information about frequency and presence penalties.
135135
* </a>
136136
*/
137-
int frequencyPenalty;
137+
double frequencyPenalty;
138138

139139
/**
140140
* logit_bias
@@ -207,13 +207,13 @@ public ChatCompletionData.Builder setLogitBias(Map<Object, Object> logitBias) {
207207
}
208208

209209
@Override
210-
public ChatCompletionData.Builder setFrequencyPenalty(int frequencyPenalty) {
210+
public ChatCompletionData.Builder setFrequencyPenalty(double frequencyPenalty) {
211211
this.frequencyPenalty = frequencyPenalty;
212212
return this;
213213
}
214214

215215
@Override
216-
public ChatCompletionData.Builder setTopP(int topP) {
216+
public ChatCompletionData.Builder setTopP(double topP) {
217217
this.topP = topP;
218218
return this;
219219
}
@@ -245,7 +245,7 @@ public ChatCompletionData.Builder setMaxTokens(int maxTokens) {
245245
}
246246

247247
@Override
248-
public ChatCompletionData.Builder setPresencePenalty(int presencePenalty) {
248+
public ChatCompletionData.Builder setPresencePenalty(double presencePenalty) {
249249
this.presencePenalty = presencePenalty;
250250
return this;
251251
}

src/main/java/io/github/jetkai/openai/api/data/completion/chat/ChatCompletionData.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ public interface Builder {
4646
Builder setUser(String user);
4747
Builder setN(int n);
4848
Builder setLogitBias(Map<Object, Object> logitBias);
49-
Builder setFrequencyPenalty(int frequencyPenalty);
50-
Builder setTopP(int topP);
49+
Builder setFrequencyPenalty(double frequencyPenalty);
50+
Builder setTopP(double topP);
5151
Builder setStream(boolean stream);
5252
Builder setStop(String stop);
5353
Builder setStop(List<String> stop);
5454
Builder setMaxTokens(int maxTokens);
55-
Builder setPresencePenalty(int presencePenalty);
55+
Builder setPresencePenalty(double presencePenalty);
5656
ChatCompletionData build();
5757
}
5858

@@ -92,7 +92,7 @@ public interface Builder {
9292
*/
9393
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
9494
@JsonProperty("temperature")
95-
public abstract Double getTemperature();
95+
public abstract double getTemperature();
9696

9797
/**
9898
* user
@@ -120,7 +120,7 @@ public interface Builder {
120120
*/
121121
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
122122
@JsonProperty("n")
123-
public abstract Integer getN();
123+
public abstract int getN();
124124

125125
/**
126126
* logit_bias
@@ -156,7 +156,7 @@ public interface Builder {
156156
*/
157157
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
158158
@JsonProperty("frequency_penalty")
159-
public abstract Integer getFrequencyPenalty();
159+
public abstract double getFrequencyPenalty();
160160

161161
/**
162162
* top_p
@@ -171,7 +171,7 @@ public interface Builder {
171171
*/
172172
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
173173
@JsonProperty("top_p")
174-
public abstract Integer getTopP();
174+
public abstract double getTopP();
175175

176176
/**
177177
* stream
@@ -189,7 +189,7 @@ public interface Builder {
189189
*/
190190
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
191191
@JsonProperty("stream")
192-
public abstract Boolean isStream();
192+
public abstract boolean isStream();
193193

194194
/**
195195
* stop
@@ -216,7 +216,7 @@ public interface Builder {
216216
*/
217217
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
218218
@JsonProperty("max_tokens")
219-
public abstract Integer getMaxTokens();
219+
public abstract int getMaxTokens();
220220

221221
/**
222222
* presence_penalty
@@ -233,19 +233,19 @@ public interface Builder {
233233
*/
234234
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
235235
@JsonProperty("presence_penalty")
236-
public abstract Integer getPresencePenalty();
236+
public abstract double getPresencePenalty();
237237

238238
public abstract Optional<String> model();
239239
public abstract Optional<List<ChatCompletionMessageData>> messages();
240240
public abstract Optional<Double> temperature();
241241
public abstract Optional<String> user();
242242
public abstract Optional<Integer> n();
243243
public abstract Optional<Map<Object, Object>> logitBias();
244-
public abstract Optional<Integer> frequencyPenalty();
245-
public abstract Optional<Integer> topP();
244+
public abstract Optional<Double> frequencyPenalty();
245+
public abstract Optional<Double> topP();
246246
public abstract Optional<Boolean> stream();
247247
public abstract Optional<List<String>> stop();
248248
public abstract Optional<Integer> maxTokens();
249-
public abstract Optional<Integer> presencePenalty();
249+
public abstract Optional<Double> presencePenalty();
250250

251251
}

0 commit comments

Comments
 (0)