optimize data retrieve by customfields und enricher
This commit is contained in:
@@ -58,7 +58,7 @@ final readonly class AgentRunner
|
||||
//$includeFullContext = false;
|
||||
if ($includeFullContext) {
|
||||
|
||||
yield $this->systemMsg("Ich analyse deine Anfrage...", "think");
|
||||
yield $this->systemMsg("Ich analysiere deine Anfrage...", "think");
|
||||
|
||||
$promptSwagSearch = '
|
||||
Erzeuge aus dem folgenden Nutzereingabetext einen kurzen Suchtext für die Shopware-6-Suche.
|
||||
@@ -80,6 +80,7 @@ final readonly class AgentRunner
|
||||
';
|
||||
|
||||
$this->thinkSuppressor->reset();
|
||||
|
||||
foreach ($this->ollamaClient->stream($promptSwagSearch) as $swagToken) {
|
||||
|
||||
if (!is_string($swagToken)) {
|
||||
@@ -138,7 +139,6 @@ final readonly class AgentRunner
|
||||
|
||||
yield $this->systemMsg("Denke nach...", "think");
|
||||
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// 5) Build final prompt
|
||||
// ---------------------------------------------------------
|
||||
|
||||
@@ -75,6 +75,7 @@ final readonly class PromptBuilder
|
||||
// 3) LIVE SHOP RESULTS (AUTHORITATIVE FOR PRODUCTS)
|
||||
// ------------------------------------------------------------
|
||||
$shopBlock = '';
|
||||
$isDetailed = !(count($shopResults) > 5);
|
||||
|
||||
if ($shopResults !== []) {
|
||||
$lines = [];
|
||||
@@ -113,6 +114,18 @@ final readonly class PromptBuilder
|
||||
$parts[] = "URL: " . $product->url;
|
||||
}
|
||||
|
||||
if ($product->productImage) {
|
||||
$parts[] = "productImage: " . $product->productImage;
|
||||
}
|
||||
|
||||
if ($isDetailed && $product->description) {
|
||||
$parts[] = "description: " . $product->description;
|
||||
}
|
||||
|
||||
if ($product->customFields) {
|
||||
$parts[] = "Meta-Informationen: " . $product->customFields;
|
||||
}
|
||||
|
||||
$lines[] = implode("\n", $parts);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user