Skip to content

Commit 22b0a11

Browse files
committed
refactor: removes model conflig fluency
1 parent 1fbd566 commit 22b0a11

File tree

1 file changed

+19
-49
lines changed

1 file changed

+19
-49
lines changed

src/Providers/Models/DTO/ModelConfig.php

Lines changed: 19 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -106,22 +106,20 @@ final class ModelConfig extends AbstractDataValueObject
106106
protected ?array $tools = null;
107107

108108
/**
109-
* @var array<string, mixed>|null Custom provider-specific options.
109+
* @var array<string, mixed> Custom provider-specific options.
110110
*/
111-
protected ?array $customOptions = null;
111+
protected array $customOptions = [];
112112

113113
/**
114114
* Sets the output modalities.
115115
*
116116
* @since n.e.x.t
117117
*
118118
* @param ModalityEnum[] $outputModalities The output modalities.
119-
* @return self For method chaining.
120119
*/
121-
public function setOutputModalities(array $outputModalities): self
120+
public function setOutputModalities(array $outputModalities): void
122121
{
123122
$this->outputModalities = $outputModalities;
124-
return $this;
125123
}
126124

127125
/**
@@ -142,12 +140,10 @@ public function getOutputModalities(): ?array
142140
* @since n.e.x.t
143141
*
144142
* @param string $systemInstruction The system instruction.
145-
* @return self For method chaining.
146143
*/
147-
public function setSystemInstruction(string $systemInstruction): self
144+
public function setSystemInstruction(string $systemInstruction): void
148145
{
149146
$this->systemInstruction = $systemInstruction;
150-
return $this;
151147
}
152148

153149
/**
@@ -168,12 +164,10 @@ public function getSystemInstruction(): ?string
168164
* @since n.e.x.t
169165
*
170166
* @param int $candidateCount The candidate count.
171-
* @return self For method chaining.
172167
*/
173-
public function setCandidateCount(int $candidateCount): self
168+
public function setCandidateCount(int $candidateCount): void
174169
{
175170
$this->candidateCount = $candidateCount;
176-
return $this;
177171
}
178172

179173
/**
@@ -194,12 +188,10 @@ public function getCandidateCount(): ?int
194188
* @since n.e.x.t
195189
*
196190
* @param int $maxTokens The maximum tokens.
197-
* @return self For method chaining.
198191
*/
199-
public function setMaxTokens(int $maxTokens): self
192+
public function setMaxTokens(int $maxTokens): void
200193
{
201194
$this->maxTokens = $maxTokens;
202-
return $this;
203195
}
204196

205197
/**
@@ -220,12 +212,10 @@ public function getMaxTokens(): ?int
220212
* @since n.e.x.t
221213
*
222214
* @param float $temperature The temperature.
223-
* @return self For method chaining.
224215
*/
225-
public function setTemperature(float $temperature): self
216+
public function setTemperature(float $temperature): void
226217
{
227218
$this->temperature = $temperature;
228-
return $this;
229219
}
230220

231221
/**
@@ -246,12 +236,10 @@ public function getTemperature(): ?float
246236
* @since n.e.x.t
247237
*
248238
* @param float $topP The top-p parameter.
249-
* @return self For method chaining.
250239
*/
251-
public function setTopP(float $topP): self
240+
public function setTopP(float $topP): void
252241
{
253242
$this->topP = $topP;
254-
return $this;
255243
}
256244

257245
/**
@@ -272,12 +260,10 @@ public function getTopP(): ?float
272260
* @since n.e.x.t
273261
*
274262
* @param int $topK The top-k parameter.
275-
* @return self For method chaining.
276263
*/
277-
public function setTopK(int $topK): self
264+
public function setTopK(int $topK): void
278265
{
279266
$this->topK = $topK;
280-
return $this;
281267
}
282268

283269
/**
@@ -298,12 +284,10 @@ public function getTopK(): ?int
298284
* @since n.e.x.t
299285
*
300286
* @param string[] $stopSequences The stop sequences.
301-
* @return self For method chaining.
302287
*/
303-
public function setStopSequences(array $stopSequences): self
288+
public function setStopSequences(array $stopSequences): void
304289
{
305290
$this->stopSequences = $stopSequences;
306-
return $this;
307291
}
308292

309293
/**
@@ -324,12 +308,10 @@ public function getStopSequences(): ?array
324308
* @since n.e.x.t
325309
*
326310
* @param float $presencePenalty The presence penalty.
327-
* @return self For method chaining.
328311
*/
329-
public function setPresencePenalty(float $presencePenalty): self
312+
public function setPresencePenalty(float $presencePenalty): void
330313
{
331314
$this->presencePenalty = $presencePenalty;
332-
return $this;
333315
}
334316

335317
/**
@@ -350,12 +332,10 @@ public function getPresencePenalty(): ?float
350332
* @since n.e.x.t
351333
*
352334
* @param float $frequencyPenalty The frequency penalty.
353-
* @return self For method chaining.
354335
*/
355-
public function setFrequencyPenalty(float $frequencyPenalty): self
336+
public function setFrequencyPenalty(float $frequencyPenalty): void
356337
{
357338
$this->frequencyPenalty = $frequencyPenalty;
358-
return $this;
359339
}
360340

361341
/**
@@ -376,12 +356,10 @@ public function getFrequencyPenalty(): ?float
376356
* @since n.e.x.t
377357
*
378358
* @param bool $logprobs Whether to return log probabilities.
379-
* @return self For method chaining.
380359
*/
381-
public function setLogprobs(bool $logprobs): self
360+
public function setLogprobs(bool $logprobs): void
382361
{
383362
$this->logprobs = $logprobs;
384-
return $this;
385363
}
386364

387365
/**
@@ -402,12 +380,10 @@ public function getLogprobs(): ?bool
402380
* @since n.e.x.t
403381
*
404382
* @param int $topLogprobs The number of top log probabilities.
405-
* @return self For method chaining.
406383
*/
407-
public function setTopLogprobs(int $topLogprobs): self
384+
public function setTopLogprobs(int $topLogprobs): void
408385
{
409386
$this->topLogprobs = $topLogprobs;
410-
return $this;
411387
}
412388

413389
/**
@@ -428,12 +404,10 @@ public function getTopLogprobs(): ?int
428404
* @since n.e.x.t
429405
*
430406
* @param Tool[] $tools The tools.
431-
* @return self For method chaining.
432407
*/
433-
public function setTools(array $tools): self
408+
public function setTools(array $tools): void
434409
{
435410
$this->tools = $tools;
436-
return $this;
437411
}
438412

439413
/**
@@ -454,22 +428,20 @@ public function getTools(): ?array
454428
* @since n.e.x.t
455429
*
456430
* @param array<string, mixed> $customOptions The custom options.
457-
* @return self For method chaining.
458431
*/
459-
public function setCustomOptions(array $customOptions): self
432+
public function setCustomOptions(array $customOptions): void
460433
{
461434
$this->customOptions = $customOptions;
462-
return $this;
463435
}
464436

465437
/**
466438
* Gets the custom options.
467439
*
468440
* @since n.e.x.t
469441
*
470-
* @return array<string, mixed>|null The custom options.
442+
* @return array<string, mixed> The custom options.
471443
*/
472-
public function getCustomOptions(): ?array
444+
public function getCustomOptions(): array
473445
{
474446
return $this->customOptions;
475447
}
@@ -629,9 +601,7 @@ public function toArray(): array
629601
}, $this->tools));
630602
}
631603

632-
if ($this->customOptions !== null) {
633-
$data['customOptions'] = $this->customOptions;
634-
}
604+
$data['customOptions'] = $this->customOptions;
635605

636606
return $data;
637607
}

0 commit comments

Comments
 (0)