更新
This commit is contained in:
@@ -288,11 +288,11 @@ $openAiInputSpec = ['protocol' => 'openai'];
|
||||
expectSame(
|
||||
true,
|
||||
callPrivate('isInputRejection', [
|
||||
['errno' => 0, 'http_code' => 400, 'body' => '{"code":"invalid_param"}'],
|
||||
['errno' => 0, 'http_code' => 400, 'body' => '{"code":"invalid_param","message":"Unknown input variable: prompt_version"}'],
|
||||
$difyInputSpec,
|
||||
['prompt_version' => 'v2'],
|
||||
]),
|
||||
'Dify invalid_param retries with query-only input'
|
||||
'an explicit undeclared Dify input retries with query-only input'
|
||||
);
|
||||
expectSame(
|
||||
false,
|
||||
@@ -329,12 +329,13 @@ expectSame(
|
||||
'http_code' => 200,
|
||||
'upstream_error' => true,
|
||||
'upstream_code' => 'invalid_param',
|
||||
'upstream_reason' => 'inputs_invalid',
|
||||
'emitted' => false,
|
||||
],
|
||||
$difyInputSpec,
|
||||
['prompt_version' => 'v2'],
|
||||
]),
|
||||
'a streaming invalid_param before any delta also retries without inputs'
|
||||
'an explicit streaming inputs error before any delta retries without inputs'
|
||||
);
|
||||
expectSame(
|
||||
false,
|
||||
@@ -344,6 +345,7 @@ expectSame(
|
||||
'http_code' => 200,
|
||||
'upstream_error' => true,
|
||||
'upstream_code' => 'invalid_param',
|
||||
'upstream_reason' => 'inputs_invalid',
|
||||
'emitted' => true,
|
||||
],
|
||||
$difyInputSpec,
|
||||
@@ -358,8 +360,8 @@ expectSame(false, callPrivate('shouldRetryWithoutFiles', [400, []]), 'a text-onl
|
||||
expectSame(false, callPrivate('shouldRetryWithoutFiles', [401, $capped['kept']]), 'a credential failure is not retried');
|
||||
expectSame(false, callPrivate('shouldRetryWithoutFiles', [500, $capped['kept']]), 'an upstream outage is not retried here');
|
||||
|
||||
// 协议回退会把最初的“附件被拒”换成另一协议的状态码(Dify 400 -> OpenAI 404),
|
||||
// 降级判断必须按每次响应累计,否则去掉附件的重试永远不会发生。
|
||||
// Optional legacy files retain their historic text fallback; required clinical
|
||||
// files use the affirmative-evidence flag tested by DifyRequiredFilesRejectionClassificationTest.
|
||||
expectSame(
|
||||
true,
|
||||
callPrivate('isFileRejection', [['errno' => 0, 'http_code' => 400], $capped['kept']]),
|
||||
|
||||
Reference in New Issue
Block a user