add new configs

This commit is contained in:
team 1
2026-04-15 08:46:26 +02:00
parent 8cac77ed31
commit 1815a42035
18 changed files with 508 additions and 309 deletions

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Intent;
use App\Config\CatalogIntentConfig;
use App\Knowledge\Retrieval\QueryCleaner;
use App\Tag\TagVectorSearchClient;
use App\Tag\TagTypes;
@@ -24,23 +25,12 @@ use App\Tag\TagTypes;
* - SalesIntent
* - Routing
*/
final class CatalogIntentLite
final readonly class CatalogIntentLite
{
/**
* Minimaler Similarity-Score.
* Verhindert Rauschen.
*/
private const MIN_SCORE = 0.72;
/**
* Differenz zwischen Top1 und Top2,
* damit kein unsicherer Treffer akzeptiert wird.
*/
private const AMBIGUITY_DELTA = 0.02;
public function __construct(
private readonly TagVectorSearchClient $tagVectorClient,
private readonly QueryCleaner $queryCleaner,
private TagVectorSearchClient $tagVectorClient,
private QueryCleaner $queryCleaner
) {}
/**
@@ -67,7 +57,7 @@ final class CatalogIntentLite
$bestScore = (float)($best['score'] ?? 0.0);
// 2) Score-Tags
if ($bestScore < self::MIN_SCORE) {
if ($bestScore < CatalogIntentConfig::MIN_SCORE) {
return null;
}
@@ -75,7 +65,7 @@ final class CatalogIntentLite
if (isset($hits[1])) {
$secondScore = (float)($hits[1]['score'] ?? 0.0);
if (abs($bestScore - $secondScore) < self::AMBIGUITY_DELTA) {
if (abs($bestScore - $secondScore) < CatalogIntentConfig::AMBIGUITY_DELTA) {
return null;
}
}