This commit is contained in:
team 1
2026-05-04 18:46:26 +02:00
parent 90ced0352a
commit ebd71ba748
15 changed files with 739 additions and 182 deletions

View File

@@ -135,6 +135,22 @@ final class AgentRunnerConfig
return $this->getRequiredString('follow_up_context.reference_anchor.hardness_value_pattern');
}
public function getFollowUpContextPreviousUserQuestionTemplate(): string
{
return $this->getRequiredString('follow_up_context.context_labels.previous_user_question_template');
}
public function getFollowUpContextPreviousReferenceAnchorsTemplate(): string
{
return $this->getRequiredString('follow_up_context.context_labels.previous_reference_anchors_template');
}
public function getFollowUpContextCurrentQuestionTemplate(): string
{
return $this->getRequiredString('follow_up_context.context_labels.current_follow_up_question_template');
}
public function isInputNormalizationEnabled(): bool
{
return $this->getRequiredBool('input_normalization.enabled');
@@ -170,6 +186,14 @@ final class AgentRunnerConfig
return $this->getRequiredString('input_normalization.output_prefix_pattern');
}
/**
* @return string[]
*/
public function getInputNormalizationPlaceholderOutputs(): array
{
return $this->getRequiredStringList('input_normalization.placeholder_outputs');
}
/**
* @return string[]
*/
@@ -396,6 +420,45 @@ final class AgentRunnerConfig
return $out;
}
/**
* @return array<int, array{label:string, prompt:string}>
*/
private function getRequiredActionList(string $key): array
{
$value = $this->requiredValue($key);
if (!is_array($value)) {
throw new \InvalidArgumentException(sprintf('RetrieX agent config key "%s" must be a list of action definitions.', $key));
}
$out = [];
foreach ($value as $item) {
if (!is_array($item)) {
continue;
}
$label = isset($item['label']) && is_scalar($item['label']) ? trim((string) $item['label']) : '';
$prompt = isset($item['prompt']) && is_scalar($item['prompt']) ? trim((string) $item['prompt']) : '';
if ($label === '' || $prompt === '') {
continue;
}
$out[] = [
'label' => $label,
'prompt' => $prompt,
];
}
if ($out === []) {
throw new \InvalidArgumentException(sprintf('RetrieX agent config key "%s" must contain at least one valid action definition.', $key));
}
return $out;
}
/**
* @return array<string, string[]>
*/
@@ -637,6 +700,55 @@ final class AgentRunnerConfig
return $this->getRequiredString('no_llm_fallback.messages.no_data');
}
public function getShopRepairCheckMessage(): string
{
return $this->getRequiredString('messages.shop_repair_check');
}
public function getShopQueryOptimizationHeartbeatMessage(): string
{
return $this->getRequiredString('messages.shop_query_optimization_heartbeat');
}
public function getProductionUiStageLabel(string $key): string
{
return $this->getRequiredString('production_ui.stage_labels.' . $key);
}
public function getProductionUiConfidenceLabel(string $key): string
{
return $this->getRequiredString('production_ui.confidence_labels.' . $key);
}
public function getProductionUiText(string $key): string
{
return $this->getRequiredString('production_ui.text.' . $key);
}
public function getProductionUiTemplate(string $key): string
{
return $this->getRequiredString('production_ui.templates.' . $key);
}
public function getProductionUiShopResultsMaxCards(): int
{
return $this->getRequiredInt('production_ui.shop_results.max_cards');
}
/**
* @return array<int, array{label:string, prompt:string}>
*/
public function getProductionUiFollowUpActions(string $group): array
{
return $this->getRequiredActionList('production_ui.follow_up_actions.' . $group);
}
public function getNoLlmProductField(string $key): string
{
return $this->getRequiredString('no_llm_fallback.product_fields.' . $key);
}
public function getNoLlmFallbackNoShopResultsWithKnowledgeMessage(): string
{
return $this->getRequiredString('no_llm_fallback.messages.no_shop_results_with_knowledge');