add new configs
This commit is contained in:
29
src/Config/AgentRunnerConfig.php
Normal file
29
src/Config/AgentRunnerConfig.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Config;
|
||||
|
||||
class AgentRunnerConfig
|
||||
{
|
||||
public function getShopPrompt($prompt): string
|
||||
{
|
||||
return '
|
||||
Erzeuge aus dem folgenden Nutzereingabetext einen kurzen Suchtext für die Shopware-6-Suche.
|
||||
|
||||
Regeln:
|
||||
- Gib nur den finalen Suchtext aus.
|
||||
- erstelle immer die singular form von den relevanten Suchbegriffen
|
||||
- Keine Einleitung, keine Erklärung, keine Anführungszeichen.
|
||||
- Verwende nur die shop relevanten Suchbegriffe für eine Shopsuche aus dem Nutzereingabetext.
|
||||
- Maximal 6 Suchbegriffe, besser weniger.
|
||||
- Entferne Füllwörter, Höflichkeitsformen und irrelevante Wörter.
|
||||
- Erhalte Produktnamen, Marken, Modellnummern und zusammengesetzte Begriffe exakt, wenn sie relevant sind.
|
||||
- Zahlen, die zu einem Produktnamen oder Modell gehören (zb Indikator 300 oder Testomat 808), müssen erhalten bleiben.
|
||||
- Trenne die Begriffe nur durch Leerzeichen.
|
||||
|
||||
Ausgabeformat:
|
||||
Keyword1 Keyword2 Keyword3
|
||||
|
||||
Nutzereingabetext: ' . $prompt . '
|
||||
';
|
||||
}
|
||||
}
|
||||
12
src/Config/CatalogIntentConfig.php
Normal file
12
src/Config/CatalogIntentConfig.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Config;
|
||||
|
||||
class CatalogIntentConfig
|
||||
{
|
||||
// Minimum similarity score. Prevents noise.
|
||||
public const MIN_SCORE = 0.72;
|
||||
|
||||
// Difference between Top 1 and Top 2, so that no uncertain match is accepted.
|
||||
public const AMBIGUITY_DELTA = 0.02;
|
||||
}
|
||||
101
src/Config/CommerceIntentConfig.php
Normal file
101
src/Config/CommerceIntentConfig.php
Normal file
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
namespace App\Config;
|
||||
|
||||
class CommerceIntentConfig
|
||||
{
|
||||
public function getStrongSignalsList(): array
|
||||
{
|
||||
return [
|
||||
'suche',
|
||||
'habt',
|
||||
'gibt',
|
||||
'zeig',
|
||||
'welche',
|
||||
'vergleich',
|
||||
'alternativ',
|
||||
'find',
|
||||
'shop',
|
||||
'store',
|
||||
'sku',
|
||||
'Artikel',
|
||||
'Gerät',
|
||||
'testomat',
|
||||
'indikator',
|
||||
'Titromat',
|
||||
'Seminar',
|
||||
'Schulung',
|
||||
'Sensor',
|
||||
'liste'
|
||||
];
|
||||
}
|
||||
|
||||
public function getAdvisorySignals(): array
|
||||
{
|
||||
return [
|
||||
'passt',
|
||||
'eignet',
|
||||
'besser',
|
||||
'besten',
|
||||
'geeignet',
|
||||
'empfiehl',
|
||||
'empfehl',
|
||||
];
|
||||
}
|
||||
|
||||
public function getPricePattern(): string
|
||||
{
|
||||
$pattern = [
|
||||
'euro',
|
||||
'€',
|
||||
'eur',
|
||||
'teuer',
|
||||
'preis',
|
||||
'kosten'
|
||||
];
|
||||
return implode('|', $pattern);
|
||||
}
|
||||
|
||||
public function getColorPattern(): string
|
||||
{
|
||||
$pattern = [
|
||||
'schwarz',
|
||||
'weiß',
|
||||
'weis',
|
||||
'blau',
|
||||
'grau',
|
||||
'beige',
|
||||
'rosa',
|
||||
'pink',
|
||||
'gruen',
|
||||
'orange',
|
||||
'braun'
|
||||
];
|
||||
return implode('|', $pattern);
|
||||
}
|
||||
|
||||
public function getSizeTokenPattern(): string
|
||||
{
|
||||
$pattern = [
|
||||
'xs',
|
||||
's',
|
||||
'm',
|
||||
'l',
|
||||
'xl',
|
||||
'',
|
||||
'xxl',
|
||||
'xxxxl',
|
||||
];
|
||||
return implode('|', $pattern);
|
||||
}
|
||||
|
||||
public function getSizePattern(): string
|
||||
{
|
||||
$pattern = [
|
||||
'größe',
|
||||
'groesse',
|
||||
'grösse'
|
||||
];
|
||||
return implode('|', $pattern);
|
||||
}
|
||||
}
|
||||
32
src/Config/CommerceQueryParserConfig.php
Normal file
32
src/Config/CommerceQueryParserConfig.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Config;
|
||||
|
||||
class CommerceQueryParserConfig
|
||||
{
|
||||
public function getKnownBrands(): array
|
||||
{
|
||||
return [
|
||||
'heyl',
|
||||
'horiba',
|
||||
'neomeris'
|
||||
];
|
||||
}
|
||||
|
||||
public function getPhrasesToRemove(): array{
|
||||
return [
|
||||
'ich suche',
|
||||
'suche',
|
||||
'habt ihr',
|
||||
'gibt es',
|
||||
'zeige mir',
|
||||
'welches gerät',
|
||||
'welche gerät',
|
||||
'welches modell',
|
||||
'welches ist besser',
|
||||
'welches ist am besten',
|
||||
'alternative',
|
||||
'alternativen',
|
||||
];
|
||||
}
|
||||
}
|
||||
12
src/Config/ContextServiceConfig.php
Normal file
12
src/Config/ContextServiceConfig.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Config;
|
||||
|
||||
class ContextServiceConfig
|
||||
{
|
||||
//Number of lines included in regular context. Intended for normal conversational continuity.
|
||||
public const MAX_VISIBLE_REGULAR_LINES = 25;
|
||||
|
||||
//Number of lines included in full context. Intended for exceptional or diagnostic scenarios.
|
||||
public const MAX_FULL_LINES = 500;
|
||||
}
|
||||
50
src/Config/IntentLightConfig.php
Normal file
50
src/Config/IntentLightConfig.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Config;
|
||||
|
||||
class IntentLightConfig
|
||||
{
|
||||
public const LIST_THRESHOLD = 4;
|
||||
|
||||
public function getQuantityWords(): array
|
||||
{
|
||||
return [
|
||||
'alle',
|
||||
'sämtliche',
|
||||
'saemtliche',
|
||||
'mehrere',
|
||||
'verschiedene',
|
||||
'einige',
|
||||
'viele',
|
||||
'optionen',
|
||||
'möglichkeiten',
|
||||
'moeglichkeiten',
|
||||
'varianten',
|
||||
'arten',
|
||||
'modelle',
|
||||
'funktionen',
|
||||
'punkte',
|
||||
'schritte',
|
||||
'kategorien',
|
||||
'übersicht',
|
||||
'uebersicht',
|
||||
];
|
||||
}
|
||||
|
||||
public function getStrongPatterns(): array
|
||||
{
|
||||
return [
|
||||
'/\bliste(n)?\b/u',
|
||||
'/\bauflisten\b/u',
|
||||
'/\baufz(a|ä)hl(en)?\b/u',
|
||||
'/\bnenn(e)?\b/u',
|
||||
'/\bzeig(e)?\b/u',
|
||||
'/\bwelche\s+sind\b/u',
|
||||
'/\bwelche\s+gibt\s+es\b/u',
|
||||
'/\bwas\s+sind\b/u',
|
||||
'/\bwie\s+viele\b/u',
|
||||
'/\branking\b/u',
|
||||
'/\btop\s*\d+\b/u',
|
||||
];
|
||||
}
|
||||
}
|
||||
21
src/Config/NdjsonHybridRetrieverConfig.php
Normal file
21
src/Config/NdjsonHybridRetrieverConfig.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Config;
|
||||
|
||||
class NdjsonHybridRetrieverConfig
|
||||
{
|
||||
public const VECTOR_SCORE_THRESHOLD = 0.75;
|
||||
|
||||
public const HARD_MAX_CHUNKS = 90;
|
||||
public const HARD_MAX_VECTORK = 250;
|
||||
|
||||
public const LIST_BONUS = 1.25;
|
||||
|
||||
public const MAX_CHUNKS_PER_DOC = 2;
|
||||
public const MIN_CHUNK_DISTANCE = 2.5;
|
||||
public const RRF_K = 60;
|
||||
|
||||
public const THRESHOLD_FLOOR = 0.83;
|
||||
public const THRESHOLD_CEIL = 0.92;
|
||||
public const EMPTY_RRF_FALLBACK_TOPN = 1;
|
||||
}
|
||||
65
src/Config/SalesIntentConfig.php
Normal file
65
src/Config/SalesIntentConfig.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace App\Config;
|
||||
|
||||
class SalesIntentConfig
|
||||
{
|
||||
|
||||
// Minimum gap between Top 1 and Top 2 so that an intent is truly dominant.
|
||||
public const DOMINANCE_DELTA = 2;
|
||||
|
||||
// Minimum score required for any non-discovery intent to be accepted.
|
||||
public const MIN_SCORE_THRESHOLD = 3;
|
||||
|
||||
|
||||
public function getSalesSignals(): array
|
||||
{
|
||||
return [
|
||||
'preis', 'preise', 'kosten', 'lizenz', 'lizenzmodell',
|
||||
'tarif', 'tarife', 'gebuehr', 'gebühr',
|
||||
'monatlich', 'jaehrlich', 'jährlich', 'abo', 'subscription'
|
||||
];
|
||||
}
|
||||
|
||||
public function getComparisonSignals(): array
|
||||
{
|
||||
return [
|
||||
'/\bvergleich(en)?\b/u',
|
||||
'/\bvs\b/u',
|
||||
'/\bgegenueber\b/u',
|
||||
'/\balternative(n)?\b/u',
|
||||
'/\bunterschied(e)?\b/u',
|
||||
'/\bbesser\b/u'
|
||||
];
|
||||
}
|
||||
|
||||
public function getObjectionSignals(): array
|
||||
{
|
||||
return [
|
||||
'problem', 'risiko', 'nachteil', 'datenschutz',
|
||||
'dsgvo', 'sicherheit', 'compliance',
|
||||
'kritik', 'zweifel', 'unsicher'
|
||||
];
|
||||
}
|
||||
public function getImplementationSignals(): array
|
||||
{
|
||||
return [
|
||||
'implementierung', 'implementieren',
|
||||
'integration', 'integrieren',
|
||||
'einführung', 'einfuehrung',
|
||||
'aufwand', 'setup', 'rollout',
|
||||
'migration', 'installation',
|
||||
'api', 'schnittstelle'
|
||||
];
|
||||
}
|
||||
public function getRoiSignals(): array
|
||||
{
|
||||
return [
|
||||
'roi', 'rentabilitaet', 'rentabilität',
|
||||
'business case', 'einsparung',
|
||||
'kosten senken', 'umsatz steigern',
|
||||
'effizienz steigern'
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user