harden information getter services and optimize user msg

This commit is contained in:
team2
2026-04-27 22:21:21 +02:00
parent 316a5b5cc2
commit 79adf8f1df
7 changed files with 506 additions and 25 deletions

View File

@@ -310,6 +310,50 @@ final class PromptBuilderConfig
]);
}
public function getFallbackEscalationSectionLabel(): string
{
return $this->getString('sections.fallback_escalation_label', 'FALLBACK AND ESCALATION RULES');
}
public function getFallbackEscalationStateLineTemplate(): string
{
return $this->getString('fallback_escalation.state_line_template', '- Internal confidence state: {state}.');
}
/**
* @return string[]
*/
public function getFallbackEscalationBaseRules(): array
{
return $this->getStringList('fallback_escalation.base_rules', [
'- 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 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.',
]);
}
/**
* @return string[]
*/
public function getFallbackEscalationStateRules(string $state): array
{
return $this->getStringList('fallback_escalation.states.' . $state, []);
}
/**
* @return string[]
*/
public function getFallbackEscalationWithoutShopCheckRules(): array
{
return $this->getStringList('fallback_escalation.without_shop_check_rules', [
'- If the question is product-related and no live shop check was performed in this run, do not make a portfolio-wide negative statement such as "there is no product".',
'- Phrase missing evidence narrowly, for example: "Im RAG-Wissen finde ich dazu keine belastbare Information."',
'- If useful, say that a shop search can be used to look for matching products, but do not claim shop results were checked unless they are present in the prompt.',
]);
}
public function getResponseFormatSectionLabel(): string
{
return $this->getString('sections.response_format_label', 'RESPONSE FORMAT RULES');