p70+71
This commit is contained in:
@@ -601,7 +601,7 @@ final class AgentRunnerConfig
|
||||
'prompt' => $prompt,
|
||||
];
|
||||
|
||||
foreach (['action_type', 'target_role'] as $optionalKey) {
|
||||
foreach (['action_type', 'target_role', 'hide_when_answer_detail_score_at_least'] as $optionalKey) {
|
||||
if (isset($item[$optionalKey]) && is_scalar($item[$optionalKey])) {
|
||||
$optionalValue = trim((string) $item[$optionalKey]);
|
||||
if ($optionalValue !== '') {
|
||||
@@ -610,6 +610,28 @@ final class AgentRunnerConfig
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists('requires_answer_anchor', $item) && (is_bool($item['requires_answer_anchor']) || is_scalar($item['requires_answer_anchor']))) {
|
||||
$action['requires_answer_anchor'] = $item['requires_answer_anchor'];
|
||||
}
|
||||
|
||||
if (isset($item['hide_when_answer_matches_any']) && is_array($item['hide_when_answer_matches_any'])) {
|
||||
$patterns = [];
|
||||
foreach ($item['hide_when_answer_matches_any'] as $pattern) {
|
||||
if (!is_scalar($pattern)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$pattern = trim((string) $pattern);
|
||||
if ($pattern !== '') {
|
||||
$patterns[] = $pattern;
|
||||
}
|
||||
}
|
||||
|
||||
if ($patterns !== []) {
|
||||
$action['hide_when_answer_matches_any'] = array_values(array_unique($patterns));
|
||||
}
|
||||
}
|
||||
|
||||
$out[] = $action;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user