add date_format context for input and select action context, which will be used as context for caching (#3951)

This commit is contained in:
Shuchang Zheng
2025-11-09 16:20:12 +08:00
committed by GitHub
parent 0c63b46704
commit 43e6890276
7 changed files with 25 additions and 0 deletions

View File

@@ -431,6 +431,21 @@ def _action_to_stmt(act: dict[str, Any], task: dict[str, Any], assign_to_output:
comma=cst.Comma(),
)
)
action_context = act.get("input_or_select_context")
if action_context and action_context.get("date_format") and method in ["type", "fill", "select_option"]:
date_format_value = action_context.get("date_format")
data = {"date_format": date_format_value}
args.append(
cst.Arg(
keyword=cst.Name("data"),
value=_value(data),
whitespace_after_arg=cst.ParenthesizedWhitespace(
indent=True,
last_line=cst.SimpleWhitespace(INDENT),
),
)
)
intention = act.get("intention") or act.get("reasoning") or ""
if intention and method not in ACTIONS_OPT_OUT_INTENTION_FOR_PROMPT:
args.extend(