This commit is contained in:
team 1
2026-05-04 16:33:36 +02:00
parent 33b2b30d99
commit 387506b239
13 changed files with 198 additions and 57 deletions

View File

@@ -260,6 +260,26 @@ final class AgentRunnerConfig
return $this->getRequiredStringList('input_normalization.fuzzy_routing.terms');
}
/**
* @return string[]
*/
public function getInputNormalizationPlaceholderOutputs(): array
{
return $this->getRequiredStringList('input_normalization.placeholder_outputs');
}
/** @return array<string, string> */
public function getCommerceFollowUpActions(): array
{
return $this->getRequiredStringMap('followup_actions.commerce');
}
/** @return array<string, string> */
public function getKnowledgeFollowUpActions(): array
{
return $this->getRequiredStringMap('followup_actions.knowledge');
}
private function getRequiredInt(string $key): int
{
$value = $this->requiredValue($key);
@@ -384,6 +404,39 @@ final class AgentRunnerConfig
return $out;
}
/**
* @return array<string, string>
*/
private function getRequiredStringMap(string $key): array
{
$value = $this->requiredValue($key);
if (!is_array($value)) {
throw new \InvalidArgumentException(sprintf('RetrieX agent config key "%s" must be a string map.', $key));
}
$out = [];
foreach ($value as $mapKey => $mapValue) {
if (!is_scalar($mapKey) || !is_scalar($mapValue)) {
continue;
}
$mapKey = trim((string) $mapKey);
$mapValue = trim((string) $mapValue);
if ($mapKey !== '' && $mapValue !== '') {
$out[$mapKey] = $mapValue;
}
}
if ($out === []) {
throw new \InvalidArgumentException(sprintf('RetrieX agent config key "%s" must contain at least one valid entry.', $key));
}
return $out;
}
/**
* @return array<string, string>
*/