更新
This commit is contained in:
@@ -37,6 +37,7 @@ namespace {
|
||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||
|
||||
use app\common\service\DifyChatService;
|
||||
use app\common\service\NihaixiaClinicalSkill;
|
||||
|
||||
function expectSame($expected, $actual, string $message): void
|
||||
{
|
||||
@@ -210,6 +211,9 @@ foreach (['dify' => 'chat-messages', 'openai' => 'chat/completions'] as $protoco
|
||||
expectSame(true, $strictResult['ok'], 'strict ' . $protocol . ' accepts distinct logical attachments sharing a URL');
|
||||
expectSame(1, count($upstreamTestRequests), 'strict ' . $protocol . ' submits the complete batch once');
|
||||
$payload = $upstreamTestRequests[0]['payload'];
|
||||
$wirePrompt = $protocol === 'dify' ? $payload['query'] : $payload['messages'][0]['content'][0]['text'];
|
||||
expectSame(true, str_contains($wirePrompt, NihaixiaClinicalSkill::VERSION), 'strict ' . $protocol . ' includes the clinical skill on the wire');
|
||||
expectSame(true, str_contains($wirePrompt, 'offline query'), 'strict ' . $protocol . ' preserves the clinical question');
|
||||
$wireUrls = $protocol === 'dify' ? array_column($payload['files'], 'url')
|
||||
: array_column(array_column(array_slice($payload['messages'][0]['content'], 1), 'image_url'), 'url');
|
||||
expectSame(array_column($duplicateFiles, 'url'), $wireUrls, 'strict ' . $protocol . ' transmits every attachment in manifest order');
|
||||
|
||||
Reference in New Issue
Block a user