harden information getter services and optimize user msg
This commit is contained in:
@@ -149,7 +149,7 @@ final class AgentRunnerConfig
|
||||
{
|
||||
return $this->getString(
|
||||
'messages.no_concrete_shop_query',
|
||||
'Ich habe keine konkrete Shop-Suchanfrage erkannt. Bitte nenne das Produkt, Zubehör oder die Artikelnummer.'
|
||||
'Ich kann die Shop-Suche noch nicht belastbar auflösen. Bitte nenne das Produkt, den Messparameter oder das Zubehör etwas konkreter.'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -173,6 +173,83 @@ final class AgentRunnerConfig
|
||||
return $this->getString('messages.no_llm_data_received', '❌ Es wurden keine Daten vom LLM empfangen.');
|
||||
}
|
||||
|
||||
public function getNoLlmFallbackMaxShopResults(): int
|
||||
{
|
||||
return $this->getInt('no_llm_fallback.max_shop_results', 5);
|
||||
}
|
||||
|
||||
public function getNoLlmFallbackShopOnlyMessage(): string
|
||||
{
|
||||
return $this->getString(
|
||||
'no_llm_fallback.messages.shop_only',
|
||||
'Ich finde dazu im RAG-Wissen keine belastbare Fachinformation. Aus den Shopdaten ergeben sich folgende Treffer; technische Eignung bitte prüfen:'
|
||||
);
|
||||
}
|
||||
|
||||
public function getNoLlmFallbackShopWithKnowledgeMessage(): string
|
||||
{
|
||||
return $this->getString(
|
||||
'no_llm_fallback.messages.shop_with_knowledge',
|
||||
'Es liegen RAG-/Kontexttreffer und Shopdaten vor. Ohne LLM leite ich daraus keine technische Eignung ab. Die Shopdaten zeigen folgende Treffer; technische Eignung bitte prüfen:'
|
||||
);
|
||||
}
|
||||
|
||||
public function getNoLlmFallbackEscalationMessage(): string
|
||||
{
|
||||
return $this->getString(
|
||||
'no_llm_fallback.messages.escalation',
|
||||
'Für eine verbindliche Produktauswahl sollte der konkrete Anwendungsfall durch Vertrieb oder Support geprüft werden.'
|
||||
);
|
||||
}
|
||||
|
||||
public function getNoLlmFallbackKnowledgeOnlyMessage(): string
|
||||
{
|
||||
return $this->getString(
|
||||
'no_llm_fallback.messages.knowledge_only',
|
||||
'Ich habe Treffer im RAG-Wissen gefunden, aber ohne LLM kann ich daraus keine belastbare fachliche Antwort synthetisieren. Ich gebe deshalb keine sichere Produktaussage aus. Bitte aktiviere das LLM oder konkretisiere die Frage für eine gezielte Prüfung.'
|
||||
);
|
||||
}
|
||||
|
||||
public function getNoLlmFallbackNoDataMessage(): string
|
||||
{
|
||||
return $this->getString(
|
||||
'no_llm_fallback.messages.no_data',
|
||||
'Ich finde dazu keine belastbaren Daten in den vorliegenden Quellen. Bitte nenne Produkt, Messparameter, Zubehör oder Anwendungsfall genauer.'
|
||||
);
|
||||
}
|
||||
|
||||
public function getNoLlmFallbackNoShopResultsWithKnowledgeMessage(): string
|
||||
{
|
||||
return $this->getString(
|
||||
'no_llm_fallback.messages.no_shop_results_with_knowledge',
|
||||
'Ich finde RAG-/Kontexttreffer, aber keine passenden Shop-Treffer zur aktuellen Suchanfrage. Das ist keine Aussage, dass es das Produkt nicht gibt. Ohne LLM gebe ich keine technische Negativaussage aus; bitte prüfe den Suchbegriff oder den Anwendungsfall gezielter.'
|
||||
);
|
||||
}
|
||||
|
||||
public function getNoLlmFallbackNoShopResultsNoKnowledgeMessage(): string
|
||||
{
|
||||
return $this->getString(
|
||||
'no_llm_fallback.messages.no_shop_results_no_knowledge',
|
||||
'Ich finde weder belastbares RAG-Wissen noch passende Shop-Treffer zur aktuellen Suchanfrage. Das ist keine sichere Negativaussage. Bitte nenne Produkt, Messparameter oder Zubehör konkreter.'
|
||||
);
|
||||
}
|
||||
|
||||
public function getNoLlmFallbackShopUnavailableWithKnowledgeMessage(): string
|
||||
{
|
||||
return $this->getString(
|
||||
'no_llm_fallback.messages.shop_unavailable_with_knowledge',
|
||||
'Live-Shopdaten konnten nicht geladen werden. Ohne Shop-Check treffe ich keine Aussage zu aktueller Verfügbarkeit, Preis oder Shop-Portfolio. Vorhandenes RAG-Wissen darf nur als fachlicher Kontext verstanden werden.'
|
||||
);
|
||||
}
|
||||
|
||||
public function getNoLlmFallbackShopUnavailableNoKnowledgeMessage(): string
|
||||
{
|
||||
return $this->getString(
|
||||
'no_llm_fallback.messages.shop_unavailable_no_knowledge',
|
||||
'Live-Shopdaten konnten nicht geladen werden und ich finde kein belastbares RAG-Wissen. Ich kann daraus keine verlässliche Produkt- oder Verfügbarkeitsaussage ableiten.'
|
||||
);
|
||||
}
|
||||
|
||||
public function getGenericInternalErrorMessage(): string
|
||||
{
|
||||
return $this->getString('messages.generic_internal_error', '❌ Bei der Verarbeitung der Anfrage ist ein interner Fehler aufgetreten.');
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user