From 992b3d0be3d5aea14e3be66316c7a593f15ddb1f Mon Sep 17 00:00:00 2001 From: team 1 Date: Fri, 17 Apr 2026 09:42:25 +0200 Subject: [PATCH] add used sources --- src/Agent/AgentRunner.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Agent/AgentRunner.php b/src/Agent/AgentRunner.php index 620cdc3..109a2cf 100644 --- a/src/Agent/AgentRunner.php +++ b/src/Agent/AgentRunner.php @@ -72,7 +72,7 @@ final readonly class AgentRunner yield $this->systemMsg("Ich prüfe auf Internet Quellen...", "think"); $urlContent = $this->urlAnalyzer->extractContentFromPrompt($prompt); if($urlContent){ - $sources[]= 'Externe URL'; + $sources[]= 'Externe URL'; } // --------------------------------------------------------- @@ -81,7 +81,7 @@ final readonly class AgentRunner yield $this->systemMsg("Ich hole relevante Daten aus meinem RAG Wissen...", "think"); $knowledgeChunks = $this->retriever->retrieve($prompt); if($knowledgeChunks){ - $sources[]= 'RAG Wissen'; + $sources[]= 'RAG Wissen'; } // --------------------------------------------------------- // 4) commerce/shop search @@ -133,7 +133,7 @@ final readonly class AgentRunner } if($shopResults){ - $sources[]= 'Shopsystem'; + $sources[]= 'Shopsystem'; } if ($commerceIntent === CommerceIntentLite::PRODUCT_SEARCH) { @@ -147,6 +147,7 @@ final readonly class AgentRunner // --------------------------------------------------------- // 5) Build final prompt // --------------------------------------------------------- + $finalPrompt = $this->promptBuilder->build( prompt: $prompt, userId: $userId, @@ -179,7 +180,7 @@ final readonly class AgentRunner $this->thinkSuppressor->reset(); if($sources){ - yield $this->systemMsg("Genutze Quellen: ".implode(', ',$sources), 'info'); + yield $this->systemMsg("Genutze Quellen: ".implode(' ',$sources), 'info'); } foreach ($this->ollamaClient->stream($finalPrompt) as $token) { @@ -217,7 +218,7 @@ final readonly class AgentRunner } if($sources){ - yield $this->systemMsg("Quellen: ".implode(', ',$sources), 'info'); + yield $this->systemMsg("Quellen: ".implode(' ',$sources), 'info'); } // ---------------------------------------------------------