From e36c49648b26e6014c2f130d3c4c7e6e1878c782 Mon Sep 17 00:00:00 2001 From: team 1 Date: Thu, 30 Apr 2026 19:12:55 +0200 Subject: [PATCH] patch 9.3 --- src/Config/PromptBuilderConfig.php | 59 ++++-------------------------- 1 file changed, 8 insertions(+), 51 deletions(-) diff --git a/src/Config/PromptBuilderConfig.php b/src/Config/PromptBuilderConfig.php index ec8826b..0227929 100644 --- a/src/Config/PromptBuilderConfig.php +++ b/src/Config/PromptBuilderConfig.php @@ -544,7 +544,7 @@ final class PromptBuilderConfig public function getResponseFormatSectionLabel(): string { - return $this->getString('sections.response_format_label', 'RESPONSE FORMAT RULES'); + return $this->getRequiredString('sections.response_format_label'); } /** @@ -552,20 +552,7 @@ final class PromptBuilderConfig */ public function getResponseFormatBaseRules(): array { - return $this->getStringList('response_format.base_rules', [ - '- Keep normal spacing between all words. Never fuse words together.', - '- Use short, clean paragraphs or short labeled sections.', - '- Do not use persuasive or promotional wording.', - '- Do not repeat the same fact in slightly different wording.', - '- Never mention brands, manufacturers, model names, or product families that do not appear in the provided shop results, retrieved knowledge, URL content, or conversation context.', - '- If no suitable product is explicitly grounded in the provided sources, say that plainly instead of inventing alternatives.', - '- 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.', - ]); + return $this->getRequiredStringList('response_format.base_rules'); } /** @@ -573,18 +560,7 @@ final class PromptBuilderConfig */ public function getResponseFormatWithShopRules(): array { - return $this->getStringList('response_format.with_shop_rules', [ - '- If a product is identified, prefer this structure per product: product name, product number, price, availability, URL, then only the most relevant technical facts.', - '- Keep price, availability, and URL on separate lines when they are present.', - '- Only use shop price, URL, product number, or availability for the main product when the shop result clearly matches that same main product.', - '- If the matching shop item appears to be an accessory, reagent, consumable, set, or kit, keep it separate and do not present its commercial fields as the main device.', - '- If the commercial match is uncertain, say that commercial details for the main product are not clearly available in the provided shop results.', - '- If no price is shown for a shop item, omit the price instead of writing 0,00 €, free, kostenlos, or a guessed price.', - '- For every shop hit shown in the answer, copy the exact shop product name verbatim from the same SHOP PRODUCT RECORD as the item heading.', - '- Never place a shop URL, product number, price, or availability below a different heading taken from retrieved knowledge.', - '- If technical RAG knowledge and shop records cannot be matched with high confidence, use separate sections: Fachliche Einordnung and Shop-Treffer.', - '- For uncertain technical suitability from shop hits, use a short section like "Shop-Treffer (technische Eignung nicht sicher belegt)" and list only exact shop fields. Do not add a technical explanation or recommendation.', - ]); + return $this->getRequiredStringList('response_format.with_shop_rules'); } /** @@ -592,9 +568,7 @@ final class PromptBuilderConfig */ public function getResponseFormatWithoutShopRules(): array { - return $this->getStringList('response_format.without_shop_rules', [ - '- If no shop results are present, do not compensate by inventing external products or external manufacturers.', - ]); + return $this->getRequiredStringList('response_format.without_shop_rules'); } /** @@ -602,14 +576,7 @@ final class PromptBuilderConfig */ public function getResponseFormatTechnicalRules(): array { - return $this->getStringList('response_format.technical_rules', [ - '- Write like technical documentation: precise, neutral, and source-close.', - '- Prefer exact values, ranges, thresholds, compatibility notes, and application areas over general explanation.', - '- 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.', - ]); + return $this->getRequiredStringList('response_format.technical_rules'); } /** @@ -617,17 +584,12 @@ final class PromptBuilderConfig */ public function getResponseFormatAccessoryRules(): array { - return $this->getStringList('response_format.accessory_rules', [ - '- If the user asks for a matching accessory, separate the answer into: main device and matching accessory.', - '- The main device must come first. The accessory must not replace the main device.', - '- Only name an accessory as matching if compatibility is explicitly grounded in the provided sources.', - '- Do not call accessories, indicators, reagents, kits, sets, or consumables a device, measuring device, or main product unless the source explicitly says so.', - ]); + return $this->getRequiredStringList('response_format.accessory_rules'); } public function getLanguageRulesSectionLabel(): string { - return $this->getString('sections.language_rules_label', 'LANGUAGE RULES'); + return $this->getRequiredString('sections.language_rules_label'); } /** @@ -635,12 +597,7 @@ final class PromptBuilderConfig */ public function getLanguageRules(): array { - return $this->getStringList('language.rules', [ - '- Answer only in the same language as the user question.', - '- All headings, labels, notes, and structural elements must be in the same language as the user question.', - '- Do not switch languages unless the user does.', - '- If headings are used, write them in the user\'s language.', - ]); + return $this->getRequiredStringList('language.rules'); } public function getFactGroundingRulesSectionLabel(): string