Skip to content

Commit 5f10c9b

Browse files
authored
Update Image.php
1 parent 012b541 commit 5f10c9b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Image.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ public function generations(array $data, array $options)
4242
}
4343
];
4444
$model = $data['model'] ?? '';
45-
$path = $this->isAzure ? "/openai/deployments/$model/images/generations?api-version=$this->azureApiVersion" : "/v1/images/generations";
46-
$http = new Client(['timeout' => 300]);
47-
$http->request($this->api . $path, $requestOptions);
45+
$url = $this->api;
46+
if (!parse_url($this->api, PHP_URL_PATH)) {
47+
$url = $this->api . ($this->isAzure ? "/openai/deployments/$model/images/generations?api-version=$this->azureApiVersion" : "/v1/images/generations");
48+
}
49+
$http = new Client(['timeout' => 600]);
50+
$http->request($url, $requestOptions);
4851
}
4952

5053
/**

0 commit comments

Comments
 (0)