From 14da524440a39ef1315bc0ff678d85ffa8fa93f0 Mon Sep 17 00:00:00 2001 From: team 1 Date: Thu, 30 Apr 2026 19:46:11 +0200 Subject: [PATCH] patch 9.5 --- config/retriex/prompt.yaml | 2 + src/Config/PromptBuilderConfig.php | 80 ++---------------------------- 2 files changed, 7 insertions(+), 75 deletions(-) diff --git a/config/retriex/prompt.yaml b/config/retriex/prompt.yaml index cbb2963..1c96a57 100644 --- a/config/retriex/prompt.yaml +++ b/config/retriex/prompt.yaml @@ -473,6 +473,8 @@ parameters: 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.' with_shop_rules: - '- Use shop data as highest priority for current commercial fields: price, availability, URL, current shop-visible naming, and explicitly shop-visible product suitability for product-selection questions.' - '- Use retrieved knowledge as highest priority for technical matching, thresholds, measurement principles, and technical explanation when it contains a matching product or fact.' diff --git a/src/Config/PromptBuilderConfig.php b/src/Config/PromptBuilderConfig.php index 0227929..cedb831 100644 --- a/src/Config/PromptBuilderConfig.php +++ b/src/Config/PromptBuilderConfig.php @@ -602,7 +602,7 @@ final class PromptBuilderConfig public function getFactGroundingRulesSectionLabel(): string { - return $this->getString('sections.fact_grounding_rules_label', 'FACT GROUNDING RULES'); + return $this->getRequiredString('sections.fact_grounding_rules_label'); } /** @@ -610,24 +610,7 @@ final class PromptBuilderConfig */ public function getFactGroundingBaseRules(): array { - return $this->getStringList('fact_grounding.base_rules', [ - '- State only facts that are explicitly present in the provided sources.', - '- Extract concrete values exactly when they are present, including units, ranges, model names, indicator names, IP classes, temperatures, pressures, dimensions, counts, relay outputs, current outputs, and error codes.', - '- Do not invent missing values.', - '- Do not replace missing values with estimates, defaults, or typical industry assumptions.', - '- Do not claim that information is missing if it appears in the provided sources.', - '- Do not compare with other products unless those products are also present in the provided sources.', - '- Prefer source-faithful wording over persuasive wording.', - "- Avoid marketing language such as 'ideal', 'perfect', 'unverzichtbar', 'entscheidend', 'optimal', 'kosteneffizient', 'prozesssicher', or 'state-of-the-art'.", - '- Clearly separate explicit facts from inferences.', - "- If a conclusion goes beyond the source wording, label it exactly as 'Inference:'.", - '- If a sentence cannot be traced to the provided sources, do not write it.', - '- 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.', - ]); + return $this->getRequiredStringList('fact_grounding.base_rules'); } /** @@ -635,27 +618,7 @@ final class PromptBuilderConfig */ public function getFactGroundingWithShopRules(): array { - return $this->getStringList('fact_grounding.with_shop_rules', [ - '- Use shop data as highest priority for current commercial fields: price, availability, URL, current shop-visible naming, and explicitly shop-visible product suitability for product-selection questions.', - '- Use retrieved knowledge as highest priority for technical matching, thresholds, measurement principles, and technical explanation when it contains a matching product or fact.', - '- If retrieved knowledge is silent or only contains unrelated products, but live shop results explicitly match the requested parameter/application, use the shop results and do not answer with a negative RAG-only conclusion.', - '- 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.', - '- 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.', - '- Do not call accessories, indicators, reagents, kits, sets, or consumables a device, measuring device, or main product unless the source explicitly says so.', - '- Do not claim that an accessory is required, necessary, used for calibration, or sets the measurement range unless this is explicitly stated in the provided sources.', - '- Do not assign the product number, price, URL, or availability of a reagent, accessory, kit, set, consumable, or service item to a device identified in retrieved knowledge.', - '- Only use commercial fields for the main product when the shop item and the technically identified product clearly refer to the same product identity.', - '- If the shop match is ambiguous, keep the technical identification and commercial details separate.', - '- Shop product names are authoritative for their own shop URL, product number, price, availability, image, description, and metadata.', - '- Do not rewrite a shop record heading with a similar device name from retrieved knowledge. If identities differ or are uncertain, separate the RAG device from the shop hit.', - '- If the user asks for a main device, measuring device, analyzer, system, or measuring installation, do not present an accessory, indicator, reagent, kit, set, consumable, or service item as the requested main solution.', - '- If the only shop hit is role-incompatible with the requested product role, state that no matching main-device shop hit is available in the provided shop data; mention the incompatible hit only as a separate accessory/consumable hit if useful.', - '- Never rename a role-incompatible accessory shop record into a main device in headings, summaries, or shop-hit lines.', - ]); + return $this->getRequiredStringList('fact_grounding.with_shop_rules'); } /** @@ -663,10 +626,7 @@ final class PromptBuilderConfig */ public function getFactGroundingWithoutShopRules(): array { - return $this->getStringList('fact_grounding.without_shop_rules', [ - '- Use retrieved knowledge as authoritative for factual answers.', - '- If no shop results are present, do not compensate with external recommendations or external product suggestions.', - ]); + return $this->getRequiredStringList('fact_grounding.without_shop_rules'); } /** @@ -674,37 +634,7 @@ final class PromptBuilderConfig */ public function getFactGroundingTechnicalRules(): array { - 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.', - '- 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.', - '- Do not describe benefits, consequences, risks, or operational outcomes unless they are explicitly stated in the sources.', - '- Do not translate technical facts into business value unless the source explicitly does so.', - '- Do not recommend process changes unless explicitly present in the source.', - '- Do not use persuasive summaries or advisory conclusions.', - '- If the retrieved knowledge describes one specific named product, stay within that product and do not merge related product families or variants.', - '- Use neutral engineering language.', - '- Do not name specific chemicals, indicator substances, standards, or mechanisms unless explicitly stated in the source.', - '- If the source states signal logic such as green/red, output that signal logic only and do not expand it into operational recommendations or alarm semantics unless explicitly stated.', - '- If the source lists application areas, repeat only those areas and do not broaden them.', - '- If the source names an indicator and threshold, reproduce that exactly without extrapolation.', - '- For lowest, highest, smallest, largest, minimum, maximum, Grenzwert, Messbereich or Aufloesung questions, first identify the exact numeric extreme from the retrieved knowledge and answer that value directly.', - '- For lowest/highest/minimum/maximum questions, answer only the requested extreme unless the user explicitly asks for a comparison or alternatives.', - '- For direct numeric lookup questions such as which device measures a given threshold, answer with the exact matching device/value pair first and avoid advisory caveats.', - '- Do not add the runner-up product, second-lowest value, or adjacent range unless the user asks for it.', - '- Do not add calibration, accuracy, pretreatment, temperature, or application notes unless those exact notes are requested and explicitly present in the retrieved source.', - '- For follow-up questions such as "which indicator measures that value", first resolve the referenced value/device, then use the retrieved source entry that explicitly connects value, device and indicator.', - '- For direct follow-up indicator/value questions, start with the exact mapping in one sentence, for example: Der Wert 0,02 °dH wird beim Testomat 808 mit Indikatortyp 300 gemessen.', - '- Do not output the full indicator table, measurement principle, application areas, or advisory notes unless the user explicitly asks for all indicators, details, a table, or device information.', - '- For numeric extreme questions, do not combine a value, device name, indicator name, range or product variant from different chunks unless the same retrieved entry explicitly connects them.', - '- If several devices or indicators are present, keep each device-indicator-range assignment separate and do not transfer an indicator from one product to another.', - '- If the source states only a threshold function, do not expand it into broader control logic.', - '- If a detail is not explicitly stated in the provided sources, say so plainly.', - '- Prefer short, source-close sentences over explanatory expansion.', - '- If the sources only support that a product family is not suitable, output only that unsuitability and stop there.', - ]); + return $this->getRequiredStringList('fact_grounding.technical_rules'); } public function getRetrievedKnowledgeSectionLabel(): string