fix history anchor
This commit is contained in:
@@ -1074,6 +1074,78 @@ final class AgentRunnerConfig
|
||||
{
|
||||
return $this->getRequiredString('shop_prompt.context_anchor_enrichment.template');
|
||||
}
|
||||
public function isShopQueryRagAnchorEnrichmentEnabled(): bool
|
||||
{
|
||||
return $this->getRequiredBool('shop_prompt.rag_anchor_enrichment.enabled');
|
||||
}
|
||||
|
||||
public function getShopQueryRagAnchorEnrichmentMinScore(): int
|
||||
{
|
||||
return $this->getRequiredInt('shop_prompt.rag_anchor_enrichment.min_score');
|
||||
}
|
||||
|
||||
public function getShopQueryRagAnchorEnrichmentMaxQueryTerms(): int
|
||||
{
|
||||
return $this->getRequiredInt('shop_prompt.rag_anchor_enrichment.max_query_terms');
|
||||
}
|
||||
|
||||
public function getShopQueryRagAnchorEnrichmentEarlyChunkBonusMax(): int
|
||||
{
|
||||
return $this->getRequiredInt('shop_prompt.rag_anchor_enrichment.early_chunk_bonus_max');
|
||||
}
|
||||
|
||||
public function getShopQueryRagAnchorEnrichmentExactValueUnitScore(): int
|
||||
{
|
||||
return $this->getRequiredInt('shop_prompt.rag_anchor_enrichment.scores.exact_value_with_unit');
|
||||
}
|
||||
|
||||
public function getShopQueryRagAnchorEnrichmentExactValueScore(): int
|
||||
{
|
||||
return $this->getRequiredInt('shop_prompt.rag_anchor_enrichment.scores.exact_value_only');
|
||||
}
|
||||
|
||||
public function getShopQueryRagAnchorEnrichmentAnchorBonusScore(): int
|
||||
{
|
||||
return $this->getRequiredInt('shop_prompt.rag_anchor_enrichment.scores.anchor_bonus');
|
||||
}
|
||||
|
||||
public function getShopQueryRagAnchorEnrichmentTemplate(): string
|
||||
{
|
||||
return $this->getRequiredString('shop_prompt.rag_anchor_enrichment.template');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getShopQueryRagAnchorEnrichmentNumericFocusPatterns(): array
|
||||
{
|
||||
return $this->getRequiredStringList('shop_prompt.rag_anchor_enrichment.numeric_focus_patterns');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getShopQueryRagAnchorEnrichmentProductTitlePatterns(): array
|
||||
{
|
||||
return $this->getRequiredStringList('shop_prompt.rag_anchor_enrichment.product_title_patterns');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getShopQueryRagAnchorEnrichmentAnchorBonusPatterns(): array
|
||||
{
|
||||
return $this->getRequiredStringList('shop_prompt.rag_anchor_enrichment.anchor_bonus_patterns');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getShopQueryRagAnchorEnrichmentSubjectTerms(): array
|
||||
{
|
||||
return $this->getRequiredStringList('shop_prompt.rag_anchor_enrichment.subject_terms');
|
||||
}
|
||||
|
||||
public function getShopQueryTranslationReplacements(string $language): array
|
||||
{
|
||||
$value = $this->getOptionalStringMap('shop_prompt.language_preservation.translation_replacements.' . $language);
|
||||
|
||||
@@ -98,6 +98,17 @@ final class PromptBuilderConfig
|
||||
return (float) $value;
|
||||
}
|
||||
|
||||
private function getRequiredBool(string $path): bool
|
||||
{
|
||||
$value = $this->getRequiredValue($path);
|
||||
|
||||
if (!is_bool($value)) {
|
||||
throw new \InvalidArgumentException(sprintf('RetrieX prompt config value "%s" must be boolean.', $path));
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
private function getRequiredString(string $path): string
|
||||
{
|
||||
@@ -578,6 +589,37 @@ final class PromptBuilderConfig
|
||||
return $this->getRequiredString('sections.measurement_evidence_label');
|
||||
}
|
||||
|
||||
public function isNumericValueFocusEnabled(): bool
|
||||
{
|
||||
return $this->getRequiredBool('numeric_value_focus.enabled');
|
||||
}
|
||||
|
||||
public function getNumericValueFocusSectionLabel(): string
|
||||
{
|
||||
return $this->getRequiredString('sections.numeric_value_focus_label');
|
||||
}
|
||||
|
||||
public function getNumericValueFocusMaxValues(): int
|
||||
{
|
||||
return $this->getRequiredInt('numeric_value_focus.max_values');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getNumericValueFocusPatterns(): array
|
||||
{
|
||||
return $this->getRequiredStringList('numeric_value_focus.value_patterns');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getNumericValueFocusRules(): array
|
||||
{
|
||||
return $this->getRequiredStringList('numeric_value_focus.rules');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user