add used sources
This commit is contained in:
@@ -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[]= '<span class="badge bg-info text-black">Externe URL</span>';
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
@@ -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[]= '<span class="badge bg-info text-black">RAG Wissen</span>';
|
||||
}
|
||||
// ---------------------------------------------------------
|
||||
// 4) commerce/shop search
|
||||
@@ -133,7 +133,7 @@ final readonly class AgentRunner
|
||||
}
|
||||
|
||||
if($shopResults){
|
||||
$sources[]= 'Shopsystem';
|
||||
$sources[]= '<span class="badge bg-info text-black">Shopsystem</span>';
|
||||
}
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user