更新
This commit is contained in:
@@ -95,6 +95,25 @@ $explicitOpenAi = callDifyStreamPrivate('buildRequestSpecs', [
|
||||
difyStreamExpect(count($explicitDify) === 1 && $explicitDify[0]['protocol'] === 'dify', 'explicit Dify endpoint never changes protocol');
|
||||
difyStreamExpect(count($explicitOpenAi) === 1 && $explicitOpenAi[0]['protocol'] === 'openai', 'explicit OpenAI endpoint never changes protocol');
|
||||
|
||||
$progressOption = callDifyStreamPrivate('curlProgressOption', []);
|
||||
$expectedProgressOption = null;
|
||||
foreach (['CURLOPT_XFERINFOFUNCTION', 'CURLOPT_PROGRESSFUNCTION'] as $optionName) {
|
||||
if (defined($optionName)) {
|
||||
$expectedProgressOption = (int) constant($optionName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
difyStreamExpect(
|
||||
$progressOption === $expectedProgressOption,
|
||||
'stream cancellation selects the newest cURL progress callback available at runtime'
|
||||
);
|
||||
$serviceSource = file_get_contents(dirname(__DIR__) . '/app/common/service/DifyChatService.php');
|
||||
difyStreamExpect(
|
||||
is_string($serviceSource)
|
||||
&& str_contains($serviceSource, "'CURLOPT_XFERINFOFUNCTION', 'CURLOPT_PROGRESSFUNCTION'"),
|
||||
'stream cancellation retains the libcurl 7.29 progress callback fallback'
|
||||
);
|
||||
|
||||
$retryableStream = [
|
||||
'errno' => 0,
|
||||
'http_code' => 200,
|
||||
|
||||
Reference in New Issue
Block a user