Firoj112 commited on
Commit
271fccf
·
verified ·
1 Parent(s): 30483de

Update tools/interact_element.py

Browse files
Files changed (1) hide show
  1. tools/interact_element.py +26 -6
tools/interact_element.py CHANGED
@@ -51,15 +51,35 @@ def interact_element(driver, selector=None, text=None, action="click", input_tex
51
  return f"Failed to interact with element {selector or text}: {str(e)}"
52
 
53
  # Register the tool
54
- tool = Tool(
55
  name="interact_element",
56
  description="Interacts with a web element (click, fill text, press keys).",
57
  inputs={
58
- "selector": {"type": "str", "default": None, "description": "CSS selector to target element"},
59
- "text": {"type": "str", "default": None, "description": "Text to locate element"},
60
- "action": {"type": "str", "default": "click", "description": "Action: 'click', 'fill', or 'press'"},
61
- "input_text": {"type": "str", "default": None, "description": "Text to input for fill action"},
62
- "key": {"type": "str", "default": None, "description": "Key to press (e.g., 'ENTER')"}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  },
64
  output_type="str",
65
  function=interact_element
 
51
  return f"Failed to interact with element {selector or text}: {str(e)}"
52
 
53
  # Register the tool
54
+ interact_element_tool = Tool(
55
  name="interact_element",
56
  description="Interacts with a web element (click, fill text, press keys).",
57
  inputs={
58
+ "selector": {
59
+ "type": "str",
60
+ "default": None,
61
+ "description": "CSS selector to target element"
62
+ },
63
+ "text": {
64
+ "type": "str",
65
+ "default": None,
66
+ "description": "Text to locate element"
67
+ },
68
+ "action": {
69
+ "type": "str",
70
+ "default": "click",
71
+ "description": "Action: 'click', 'fill', or 'press'"
72
+ },
73
+ "input_text": {
74
+ "type": "str",
75
+ "default": None,
76
+ "description": "Text to input for fill action"
77
+ },
78
+ "key": {
79
+ "type": "str",
80
+ "default": None,
81
+ "description": "Key to press (e.g., 'ENTER')"
82
+ }
83
  },
84
  output_type="str",
85
  function=interact_element