fix p52
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user