ai_adapt_value -> ai_infer (#3359)
This commit is contained in:
@@ -271,7 +271,7 @@ def _action_to_stmt(act: dict[str, Any], assign_to_output: bool = False) -> cst.
|
|||||||
)
|
)
|
||||||
args.append(
|
args.append(
|
||||||
cst.Arg(
|
cst.Arg(
|
||||||
keyword=cst.Name("ai_adapt_value"),
|
keyword=cst.Name("ai_infer"),
|
||||||
value=cst.Name("True"),
|
value=cst.Name("True"),
|
||||||
whitespace_after_arg=cst.ParenthesizedWhitespace(
|
whitespace_after_arg=cst.ParenthesizedWhitespace(
|
||||||
indent=True,
|
indent=True,
|
||||||
|
|||||||
@@ -339,30 +339,30 @@ class SkyvernPage:
|
|||||||
self,
|
self,
|
||||||
xpath: str,
|
xpath: str,
|
||||||
value: str,
|
value: str,
|
||||||
ai_adapt_value: bool = False,
|
ai_infer: bool = False,
|
||||||
intention: str | None = None,
|
intention: str | None = None,
|
||||||
data: str | dict[str, Any] | None = None,
|
data: str | dict[str, Any] | None = None,
|
||||||
timeout: float = settings.BROWSER_ACTION_TIMEOUT_MS,
|
timeout: float = settings.BROWSER_ACTION_TIMEOUT_MS,
|
||||||
) -> None:
|
) -> None:
|
||||||
await self._input_text(xpath, value, ai_adapt_value, intention, data, timeout)
|
await self._input_text(xpath, value, ai_infer, intention, data, timeout)
|
||||||
|
|
||||||
@action_wrap(ActionType.INPUT_TEXT)
|
@action_wrap(ActionType.INPUT_TEXT)
|
||||||
async def type(
|
async def type(
|
||||||
self,
|
self,
|
||||||
xpath: str,
|
xpath: str,
|
||||||
value: str,
|
value: str,
|
||||||
ai_adapt_value: bool = False,
|
ai_infer: bool = False,
|
||||||
intention: str | None = None,
|
intention: str | None = None,
|
||||||
data: str | dict[str, Any] | None = None,
|
data: str | dict[str, Any] | None = None,
|
||||||
timeout: float = settings.BROWSER_ACTION_TIMEOUT_MS,
|
timeout: float = settings.BROWSER_ACTION_TIMEOUT_MS,
|
||||||
) -> None:
|
) -> None:
|
||||||
await self._input_text(xpath, value, ai_adapt_value, intention, data, timeout)
|
await self._input_text(xpath, value, ai_infer, intention, data, timeout)
|
||||||
|
|
||||||
async def _input_text(
|
async def _input_text(
|
||||||
self,
|
self,
|
||||||
xpath: str,
|
xpath: str,
|
||||||
value: str,
|
value: str,
|
||||||
ai_adapt_value: bool = False,
|
ai_infer: bool = False,
|
||||||
intention: str | None = None,
|
intention: str | None = None,
|
||||||
data: str | dict[str, Any] | None = None,
|
data: str | dict[str, Any] | None = None,
|
||||||
timeout: float = settings.BROWSER_ACTION_TIMEOUT_MS,
|
timeout: float = settings.BROWSER_ACTION_TIMEOUT_MS,
|
||||||
@@ -383,7 +383,7 @@ class SkyvernPage:
|
|||||||
if context and context.workflow_run_id:
|
if context and context.workflow_run_id:
|
||||||
value = await _get_actual_value_of_parameter_if_secret(context.workflow_run_id, value)
|
value = await _get_actual_value_of_parameter_if_secret(context.workflow_run_id, value)
|
||||||
|
|
||||||
if ai_adapt_value and intention:
|
if ai_infer and intention:
|
||||||
try:
|
try:
|
||||||
prompt = context.prompt if context else None
|
prompt = context.prompt if context else None
|
||||||
# Build the element tree of the current page for the prompt
|
# Build the element tree of the current page for the prompt
|
||||||
|
|||||||
Reference in New Issue
Block a user