Agentql
AgentQLBrowserToolSpec #
Bases: BaseToolSpec
AgentQL Browser Tool Spec.
Source code in llama-index-integrations/tools/llama-index-tools-agentql/llama_index/tools/agentql/agentql_browser_tool/base.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
|
extract_web_data_from_browser
async
#
extract_web_data_from_browser(query: Optional[str] = None, prompt: Optional[str] = None) -> dict
Extracts structured data as JSON from a web page given a URL using either an AgentQL query or a Natural Language description of the data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
Optional[str]
|
AgentQL query used to extract the data. The query must be enclosed with curly braces |
None
|
prompt
|
Optional[str]
|
Natural Language description of the data to extract from the page. If AgentQL query is not specified, always use the |
None
|
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
The extracted data |
Source code in llama-index-integrations/tools/llama-index-tools-agentql/llama_index/tools/agentql/agentql_browser_tool/base.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
get_web_element_from_browser
async
#
get_web_element_from_browser(prompt: str) -> str
Finds a web element on the active web page in a running browser instance using element’s Natural Language description and returns its CSS selector for further interaction, like clicking, filling a form field, etc.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prompt
|
str
|
Natural Language description of the web element to find on the page. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The CSS selector of the target element. |
Source code in llama-index-integrations/tools/llama-index-tools-agentql/llama_index/tools/agentql/agentql_browser_tool/base.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
|
AgentQLRestAPIToolSpec #
Bases: BaseToolSpec
AgentQL Rest API Tool Spec.
Source code in llama-index-integrations/tools/llama-index-tools-agentql/llama_index/tools/agentql/agentql_rest_api_tool/base.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
|
extract_web_data_with_rest_api
async
#
extract_web_data_with_rest_api(url: str, query: Optional[str] = None, prompt: Optional[str] = None) -> dict
Extracts structured data as a JSON from the active web page in a running browser instance using either an AgentQL query or a Natural Language description of the data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
str
|
URL of the public webpage to extract data from. |
required |
query
|
Optional[str]
|
AgentQL query used to extract the data. The query must be enclosed with curly braces |
None
|
prompt
|
Optional[str]
|
Natural Language description of the data to extract from the page. If AgentQL query is not specified, always use the |
None
|
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
Extracted data. |
Source code in llama-index-integrations/tools/llama-index-tools-agentql/llama_index/tools/agentql/agentql_rest_api_tool/base.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
|