patch 20c

This commit is contained in:
team 1
2026-05-02 20:08:25 +02:00
parent 0fc34f4bc0
commit 446df191c0
6 changed files with 284 additions and 2 deletions

View File

@@ -55,6 +55,45 @@ final class AgentRunnerConfig
return $this->getRequiredStringList('follow_up_context.explicit_commercial_signal_terms');
}
public function isCommercialTableFollowUpEnabled(): bool
{
return $this->getRequiredBool('follow_up_context.commercial_table_follow_up.enabled');
}
/**
* @return string[]
*/
public function getCommercialTableFollowUpPromptPatterns(): array
{
return $this->getRequiredStringList('follow_up_context.commercial_table_follow_up.prompt_patterns');
}
/**
* @return string[]
*/
public function getCommercialTableFollowUpHistoryAnchorPatterns(): array
{
return $this->getRequiredStringList('follow_up_context.commercial_table_follow_up.history_anchor_patterns');
}
/**
* @return string[]
*/
public function getCommercialTableFollowUpIndicatorMarkerPatterns(): array
{
return $this->getRequiredStringList('follow_up_context.commercial_table_follow_up.indicator_marker_patterns');
}
public function getCommercialTableFollowUpQueryTemplateWithModel(): string
{
return $this->getRequiredString('follow_up_context.commercial_table_follow_up.query_template_with_model');
}
public function getCommercialTableFollowUpQueryTemplateWithoutModel(): string
{
return $this->getRequiredString('follow_up_context.commercial_table_follow_up.query_template_without_model');
}
public function getFollowUpHistoryQuestionPattern(): string
{
return $this->getRequiredString('follow_up_context.history_question_pattern');

View File

@@ -441,6 +441,16 @@ final readonly class RetriexEffectiveConfigProvider
'product_search_knowledge_chunk_limit' => $this->agentRunnerConfig->getProductSearchKnowledgeChunkLimit(),
'advisory_product_search_knowledge_chunk_limit' => $this->agentRunnerConfig->getAdvisoryProductSearchKnowledgeChunkLimit(),
'optimized_shop_query_prefix_pattern' => $this->agentRunnerConfig->getOptimizedShopQueryPrefixPattern(),
'follow_up_context' => [
'commercial_table_follow_up' => [
'enabled' => $this->agentRunnerConfig->isCommercialTableFollowUpEnabled(),
'prompt_patterns' => $this->agentRunnerConfig->getCommercialTableFollowUpPromptPatterns(),
'history_anchor_patterns' => $this->agentRunnerConfig->getCommercialTableFollowUpHistoryAnchorPatterns(),
'indicator_marker_patterns' => $this->agentRunnerConfig->getCommercialTableFollowUpIndicatorMarkerPatterns(),
'query_template_with_model' => $this->agentRunnerConfig->getCommercialTableFollowUpQueryTemplateWithModel(),
'query_template_without_model' => $this->agentRunnerConfig->getCommercialTableFollowUpQueryTemplateWithoutModel(),
],
],
'input_normalization' => [
'enabled' => $this->agentRunnerConfig->isInputNormalizationEnabled(),
'max_input_chars' => $this->agentRunnerConfig->getInputNormalizationMaxInputChars(),
@@ -1044,6 +1054,18 @@ final readonly class RetriexEffectiveConfigProvider
$this->validateStringListMap($agent['source_labels'] ?? [], 'agent.source_labels', $errors, $warnings);
$this->validateStringListMap($agent['html_templates'] ?? [], 'agent.html_templates', $errors, $warnings);
$followUpContext = is_array($agent['follow_up_context'] ?? null) ? $agent['follow_up_context'] : [];
$commercialTableFollowUp = is_array($followUpContext['commercial_table_follow_up'] ?? null) ? $followUpContext['commercial_table_follow_up'] : [];
$this->validateRegexPatternList($commercialTableFollowUp['prompt_patterns'] ?? [], 'agent.follow_up_context.commercial_table_follow_up.prompt_patterns', $errors);
$this->validateRegexPatternList($commercialTableFollowUp['history_anchor_patterns'] ?? [], 'agent.follow_up_context.commercial_table_follow_up.history_anchor_patterns', $errors);
$this->validateRegexPatternList($commercialTableFollowUp['indicator_marker_patterns'] ?? [], 'agent.follow_up_context.commercial_table_follow_up.indicator_marker_patterns', $errors);
if (trim((string) ($commercialTableFollowUp['query_template_with_model'] ?? '')) === '') {
$errors[] = 'agent.follow_up_context.commercial_table_follow_up.query_template_with_model must not be empty.';
}
if (trim((string) ($commercialTableFollowUp['query_template_without_model'] ?? '')) === '') {
$errors[] = 'agent.follow_up_context.commercial_table_follow_up.query_template_without_model must not be empty.';
}
$ragEvidence = is_array($agent['rag_evidence_guard'] ?? null) ? $agent['rag_evidence_guard'] : [];
$this->validateStringList($this->toList($ragEvidence['stop_terms'] ?? []), 'agent.rag_evidence_guard.stop_terms', $errors, $warnings);
$this->validateStringListMap($ragEvidence['synonyms'] ?? [], 'agent.rag_evidence_guard.synonyms', $errors, $warnings);