Skip to content

Commit c22aa7a

Browse files
authored
Merge pull request #21 from utopia-php/copilot/update-default-timeout-adapters
2 parents 8e5c4cc + e373a7c commit c22aa7a

8 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/Agents/Adapter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ abstract class Adapter
4040
protected int $cacheReadInputTokens = 0;
4141

4242
/**
43-
* Request timeout in seconds
43+
* Request timeout in milliseconds
4444
*
4545
* @var int
4646
*/
47-
protected int $timeout = 90;
47+
protected int $timeout = 90000;
4848

4949
/**
5050
* Get the adapter name
@@ -252,7 +252,7 @@ public function getTotalTokens(): int
252252
}
253253

254254
/**
255-
* Set timeout in seconds
255+
* Set timeout in milliseconds
256256
*
257257
* @param int $timeout
258258
* @return self
@@ -265,7 +265,7 @@ public function setTimeout(int $timeout): self
265265
}
266266

267267
/**
268-
* Get timeout in seconds
268+
* Get timeout in milliseconds
269269
*
270270
* @return int
271271
*/

src/Agents/Adapters/Anthropic.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function __construct(
9292
string $model = self::MODEL_CLAUDE_3_HAIKU,
9393
int $maxTokens = 1024,
9494
float $temperature = 1.0,
95-
int $timeout = 90
95+
int $timeout = 90000
9696
) {
9797
$this->apiKey = $apiKey;
9898
$this->maxTokens = $maxTokens;

src/Agents/Adapters/Deepseek.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function __construct(
6161
string $model = self::MODEL_DEEPSEEK_CHAT,
6262
int $maxTokens = 1024,
6363
float $temperature = 1.0,
64-
int $timeout = 90
64+
int $timeout = 90000
6565
) {
6666
$this->apiKey = $apiKey;
6767
$this->maxTokens = $maxTokens;

src/Agents/Adapters/Gemini.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function __construct(
8383
int $maxTokens = 1024,
8484
float $temperature = 1.0,
8585
?string $endpoint = null,
86-
int $timeout = 90
86+
int $timeout = 90000
8787
) {
8888
$this->apiKey = $apiKey;
8989
$this->maxTokens = $maxTokens;

src/Agents/Adapters/Ollama.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Ollama extends Adapter
3737
*/
3838
public function __construct(
3939
string $model = self::MODEL_EMBEDDING_GEMMA,
40-
int $timeout = 90
40+
int $timeout = 90000
4141
) {
4242
if (! in_array($model, self::MODELS, true)) {
4343
throw new \InvalidArgumentException("Invalid model: {$model}. Supported models: ".implode(', ', self::MODELS));

src/Agents/Adapters/OpenAI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function __construct(
9494
int $maxTokens = 1024,
9595
float $temperature = 1.0,
9696
?string $endpoint = null,
97-
int $timeout = 90
97+
int $timeout = 90000
9898
) {
9999
$this->apiKey = $apiKey;
100100
$this->maxTokens = $maxTokens;

src/Agents/Adapters/Perplexity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function __construct(
5454
int $maxTokens = 1024,
5555
float $temperature = 1.0,
5656
?string $endpoint = null,
57-
int $timeout = 90
57+
int $timeout = 90000
5858
) {
5959
parent::__construct(
6060
$apiKey,

src/Agents/Adapters/XAI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(
3939
int $maxTokens = 1024,
4040
float $temperature = 1.0,
4141
?string $endpoint = null,
42-
int $timeout = 90
42+
int $timeout = 90000
4343
) {
4444
parent::__construct(
4545
$apiKey,

0 commit comments

Comments
 (0)