Add prompt route simulation checks
This commit is contained in:
+22
-1
@@ -50,6 +50,27 @@ def empty_action_position_route() -> dict[str, Any]:
|
||||
return empty_action_position_route_result().as_dict()
|
||||
|
||||
|
||||
def _primary_position_key(
|
||||
position_keys: list[str],
|
||||
metadata: dict[str, Any],
|
||||
hardcore_position_config: dict[str, Any] | None,
|
||||
) -> str:
|
||||
if not position_keys:
|
||||
return ""
|
||||
configured = []
|
||||
if isinstance(hardcore_position_config, dict):
|
||||
configured = hardcore_position_policy.normalize_hardcore_position_values(
|
||||
hardcore_position_config.get("positions")
|
||||
)
|
||||
for key in configured:
|
||||
if key in position_keys:
|
||||
return key
|
||||
for key in template_policy.template_position_keys(metadata):
|
||||
if key in position_keys:
|
||||
return key
|
||||
return position_keys[0]
|
||||
|
||||
|
||||
def resolve_action_position_route_result(
|
||||
*,
|
||||
is_pose_category: bool,
|
||||
@@ -97,7 +118,7 @@ def resolve_action_position_route_result(
|
||||
return ActionPositionRoute(
|
||||
position_family=position_family,
|
||||
position_keys=position_keys,
|
||||
position_key=position_keys[0] if position_keys else "",
|
||||
position_key=_primary_position_key(position_keys, metadata, hardcore_position_config),
|
||||
action_family=action_family,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user