optimize technical truth
This commit is contained in:
@@ -11,7 +11,8 @@ final class PromptBuilderConfig
|
||||
'messgeräte', 'messgeraete', 'analysegerät', 'analysegeraet', 'analysegeräte',
|
||||
'analysegeraete', 'analysator', 'analysatoren', 'analyzer', 'gerät', 'geraet',
|
||||
'geräte', 'geraete', 'system', 'systeme', 'monitor', 'monitore', 'controller',
|
||||
'testomat', 'testomaten', 'testoamt', 'testomate', 'pockettester',
|
||||
'tester', 'pocket tester', 'pockettester', 'handmessgerät', 'handmessgeraet',
|
||||
'überwachungsgerät', 'ueberwachungsgeraet', 'testomat', 'testoamt',
|
||||
];
|
||||
|
||||
private const MAIN_DEVICE_PRODUCT_ROLE_KEYWORDS = [
|
||||
@@ -20,7 +21,11 @@ final class PromptBuilderConfig
|
||||
'analysatoren', 'analyzer', 'online-analysator', 'online analysator',
|
||||
'online-analysegerät', 'online analysegeraet', 'gerät', 'geraet', 'geräte',
|
||||
'geraete', 'system', 'systeme', 'monitor', 'monitore', 'controller',
|
||||
'testomat', 'testomaten', 'pockettester',
|
||||
'tester', 'pocket tester', 'pockettester', 'handmessgerät', 'handmessgeraet',
|
||||
'labor messgerät', 'labor-messgerät', 'labor messgeraet', 'labor-messgeraet',
|
||||
'kombimessgerät', 'kombi-messgerät', 'kombimessgeraet', 'kombi-messgeraet',
|
||||
'überwachungsgerät', 'ueberwachungsgeraet', 'messumformer', 'transmitter',
|
||||
'regler', 'testomat',
|
||||
];
|
||||
|
||||
private const ACCESSORY_PRODUCT_ROLE_KEYWORDS = [
|
||||
@@ -29,9 +34,10 @@ final class PromptBuilderConfig
|
||||
'verbrauchsmaterial', 'consumable', 'nachfüll', 'nachfuell', 'refill',
|
||||
'lösung', 'loesung', 'solution', 'teststreifen', 'test strip', 'filter',
|
||||
'pumpenkopf', 'motorblock', 'service set', 'serviceset', 'service-set',
|
||||
'kalibrierlösung', 'kalibrierloesung', 'pufferlösung', 'pufferloesung',
|
||||
'reinigungslösung', 'reinigungsloesung', 'flasche', 'bottle', '100 ml', '500 ml',
|
||||
'100ml', '500ml',
|
||||
'elektrode', 'elektroden', 'electrode', 'electrodes', 'glasschaft-elektrode',
|
||||
'kunststoffschaft-elektrode', 'sensor', 'sensoren', 'sensors', 'sonde',
|
||||
'sonden', 'probe', 'probes', 'messsonde', 'elektrolyt', 'kabel', 'adapter',
|
||||
'ph-indikator', 'ph indikator', 'ph-indikatoren', 'ph indikatoren',
|
||||
];
|
||||
|
||||
private const TECHNICAL_PRODUCT_KEYWORDS = [
|
||||
@@ -87,58 +93,34 @@ final class PromptBuilderConfig
|
||||
'id' => 'ph',
|
||||
'label' => 'pH / pH-Wert',
|
||||
'request_terms' => ['ph', 'pH', 'pH-Wert', 'ph-wert', 'ph wert'],
|
||||
'positive_terms' => [
|
||||
'pH-Messung',
|
||||
'pH Messung',
|
||||
'pH-Messgeraet',
|
||||
'pH Messgeraet',
|
||||
'pH-Wert messen',
|
||||
'pH Wert messen',
|
||||
'pH-Werte messen',
|
||||
'pH Werte messen',
|
||||
'misst pH',
|
||||
'misst den pH',
|
||||
'misst pH-Wert',
|
||||
'misst den pH-Wert',
|
||||
'Messparameter pH',
|
||||
'Messparameter pH-Wert',
|
||||
'Messgroesse pH',
|
||||
'Messgroesse pH-Wert',
|
||||
],
|
||||
'non_equivalent_terms' => [
|
||||
'p-Wert',
|
||||
'p Wert',
|
||||
'm-Wert',
|
||||
'minus m-Wert',
|
||||
'Alkalität',
|
||||
'Säurekapazität',
|
||||
'mmol/l',
|
||||
'pH-Bereich',
|
||||
'Betriebsbereich',
|
||||
'stoerungsfreier Betrieb',
|
||||
'pH-Wert bei',
|
||||
'Reagenz',
|
||||
'Indikator',
|
||||
'4-20 mA Ausgang',
|
||||
'pH-Wertuebertragung',
|
||||
],
|
||||
'safe_no_evidence_answer_de' => 'Ich finde in den bereitgestellten Quellen keinen sicher belegten Testomat, der pH als Messparameter misst.',
|
||||
'positive_terms' => ['pH', 'pH-Wert', 'ph-wert', 'ph wert'],
|
||||
'positive_context_terms' => ['Messung', 'messen', 'misst', 'Messbereich', 'Messparameter', 'Messgröße', 'Messgroesse', 'Bestimmung', 'bestimmen', 'Analyse', 'analysiert', 'überwachen', 'ueberwachen', 'Indikator für', 'Indikator fuer', 'Reagenz für', 'Reagenz fuer', 'Sensor', 'Elektrode'],
|
||||
'negative_context_terms' => ['Betriebsbereich', 'Betriebsumgebung', 'Einsatzbedingungen', 'störungsfrei', 'stoerungsfrei', 'pH-Wert bei', 'ph wert bei', 'ph-wert bei', 'bei 20 °C', 'bei 20 °c', 'bei 20°C', 'bei 20°c', 'Reagenzlösung hat', 'Loesung hat', 'Lösung hat'],
|
||||
'non_equivalent_terms' => ['p-Wert', 'p Wert', 'm-Wert', 'minus m-Wert', 'Alkalität', 'Säurekapazität', 'mmol/l'],
|
||||
'safe_no_evidence_answer_de' => 'Ich finde in den bereitgestellten Quellen keinen sicher belegten Testomat für pH-Messung.',
|
||||
'safe_no_accessory_evidence_answer_de' => 'Ich finde in den bereitgestellten Quellen keinen sicher belegten pH-Indikator oder ein pH-Reagenz für Messgeräte.',
|
||||
],
|
||||
[
|
||||
'id' => 'redox',
|
||||
'label' => 'Redox / ORP',
|
||||
'request_terms' => ['redox', 'orp', 'oxidations-reduktionspotential', 'oxidations reduktionspotential'],
|
||||
'positive_terms' => ['Redox', 'ORP', 'Oxidations-Reduktionspotential', 'Oxidations Reduktionspotential'],
|
||||
'positive_context_terms' => ['Messung', 'messen', 'misst', 'Messbereich', 'Messparameter', 'Messgröße', 'Messgroesse', 'Bestimmung', 'bestimmen', 'Analyse', 'analysiert', 'überwachen', 'ueberwachen', 'Indikator für', 'Indikator fuer', 'Reagenz für', 'Reagenz fuer', 'Sensor', 'Elektrode'],
|
||||
'negative_context_terms' => ['Betriebsbereich', 'Betriebsumgebung', 'Einsatzbedingungen', 'störungsfrei', 'stoerungsfrei'],
|
||||
'non_equivalent_terms' => [],
|
||||
'safe_no_evidence_answer_de' => 'Ich finde in den bereitgestellten Quellen keinen sicher belegten Treffer für Redox-/ORP-Messung.',
|
||||
'safe_no_accessory_evidence_answer_de' => 'Ich finde in den bereitgestellten Quellen keinen sicher belegten Redox-/ORP-Indikator oder ein Redox-/ORP-Reagenz für Messgeräte.',
|
||||
],
|
||||
[
|
||||
'id' => 'free_chlorine',
|
||||
'label' => 'freies Chlor',
|
||||
'request_terms' => ['freies chlor', 'freiem chlor', 'freien chlor', 'free chlorine'],
|
||||
'positive_terms' => ['freies Chlor', 'freiem Chlor', 'freien Chlor', 'free chlorine'],
|
||||
'positive_context_terms' => ['Messung', 'messen', 'misst', 'Messbereich', 'Messparameter', 'Messgröße', 'Messgroesse', 'Bestimmung', 'bestimmen', 'Analyse', 'analysiert', 'überwachen', 'ueberwachen', 'Indikator für', 'Indikator fuer', 'Reagenz für', 'Reagenz fuer', 'Sensor', 'Elektrode'],
|
||||
'negative_context_terms' => ['Betriebsbereich', 'Betriebsumgebung', 'Einsatzbedingungen', 'störungsfrei', 'stoerungsfrei'],
|
||||
'non_equivalent_terms' => ['Chlor gesamt', 'Gesamtchlor', 'total chlorine'],
|
||||
'safe_no_evidence_answer_de' => 'Ich finde in den bereitgestellten Quellen keinen sicher belegten Treffer für die Messung von freiem Chlor.',
|
||||
'safe_no_accessory_evidence_answer_de' => 'Ich finde in den bereitgestellten Quellen keinen sicher belegten Indikator oder ein Reagenz für die Messung von freiem Chlor.',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -150,6 +132,11 @@ final class PromptBuilderConfig
|
||||
'zubehor',
|
||||
'dazu',
|
||||
'indikator',
|
||||
'indikatoren',
|
||||
'ph-indikator',
|
||||
'ph indikator',
|
||||
'ph-indikatoren',
|
||||
'ph indikatoren',
|
||||
'reagenz',
|
||||
'kit',
|
||||
'set',
|
||||
@@ -440,6 +427,7 @@ final class PromptBuilderConfig
|
||||
'- Prefer transparent uncertainty over a confident but unsupported answer.',
|
||||
'- Never present missing or weak evidence as proof that a product, value, accessory, or suitability does not exist.',
|
||||
'- A negative answer is allowed only when the provided sources explicitly support that negative finding for the asked scope.',
|
||||
'- If the sources merely do not prove suitability, answer as missing evidence instead of as a definitive exclusion. Avoid words such as "ausschließlich", "keines", or "nicht geeignet" unless directly grounded.',
|
||||
'- If several products, parameters, or accessories could match, ask one focused clarification question instead of guessing.',
|
||||
'- For risky or binding product selection, state that sales or support should verify the application before a final selection.',
|
||||
]);
|
||||
@@ -485,6 +473,9 @@ final class PromptBuilderConfig
|
||||
'- Do not generate external alternative lists, vendor suggestions, or purchase recommendations unless they are explicitly present in the provided sources.',
|
||||
'- Do not combine technical identity from one source with commercial fields from a different product.',
|
||||
'- Product number, price, availability, and URL must belong to the same explicitly grounded product.',
|
||||
'- Avoid absolute negative wording such as "ausschließlich", "keines", "nicht geeignet", "gibt es nicht", or portfolio-wide negations unless the provided sources explicitly support that exact scope.',
|
||||
'- Prefer narrow evidence wording, for example "in den vorliegenden Quellen nicht sicher belegt", "in den aktuellen Treffern nicht belegt", or "die gezeigten Treffer belegen keine Eignung".',
|
||||
'- When mentioning options outside the provided sources, do not recommend specific external products, vendors, or purchases. Phrase only the required category neutrally and state that such evidence is not present in the provided sources.',
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -528,6 +519,7 @@ final class PromptBuilderConfig
|
||||
'- For direct follow-up questions about an indicator, value, threshold, or device, answer the resolved mapping first before any table or explanation.',
|
||||
'- If the sources only support a negative finding, output only that negative finding and do not add speculative alternatives.',
|
||||
'- For product-selection answers, keep the answer minimal: suitable product if explicitly supported, exact evidence, current shop fields if same product identity is clear. Do not add sections for Vorteile, Einsatzbereiche, Messprinzip, or Hinweise unless directly asked and explicitly sourced.',
|
||||
'- If no suitable product is grounded, do not pivot to alternative product categories as a recommendation. You may only say neutrally what kind of explicitly designated product or accessory would be needed, and that it is not evidenced in the current sources.',
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -587,6 +579,8 @@ final class PromptBuilderConfig
|
||||
'- For follow-up questions, use the conversation only to resolve what the user refers to; do not copy technical facts from previous assistant answers unless the same fact is present in the current retrieved sources.',
|
||||
'- Never mention external manufacturers, external brands, or external products unless they are explicitly present in the provided sources.',
|
||||
'- If the sources do not identify a suitable product, do not invent one.',
|
||||
'- Do not turn absence of evidence into a broad portfolio statement. Use scoped wording tied to the provided sources and current search results.',
|
||||
'- Strong negative terms such as "ausschließlich", "keines", "nicht geeignet", or "gibt es nicht" require explicit source support for the full stated scope.',
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -602,7 +596,6 @@ final class PromptBuilderConfig
|
||||
'- For product-selection questions, a shop result proves technical suitability only when the same SHOP PRODUCT RECORD explicitly states the requested measurement parameter, application, or compatibility. Search ranking, generated query terms, generic category matches, and similar wording are not proof.',
|
||||
'- If the requested parameter appears only in the generated shop query, metadata, unrelated highlights, or another product record, treat suitability as unverified and say that the shop hit requires technical verification.',
|
||||
'- Do not convert p-Wert, m-Wert, minus m-Wert, alkalinity, acid capacity, or other water-treatment parameters into pH or pH-Wert unless the same source explicitly says pH or pH-Wert.',
|
||||
'- For pH requests, do not treat pH operating ranges, reagent/indicator pH values, output-transfer references, or generic pH mentions as proof that a device measures pH.',
|
||||
'- When shop results are present and relevant, include current price and the actual URL if available.',
|
||||
'- If the shop data does not provide a positive price for a result, do not output any price for that result.',
|
||||
'- Do not let accessories, bundles, or service items override a technically better product match unless the user explicitly asks for them.',
|
||||
@@ -638,7 +631,6 @@ final class PromptBuilderConfig
|
||||
return $this->getStringList('fact_grounding.technical_rules', [
|
||||
'- For technical product questions, answer primarily with explicitly stated facts.',
|
||||
'- For measurement-parameter questions, do not treat similar or neighboring abbreviations as equivalent. In particular, p-Wert is not pH-Wert unless the source explicitly says pH or pH-Wert.',
|
||||
'- For pH requests, do not present products as pH-capable when the source only states an allowable pH operating range, a pH value of a reagent/indicator solution, a 4-20 mA transfer/output reference, or a generic pH mention.',
|
||||
'- Do not invent or infer measurement principles, methods, calibration functions, benefits, advantages, application areas, or alternative products from product family names, search rank, or shop query wording.',
|
||||
'- Behave like a technical documentation assistant, not like a sales advisor.',
|
||||
'- Keep interpretations minimal and do not generalize application areas beyond the provided sources.',
|
||||
@@ -767,41 +759,6 @@ final class PromptBuilderConfig
|
||||
);
|
||||
}
|
||||
|
||||
public function getProductRoleGuardSectionLabel(): string
|
||||
{
|
||||
return $this->getString('sections.product_role_guard_label', 'PRODUCT ROLE GUARD');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getProductRoleGuardMainDeviceRules(): array
|
||||
{
|
||||
return $this->getStringList('role_guard.main_device_answer_rules', [
|
||||
'- If the user asks for a Testomat, measuring device, analyzer, system, or main device, the answer must be anchored on a compatible main-device record or on a clear no-match statement.',
|
||||
'- Accessories, indicators, reagents, calibration solutions, spare parts, kits, sets, services, or consumables must not be used as the main answer heading for a main-device request.',
|
||||
'- If only accessories or consumables are available in the shop results, start with a negative main-device finding and mention that only accessory/consumable hits were found.',
|
||||
'- Do not provide price, availability, product number, URL, or a recommendation for role-incompatible accessory records unless the user explicitly asks for that accessory.',
|
||||
'- Do not propose alternative devices unless a provided source explicitly proves that exact device is suitable for the requested parameter.',
|
||||
]);
|
||||
}
|
||||
|
||||
public function getProductRoleGuardNoMainDeviceTemplate(): string
|
||||
{
|
||||
return $this->getString(
|
||||
'role_guard.no_main_device_match_template',
|
||||
'No compatible main-device shop record is present for the requested main-device role. Accessory/consumable records must not be presented as the requested solution.'
|
||||
);
|
||||
}
|
||||
|
||||
public function getProductRoleGuardIncompatibleRecordNote(): string
|
||||
{
|
||||
return $this->getString(
|
||||
'shop_results.fields.role_incompatible_record_note',
|
||||
'Role guard: this is an accessory/consumable record for a main-device request. Do not use it as an answer heading, recommendation, or suitable main-device result.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
@@ -862,7 +819,6 @@ final class PromptBuilderConfig
|
||||
'- This block is generated from the current user question and is stricter than broad product-selection wording.',
|
||||
'- For measurement-parameter questions, technical suitability requires explicit positive evidence for the requested parameter in the same source record.',
|
||||
'- Similar water-treatment parameters, abbreviations, units, product families, search queries, or ranking positions are not enough.',
|
||||
'- For pH requests, pH operating ranges, pH values of reagents/indicators, pH transfer/output fields, and general pH mentions are not evidence that a device measures pH.',
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -896,10 +852,15 @@ final class PromptBuilderConfig
|
||||
'label' => $label,
|
||||
'request_terms' => $this->normalizeMixedStringList($item['request_terms'] ?? []),
|
||||
'positive_terms' => $this->normalizeMixedStringList($item['positive_terms'] ?? []),
|
||||
'positive_context_terms' => $this->normalizeMixedStringList($item['positive_context_terms'] ?? []),
|
||||
'negative_context_terms' => $this->normalizeMixedStringList($item['negative_context_terms'] ?? []),
|
||||
'non_equivalent_terms' => $this->normalizeMixedStringList($item['non_equivalent_terms'] ?? []),
|
||||
'safe_no_evidence_answer_de' => isset($item['safe_no_evidence_answer_de']) && is_scalar($item['safe_no_evidence_answer_de'])
|
||||
? trim((string) $item['safe_no_evidence_answer_de'])
|
||||
: '',
|
||||
'safe_no_accessory_evidence_answer_de' => isset($item['safe_no_accessory_evidence_answer_de']) && is_scalar($item['safe_no_accessory_evidence_answer_de'])
|
||||
? trim((string) $item['safe_no_accessory_evidence_answer_de'])
|
||||
: '',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user