last update before full new 1.5.0

This commit is contained in:
team2
2026-04-29 20:05:16 +02:00
parent 19c0f612dc
commit e39a57e00b
5 changed files with 423 additions and 107 deletions

View File

@@ -25,6 +25,56 @@ final class AgentRunnerConfig
'pockettester',
];
private const RAG_EVIDENCE_STOP_TERMS = [
'suche',
'suchen',
'finde',
'finden',
'zeige',
'einen',
'eine',
'einem',
'einer',
'der',
'die',
'das',
'den',
'dem',
'des',
'für',
'fuer',
'mit',
'ohne',
'und',
'oder',
'kann',
'können',
'koennen',
'messen',
'messung',
'tester',
'testgerät',
'testgeraet',
'gerät',
'geraet',
'messgerät',
'messgeraet',
'produkt',
'produkte',
'artikel',
'shop',
];
private const RAG_EVIDENCE_SYNONYMS = [
'salinität' => ['salinität', 'salinitaet', 'salinity', 'salzgehalt', 'tds', 'leitfähigkeit', 'leitfaehigkeit'],
'salinitaet' => ['salinität', 'salinitaet', 'salinity', 'salzgehalt', 'tds', 'leitfähigkeit', 'leitfaehigkeit'],
'salinity' => ['salinität', 'salinitaet', 'salinity', 'salzgehalt', 'tds', 'leitfähigkeit', 'leitfaehigkeit'],
'redox' => ['redox', 'orp', 'oxidations-reduktionspotential', 'oxidations reduktionspotential'],
'orp' => ['redox', 'orp', 'oxidations-reduktionspotential', 'oxidations reduktionspotential'],
'ph' => ['ph', 'ph-wert', 'ph wert'],
'chlor' => ['chlor', 'freies chlor', 'gesamtchlor', 'chlorine'],
];
private const NO_LLM_ACCESSORY_PRODUCT_ROLE_KEYWORDS = [
'indikator',
'indicator',
@@ -228,6 +278,57 @@ final class AgentRunnerConfig
return $this->getInt('no_llm_fallback.max_shop_results', 5);
}
/**
* @return string[]
*/
public function getRagEvidenceStopTerms(): array
{
return $this->getStringList('rag_evidence_guard.stop_terms', self::RAG_EVIDENCE_STOP_TERMS);
}
/**
* @return array<string, string[]>
*/
public function getRagEvidenceSynonyms(): array
{
$value = $this->value('rag_evidence_guard.synonyms', self::RAG_EVIDENCE_SYNONYMS);
if (!is_array($value)) {
return self::RAG_EVIDENCE_SYNONYMS;
}
$out = [];
foreach ($value as $key => $items) {
if (!is_scalar($key) || !is_array($items)) {
continue;
}
$key = trim((string) $key);
if ($key === '') {
continue;
}
$terms = [];
foreach ($items as $item) {
if (!is_scalar($item)) {
continue;
}
$item = trim((string) $item);
if ($item !== '' && !in_array($item, $terms, true)) {
$terms[] = $item;
}
}
if ($terms !== []) {
$out[$key] = $terms;
}
}
return $out !== [] ? $out : self::RAG_EVIDENCE_SYNONYMS;
}
public function getNoLlmFallbackShopOnlyMessage(): string
{
return $this->getString(