This commit is contained in:
gr
2026-10-30 13:43:29 +08:00
144 changed files with 16467 additions and 2457 deletions
@@ -5,7 +5,7 @@ declare(strict_types=1);
namespace app\adminapi\service;
/**
* 诊单 AI 助手 SSE 事件状态机:start -> (progress|delta)* -> done|error。
* 诊单 AI 助手 SSE 事件状态机:start -> (progress|delta|live_update)* -> done|error。
*/
final class AssistantSseProtocol
{
@@ -22,7 +22,7 @@ final class AssistantSseProtocol
/** @param array<string,mixed> $payload */
public function encode(string $event, array $payload): ?string
{
if ($this->terminal || !in_array($event, ['start', 'progress', 'delta', 'done', 'error'], true)) {
if ($this->terminal || !in_array($event, ['start', 'progress', 'delta', 'live_update', 'done', 'error'], true)) {
return null;
}
if ((!$this->started && $event !== 'start') || ($this->started && $event === 'start')) {