@@ -49,6 +49,7 @@ class DeepSeekClient implements ClientContract
49
49
protected bool $ stream ;
50
50
51
51
protected float $ temperature ;
52
+ protected int $ maxTokens ;
52
53
53
54
/**
54
55
* response result contract
@@ -79,6 +80,7 @@ public function __construct(ClientInterface $httpClient)
79
80
$ this ->requestMethod = 'POST ' ;
80
81
$ this ->endpointSuffixes = EndpointSuffixes::CHAT ->value ;
81
82
$ this ->temperature = (float ) TemperatureValues::GENERAL_CONVERSATION ->value ;
83
+ $ this ->maxTokens = (int ) TemperatureValues::MAX_TOKENS ->value ;
82
84
$ this ->tools = null ;
83
85
}
84
86
@@ -89,6 +91,7 @@ public function run(): string
89
91
QueryFlags::MODEL ->value => $ this ->model ,
90
92
QueryFlags::STREAM ->value => $ this ->stream ,
91
93
QueryFlags::TEMPERATURE ->value => $ this ->temperature ,
94
+ QueryFlags::MAX_TOKENS ->value => $ this ->maxTokens ,
92
95
QueryFlags::TOOLS ->value => $ this ->tools ,
93
96
];
94
97
@@ -183,6 +186,12 @@ public function setTemperature(float $temperature): self
183
186
return $ this ;
184
187
}
185
188
189
+ public function setMaxTokens (int $ maxTokens ): self
190
+ {
191
+ $ this ->maxTokens = $ maxTokens ;
192
+ return $ this ;
193
+ }
194
+
186
195
public function buildQuery (string $ content , ?string $ role = null ): array
187
196
{
188
197
return [
0 commit comments