mirror of
https://github.com/usestrix/strix.git
synced 2026-09-15 23:31:27 +00:00
remove upload files
This commit is contained in:
parent
d5344ade75
commit
c4c953ed32
2 changed files with 6 additions and 15 deletions
|
|
@ -30,7 +30,6 @@ BrowserUseLocalAction = Literal[
|
|||
"wait",
|
||||
"click",
|
||||
"input",
|
||||
"upload_file",
|
||||
"scroll",
|
||||
"find_text",
|
||||
"send_keys",
|
||||
|
|
@ -178,6 +177,7 @@ async def _run_browser_tool(
|
|||
await session.browser.start()
|
||||
|
||||
llm, _ = _build_llm(metadata=metadata)
|
||||
tools = Tools()
|
||||
|
||||
if session.local:
|
||||
from pathlib import Path
|
||||
|
|
@ -199,8 +199,10 @@ async def _run_browser_tool(
|
|||
return soft_error
|
||||
|
||||
file_system = StubFileSystem()
|
||||
# [security] sandboxed browsers have no local filesystem access
|
||||
tools.exclude_action("upload_file")
|
||||
|
||||
return await Tools().registry.execute_action(
|
||||
return await tools.registry.execute_action(
|
||||
action,
|
||||
params=params,
|
||||
browser_session=session.browser,
|
||||
|
|
|
|||
|
|
@ -32,8 +32,7 @@
|
|||
**Page Interaction:**
|
||||
- click: Click element by index. Requires 'index'.
|
||||
- input: Input text into form fields. Requires 'index' and 'text', optional 'clear'.
|
||||
- upload_file: Upload files. Requires 'index' and 'path'.
|
||||
- scroll: Scroll the page. Optional 'down' (bool), 'pages' (float), 'index'.
|
||||
- scroll: Scroll the page. Optional 'down' (bool), 'pages' (float), 'index'.
|
||||
- find_text: Scroll to specific text. Requires 'text'.
|
||||
- send_keys: Send special keys (Enter, Escape, etc.). Requires 'keys'.
|
||||
|
||||
|
|
@ -79,7 +78,7 @@
|
|||
<description>Seconds to wait for 'wait' action.</description>
|
||||
</parameter>
|
||||
<parameter name="index" type="integer" required="false">
|
||||
<description>Element index from the DOM state. Used by: click, input, upload_file, dropdown_options, select_dropdown, scroll (for scrollable elements).</description>
|
||||
<description>Element index from the DOM state. Used by: click, input, dropdown_options, select_dropdown, scroll (for scrollable elements).</description>
|
||||
</parameter>
|
||||
<parameter name="text" type="string" required="false">
|
||||
<description>Text content. Required for 'input', 'select_dropdown', and 'find_text' actions.</description>
|
||||
|
|
@ -87,9 +86,6 @@
|
|||
<parameter name="clear" type="boolean" required="false">
|
||||
<description>Clear existing text before input. Used by 'input' action. Default: false.</description>
|
||||
</parameter>
|
||||
<parameter name="path" type="string" required="false">
|
||||
<description>File path for 'upload_file' action.</description>
|
||||
</parameter>
|
||||
<parameter name="down" type="boolean" required="false">
|
||||
<description>Scroll direction for 'scroll' action. True=down, False=up. Default: true.</description>
|
||||
</parameter>
|
||||
|
|
@ -232,13 +228,6 @@
|
|||
<parameter=text>admin@example.com</parameter>
|
||||
</function>
|
||||
|
||||
# Upload a file
|
||||
<function=browser_actions>
|
||||
<parameter=action>upload_file</parameter>
|
||||
<parameter=index>7</parameter>
|
||||
<parameter=path>/path/to/file.pdf</parameter>
|
||||
</function>
|
||||
|
||||
# Scroll down
|
||||
<function=browser_actions>
|
||||
<parameter=action>scroll</parameter>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue