This commit is contained in:
team 1
2026-05-04 08:38:53 +02:00
parent c5e212f8f2
commit c00cb3a9b9
16 changed files with 482 additions and 88 deletions

View File

@@ -1910,10 +1910,7 @@ final readonly class AgentRunner
$filterTerms = [];
foreach (array_merge(
$this->agentRunnerConfig->getShopQueryMetaOnlyTerms(),
$this->agentRunnerConfig->getShopQueryContextFallbackFilterTerms()
) as $term) {
foreach ($this->getShopQueryContextFallbackFilterTerms() as $term) {
foreach ($this->tokenizeShopQueryCandidate($term) as $token) {
$filterTerms[$token] = true;
}
@@ -1941,6 +1938,43 @@ final readonly class AgentRunner
return implode(' ', $out);
}
/** @return string[] */
private function getShopQueryContextFallbackFilterTerms(): array
{
$profileName = $this->agentRunnerConfig->getShopQueryContextFallbackCleanupProfile();
return $this->mergeUniqueStrings(
$this->mergeUniqueStrings(
$this->languageCleanupConfig->getStopWordsForProfile($profileName),
$this->languageCleanupConfig->getPhrasesForProfile($profileName)
),
$this->mergeUniqueStrings(
$this->languageCleanupConfig->getMetaTermsForProfile($profileName),
$this->mergeUniqueStrings(
$this->agentRunnerConfig->getShopQueryMetaOnlyTerms(),
$this->agentRunnerConfig->getShopQueryContextFallbackFilterTerms()
)
)
);
}
/** @return string[] */
private function getShopQueryMetaGuardTerms(): array
{
$profileName = $this->agentRunnerConfig->getShopQueryContextFallbackCleanupProfile();
return $this->mergeUniqueStrings(
$this->mergeUniqueStrings(
$this->languageCleanupConfig->getStopWordsForProfile($profileName),
$this->languageCleanupConfig->getPhrasesForProfile($profileName)
),
$this->mergeUniqueStrings(
$this->languageCleanupConfig->getMetaTermsForProfile($profileName),
$this->agentRunnerConfig->getShopQueryMetaOnlyTerms()
)
);
}
/**
* @return string[]
*/
@@ -1972,7 +2006,7 @@ final readonly class AgentRunner
}
$metaTerms = [];
foreach ($this->agentRunnerConfig->getShopQueryMetaOnlyTerms() as $term) {
foreach ($this->getShopQueryMetaGuardTerms() as $term) {
foreach ($this->tokenizeMetaGuardText($term) as $token) {
$metaTerms[$token] = true;
}