This commit is contained in:
team 1
2026-05-04 16:33:36 +02:00
parent 33b2b30d99
commit 387506b239
13 changed files with 198 additions and 57 deletions

View File

@@ -985,12 +985,7 @@ final readonly class AgentRunner
private function normalizeFuzzyRoutingToken(string $token): string
{
$token = mb_strtolower(trim($token), 'UTF-8');
$token = strtr($token, [
'ä' => 'ae',
'ö' => 'oe',
'ü' => 'ue',
'ß' => 'ss',
]);
$token = $this->languageCleanupConfig->transliterateToAscii($token);
$token = preg_replace('/[^a-z0-9]+/u', '', $token) ?? $token;
return trim($token);
@@ -1028,13 +1023,13 @@ final readonly class AgentRunner
{
$normalized = $this->normalizeRoutingComparisonText($candidate);
return in_array($normalized, [
'normalized user input',
'corrected user input',
'user input',
'normalisierte nutzereingabe',
'korrigierte nutzereingabe',
], true);
foreach ($this->agentRunnerConfig->getInputNormalizationPlaceholderOutputs() as $placeholderOutput) {
if ($normalized === $this->normalizeRoutingComparisonText($placeholderOutput)) {
return true;
}
}
return false;
}
private function normalizeRoutingComparisonText(string $value): string
@@ -2857,12 +2852,7 @@ final readonly class AgentRunner
$value = html_entity_decode(strip_tags($value), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
$value = mb_strtolower($value, 'UTF-8');
$value = str_replace(['', '', '', '', '—'], '-', $value);
$value = strtr($value, [
'ä' => 'ae',
'ö' => 'oe',
'ü' => 'ue',
'ß' => 'ss',
]);
$value = $this->languageCleanupConfig->transliterateToAscii($value);
$value = preg_replace('/\s+/u', ' ', $value) ?? $value;
return trim($value);
@@ -3241,14 +3231,15 @@ final readonly class AgentRunner
$actions = [];
if ($isCommerceIntent || $hasShopResults) {
$actions[] = ['Im Shop suchen', 'Suche die aktuelle Produktauswahl im Shop.'];
$actions[] = ['Nur Zubehör anzeigen', 'Zeige aus der aktuellen Produktauswahl nur Zubehör.'];
$actions[] = ['Nur Geräte anzeigen', 'Zeige aus der aktuellen Produktauswahl nur Geräte.'];
$actions[] = ['Preis anzeigen', 'Zeige mir die Preise der aktuell relevanten Produkte.'];
foreach ($this->agentRunnerConfig->getCommerceFollowUpActions() as $label => $actionPrompt) {
$actions[] = [$label, $actionPrompt];
}
}
if ($hasKnowledge || $hasShopResults) {
$actions[] = ['Technische Details anzeigen', 'Zeige technische Details zur aktuellen Antwort.'];
foreach ($this->agentRunnerConfig->getKnowledgeFollowUpActions() as $label => $actionPrompt) {
$actions[] = [$label, $actionPrompt];
}
}
if ($actions === []) {