optimize intention
This commit is contained in:
@@ -58,12 +58,16 @@ final readonly class AskSseController
|
||||
// ---------------------------------------------------------
|
||||
// 🔥 FIXED: Sende Chunks direkt (behält \n!)
|
||||
// ---------------------------------------------------------
|
||||
foreach ($this->agentRunner->run($prompt, $clientId,true) as $chunk) {
|
||||
// Normalize line endings
|
||||
$chunk = str_replace(["\r\n", "\r"], "\n", $chunk);
|
||||
try {
|
||||
foreach ($this->agentRunner->run($prompt, $clientId, true) as $chunk) {
|
||||
$chunk = str_replace(["\r\n", "\r"], "\n", $chunk);
|
||||
$this->sendData($chunk);
|
||||
}
|
||||
|
||||
// Sende Chunk direkt mit \n
|
||||
$this->sendData($chunk);
|
||||
$this->sendEvent('done', '[DONE]');
|
||||
} catch (\Throwable $e) {
|
||||
$this->sendData('<span class="text-danger">❌ Stream abgebrochen: ' . $e->getMessage() . '</span>');
|
||||
$this->sendEvent('done', '[DONE]');
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user