This commit is contained in:
team 1
2026-05-06 14:41:37 +02:00
parent ced1431a35
commit e02c885527
5 changed files with 348 additions and 6 deletions

View File

@@ -301,6 +301,21 @@ final class AgentRunnerConfig
throw new \InvalidArgumentException(sprintf('RetrieX agent config key "%s" must be numeric.', $key));
}
private function getOptionalInt(string $key, int $default): int
{
$value = $this->optionalValue($key);
if ($value === null) {
return $default;
}
if (is_numeric($value)) {
return (int) $value;
}
throw new \InvalidArgumentException(sprintf('RetrieX agent config key "%s" must be numeric.', $key));
}
private function getRequiredBool(string $key): bool
{
$value = $this->requiredValue($key);
@@ -1158,6 +1173,24 @@ final class AgentRunnerConfig
return $this->getOptionalStringList('shop_prompt.direct_result_guard.compound_prefix_match.terms');
}
public function isDirectShopResultGuardPrimaryIdentityRepairEnabled(): bool
{
return $this->getOptionalBool('shop_prompt.direct_result_guard.primary_identity_repair.enabled', true);
}
public function getDirectShopResultGuardPrimaryIdentityRepairMinQueryTokens(): int
{
return $this->getOptionalInt('shop_prompt.direct_result_guard.primary_identity_repair.min_query_tokens_after_cleanup', 2);
}
/**
* @return string[]
*/
public function getDirectShopResultGuardPrimaryIdentityRepairStopTerms(): array
{
return $this->getOptionalStringList('shop_prompt.direct_result_guard.primary_identity_repair.stop_terms');
}
public function isShopResultLengthSortEnabled(): bool
{
return $this->getRequiredBool('shop_prompt.length_sort.enabled');