Navigation Engine¶
Installation and set-up¶
!pip install lavague
import os
# Check if running in Google Colab
try:
from google.colab import userdata
IN_COLAB = True
except ImportError:
IN_COLAB = False
if IN_COLAB:
os.environ["OPENAI_API_KEY"] = userdata.get('OPENAI_API_KEY')
else:
os.environ["OPENAI_API_KEY"] = os.getenv('OPENAI_API_KEY')
Collecting lavague
Downloading lavague-1.1.0-py3-none-any.whl (8.2 kB)
Collecting lavague-contexts-openai<0.3.0,>=0.2.0 (from lavague)
Downloading lavague_contexts_openai-0.2.0-py3-none-any.whl (2.4 kB)
Collecting lavague-core<0.3.0,>=0.2.0 (from lavague)
Downloading lavague_core-0.2.7-py3-none-any.whl (32 kB)
Collecting lavague-drivers-selenium<0.3.0,>=0.2.0 (from lavague)
Downloading lavague_drivers_selenium-0.2.1-py3-none-any.whl (6.5 kB)
Collecting llama-index-embeddings-openai<0.2.0,>=0.1.9 (from lavague-contexts-openai<0.3.0,>=0.2.0->lavague)
Downloading llama_index_embeddings_openai-0.1.10-py3-none-any.whl (6.2 kB)
Collecting llama-index-llms-azure-openai<0.2.0,>=0.1.8 (from lavague-contexts-openai<0.3.0,>=0.2.0->lavague)
Downloading llama_index_llms_azure_openai-0.1.8-py3-none-any.whl (4.9 kB)
Collecting llama-index-llms-openai<0.2.0,>=0.1.9 (from lavague-contexts-openai<0.3.0,>=0.2.0->lavague)
Downloading llama_index_llms_openai-0.1.22-py3-none-any.whl (11 kB)
Collecting llama-index-multi-modal-llms-azure-openai<0.2.0,>=0.1.4 (from lavague-contexts-openai<0.3.0,>=0.2.0->lavague)
Downloading llama_index_multi_modal_llms_azure_openai-0.1.4-py3-none-any.whl (3.7 kB)
Collecting llama-index-multi-modal-llms-openai<0.2.0,>=0.1.6 (from lavague-contexts-openai<0.3.0,>=0.2.0->lavague)
Downloading llama_index_multi_modal_llms_openai-0.1.6-py3-none-any.whl (5.8 kB)
Requirement already satisfied: ipython<8.0.0,>=7.34.0 in /usr/local/lib/python3.10/dist-packages (from lavague-core<0.3.0,>=0.2.0->lavague) (7.34.0)
Collecting langchain<0.2.0,>=0.1.20 (from lavague-core<0.3.0,>=0.2.0->lavague)
Downloading langchain-0.1.20-py3-none-any.whl (1.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 12.7 MB/s eta 0:00:00
Collecting llama-index<0.11.0,>=0.10.19 (from lavague-core<0.3.0,>=0.2.0->lavague)
Downloading llama_index-0.10.43-py3-none-any.whl (6.8 kB)
Collecting llama-index-retrievers-bm25<0.2.0,>=0.1.3 (from lavague-core<0.3.0,>=0.2.0->lavague)
Downloading llama_index_retrievers_bm25-0.1.3-py3-none-any.whl (2.9 kB)
Collecting lxml<6.0.0,>=5.1.1 (from lavague-core<0.3.0,>=0.2.0->lavague)
Downloading lxml-5.2.2-cp310-cp310-manylinux_2_28_x86_64.whl (5.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.0/5.0 MB 49.6 MB/s eta 0:00:00
Collecting lxml-html-clean<0.2.0,>=0.1.1 (from lavague-core<0.3.0,>=0.2.0->lavague)
Downloading lxml_html_clean-0.1.1-py3-none-any.whl (11 kB)
Requirement already satisfied: msgpack<2.0.0,>=1.0.8 in /usr/local/lib/python3.10/dist-packages (from lavague-core<0.3.0,>=0.2.0->lavague) (1.0.8)
Collecting trafilatura<2.0.0,>=1.9.0 (from lavague-core<0.3.0,>=0.2.0->lavague)
Downloading trafilatura-1.10.0-py3-none-any.whl (1.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 58.9 MB/s eta 0:00:00
Collecting selenium<5.0.0,>=4.18.1 (from lavague-drivers-selenium<0.3.0,>=0.2.0->lavague)
Downloading selenium-4.21.0-py3-none-any.whl (9.5 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.5/9.5 MB 62.4 MB/s eta 0:00:00
Requirement already satisfied: setuptools>=18.5 in /usr/local/lib/python3.10/dist-packages (from ipython<8.0.0,>=7.34.0->lavague-core<0.3.0,>=0.2.0->lavague) (67.7.2)
Collecting jedi>=0.16 (from ipython<8.0.0,>=7.34.0->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading jedi-0.19.1-py2.py3-none-any.whl (1.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 58.6 MB/s eta 0:00:00
Requirement already satisfied: decorator in /usr/local/lib/python3.10/dist-packages (from ipython<8.0.0,>=7.34.0->lavague-core<0.3.0,>=0.2.0->lavague) (4.4.2)
Requirement already satisfied: pickleshare in /usr/local/lib/python3.10/dist-packages (from ipython<8.0.0,>=7.34.0->lavague-core<0.3.0,>=0.2.0->lavague) (0.7.5)
Requirement already satisfied: traitlets>=4.2 in /usr/local/lib/python3.10/dist-packages (from ipython<8.0.0,>=7.34.0->lavague-core<0.3.0,>=0.2.0->lavague) (5.7.1)
Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from ipython<8.0.0,>=7.34.0->lavague-core<0.3.0,>=0.2.0->lavague) (3.0.45)
Requirement already satisfied: pygments in /usr/local/lib/python3.10/dist-packages (from ipython<8.0.0,>=7.34.0->lavague-core<0.3.0,>=0.2.0->lavague) (2.16.1)
Requirement already satisfied: backcall in /usr/local/lib/python3.10/dist-packages (from ipython<8.0.0,>=7.34.0->lavague-core<0.3.0,>=0.2.0->lavague) (0.2.0)
Requirement already satisfied: matplotlib-inline in /usr/local/lib/python3.10/dist-packages (from ipython<8.0.0,>=7.34.0->lavague-core<0.3.0,>=0.2.0->lavague) (0.1.7)
Requirement already satisfied: pexpect>4.3 in /usr/local/lib/python3.10/dist-packages (from ipython<8.0.0,>=7.34.0->lavague-core<0.3.0,>=0.2.0->lavague) (4.9.0)
Requirement already satisfied: PyYAML>=5.3 in /usr/local/lib/python3.10/dist-packages (from langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague) (6.0.1)
Requirement already satisfied: SQLAlchemy<3,>=1.4 in /usr/local/lib/python3.10/dist-packages (from langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague) (2.0.30)
Requirement already satisfied: aiohttp<4.0.0,>=3.8.3 in /usr/local/lib/python3.10/dist-packages (from langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague) (3.9.5)
Requirement already satisfied: async-timeout<5.0.0,>=4.0.0 in /usr/local/lib/python3.10/dist-packages (from langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague) (4.0.3)
Collecting dataclasses-json<0.7,>=0.5.7 (from langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading dataclasses_json-0.6.6-py3-none-any.whl (28 kB)
Collecting langchain-community<0.1,>=0.0.38 (from langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading langchain_community-0.0.38-py3-none-any.whl (2.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 53.2 MB/s eta 0:00:00
Collecting langchain-core<0.2.0,>=0.1.52 (from langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading langchain_core-0.1.52-py3-none-any.whl (302 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 302.9/302.9 kB 18.1 MB/s eta 0:00:00
Collecting langchain-text-splitters<0.1,>=0.0.1 (from langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading langchain_text_splitters-0.0.2-py3-none-any.whl (23 kB)
Collecting langsmith<0.2.0,>=0.1.17 (from langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading langsmith-0.1.72-py3-none-any.whl (124 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 124.7/124.7 kB 10.1 MB/s eta 0:00:00
Requirement already satisfied: numpy<2,>=1 in /usr/local/lib/python3.10/dist-packages (from langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague) (1.25.2)
Requirement already satisfied: pydantic<3,>=1 in /usr/local/lib/python3.10/dist-packages (from langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague) (2.7.3)
Requirement already satisfied: requests<3,>=2 in /usr/local/lib/python3.10/dist-packages (from langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague) (2.31.0)
Requirement already satisfied: tenacity<9.0.0,>=8.1.0 in /usr/local/lib/python3.10/dist-packages (from langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague) (8.3.0)
Collecting llama-index-agent-openai<0.3.0,>=0.1.4 (from llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading llama_index_agent_openai-0.2.7-py3-none-any.whl (12 kB)
Collecting llama-index-cli<0.2.0,>=0.1.2 (from llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading llama_index_cli-0.1.12-py3-none-any.whl (26 kB)
Collecting llama-index-core==0.10.43 (from llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading llama_index_core-0.10.43-py3-none-any.whl (15.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 15.4/15.4 MB 15.1 MB/s eta 0:00:00
Collecting llama-index-indices-managed-llama-cloud<0.2.0,>=0.1.2 (from llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading llama_index_indices_managed_llama_cloud-0.1.6-py3-none-any.whl (6.7 kB)
Collecting llama-index-legacy<0.10.0,>=0.9.48 (from llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading llama_index_legacy-0.9.48-py3-none-any.whl (2.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 23.7 MB/s eta 0:00:00
Collecting llama-index-program-openai<0.2.0,>=0.1.3 (from llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading llama_index_program_openai-0.1.6-py3-none-any.whl (5.2 kB)
Collecting llama-index-question-gen-openai<0.2.0,>=0.1.2 (from llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading llama_index_question_gen_openai-0.1.3-py3-none-any.whl (2.9 kB)
Collecting llama-index-readers-file<0.2.0,>=0.1.4 (from llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading llama_index_readers_file-0.1.23-py3-none-any.whl (36 kB)
Collecting llama-index-readers-llama-parse<0.2.0,>=0.1.2 (from llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading llama_index_readers_llama_parse-0.1.4-py3-none-any.whl (2.5 kB)
Collecting deprecated>=1.2.9.3 (from llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading Deprecated-1.2.14-py2.py3-none-any.whl (9.6 kB)
Collecting dirtyjson<2.0.0,>=1.0.8 (from llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading dirtyjson-1.0.8-py3-none-any.whl (25 kB)
Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague) (2023.6.0)
Collecting httpx (from llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading httpx-0.27.0-py3-none-any.whl (75 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 75.6/75.6 kB 5.9 MB/s eta 0:00:00
Collecting llamaindex-py-client<0.2.0,>=0.1.18 (from llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading llamaindex_py_client-0.1.19-py3-none-any.whl (141 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 141.9/141.9 kB 11.8 MB/s eta 0:00:00
Requirement already satisfied: nest-asyncio<2.0.0,>=1.5.8 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague) (1.6.0)
Requirement already satisfied: networkx>=3.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague) (3.3)
Requirement already satisfied: nltk<4.0.0,>=3.8.1 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague) (3.8.1)
Collecting openai>=1.1.0 (from llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading openai-1.31.1-py3-none-any.whl (324 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 324.1/324.1 kB 15.2 MB/s eta 0:00:00
Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague) (2.0.3)
Requirement already satisfied: pillow>=9.0.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague) (9.4.0)
Collecting tiktoken>=0.3.3 (from llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading tiktoken-0.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 7.2 MB/s eta 0:00:00
Requirement already satisfied: tqdm<5.0.0,>=4.66.1 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague) (4.66.4)
Requirement already satisfied: typing-extensions>=4.5.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague) (4.12.1)
Collecting typing-inspect>=0.8.0 (from llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading typing_inspect-0.9.0-py3-none-any.whl (8.8 kB)
Requirement already satisfied: wrapt in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague) (1.14.1)
Collecting azure-identity<2.0.0,>=1.15.0 (from llama-index-llms-azure-openai<0.2.0,>=0.1.8->lavague-contexts-openai<0.3.0,>=0.2.0->lavague)
Downloading azure_identity-1.16.0-py3-none-any.whl (166 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 166.1/166.1 kB 11.8 MB/s eta 0:00:00
Collecting rank-bm25<0.3.0,>=0.2.2 (from llama-index-retrievers-bm25<0.2.0,>=0.1.3->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading rank_bm25-0.2.2-py3-none-any.whl (8.6 kB)
Requirement already satisfied: urllib3[socks]<3,>=1.26 in /usr/local/lib/python3.10/dist-packages (from selenium<5.0.0,>=4.18.1->lavague-drivers-selenium<0.3.0,>=0.2.0->lavague) (2.0.7)
Collecting trio~=0.17 (from selenium<5.0.0,>=4.18.1->lavague-drivers-selenium<0.3.0,>=0.2.0->lavague)
Downloading trio-0.25.1-py3-none-any.whl (467 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 467.7/467.7 kB 26.9 MB/s eta 0:00:00
Collecting trio-websocket~=0.9 (from selenium<5.0.0,>=4.18.1->lavague-drivers-selenium<0.3.0,>=0.2.0->lavague)
Downloading trio_websocket-0.11.1-py3-none-any.whl (17 kB)
Requirement already satisfied: certifi>=2021.10.8 in /usr/local/lib/python3.10/dist-packages (from selenium<5.0.0,>=4.18.1->lavague-drivers-selenium<0.3.0,>=0.2.0->lavague) (2024.6.2)
Collecting courlan>=1.1.0 (from trafilatura<2.0.0,>=1.9.0->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading courlan-1.2.0-py3-none-any.whl (33 kB)
Collecting htmldate>=1.8.1 (from trafilatura<2.0.0,>=1.9.0->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading htmldate-1.8.1-py3-none-any.whl (31 kB)
Collecting justext>=3.0.1 (from trafilatura<2.0.0,>=1.9.0->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading jusText-3.0.1-py2.py3-none-any.whl (837 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 837.8/837.8 kB 43.3 MB/s eta 0:00:00
Requirement already satisfied: charset-normalizer>=3.2.0 in /usr/local/lib/python3.10/dist-packages (from trafilatura<2.0.0,>=1.9.0->lavague-core<0.3.0,>=0.2.0->lavague) (3.3.2)
Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague) (1.3.1)
Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague) (23.2.0)
Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague) (1.4.1)
Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague) (6.0.5)
Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague) (1.9.4)
Collecting azure-core>=1.23.0 (from azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai<0.2.0,>=0.1.8->lavague-contexts-openai<0.3.0,>=0.2.0->lavague)
Downloading azure_core-1.30.1-py3-none-any.whl (193 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 193.4/193.4 kB 10.2 MB/s eta 0:00:00
Requirement already satisfied: cryptography>=2.5 in /usr/local/lib/python3.10/dist-packages (from azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai<0.2.0,>=0.1.8->lavague-contexts-openai<0.3.0,>=0.2.0->lavague) (42.0.7)
Collecting msal>=1.24.0 (from azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai<0.2.0,>=0.1.8->lavague-contexts-openai<0.3.0,>=0.2.0->lavague)
Downloading msal-1.28.0-py3-none-any.whl (102 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 102.2/102.2 kB 5.1 MB/s eta 0:00:00
Collecting msal-extensions>=0.3.0 (from azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai<0.2.0,>=0.1.8->lavague-contexts-openai<0.3.0,>=0.2.0->lavague)
Downloading msal_extensions-1.1.0-py3-none-any.whl (19 kB)
Requirement already satisfied: babel>=2.11.0 in /usr/local/lib/python3.10/dist-packages (from courlan>=1.1.0->trafilatura<2.0.0,>=1.9.0->lavague-core<0.3.0,>=0.2.0->lavague) (2.15.0)
Collecting tld>=0.13 (from courlan>=1.1.0->trafilatura<2.0.0,>=1.9.0->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading tld-0.13-py2.py3-none-any.whl (263 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 263.8/263.8 kB 6.9 MB/s eta 0:00:00
Collecting marshmallow<4.0.0,>=3.18.0 (from dataclasses-json<0.7,>=0.5.7->langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading marshmallow-3.21.2-py3-none-any.whl (49 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 49.3/49.3 kB 6.1 MB/s eta 0:00:00
Collecting dateparser>=1.1.2 (from htmldate>=1.8.1->trafilatura<2.0.0,>=1.9.0->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading dateparser-1.2.0-py2.py3-none-any.whl (294 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 295.0/295.0 kB 38.6 MB/s eta 0:00:00
Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.10/dist-packages (from htmldate>=1.8.1->trafilatura<2.0.0,>=1.9.0->lavague-core<0.3.0,>=0.2.0->lavague) (2.8.2)
Requirement already satisfied: parso<0.9.0,>=0.8.3 in /usr/local/lib/python3.10/dist-packages (from jedi>=0.16->ipython<8.0.0,>=7.34.0->lavague-core<0.3.0,>=0.2.0->lavague) (0.8.4)
Requirement already satisfied: lxml[html_clean]>=4.4.2 in /usr/local/lib/python3.10/dist-packages (from justext>=3.0.1->trafilatura<2.0.0,>=1.9.0->lavague-core<0.3.0,>=0.2.0->lavague) (4.9.4)
Collecting jsonpatch<2.0,>=1.33 (from langchain-core<0.2.0,>=0.1.52->langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading jsonpatch-1.33-py2.py3-none-any.whl (12 kB)
Collecting packaging<24.0,>=23.2 (from langchain-core<0.2.0,>=0.1.52->langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading packaging-23.2-py3-none-any.whl (53 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 53.0/53.0 kB 8.7 MB/s eta 0:00:00
Collecting orjson<4.0.0,>=3.9.14 (from langsmith<0.2.0,>=0.1.17->langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading orjson-3.10.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 142.5/142.5 kB 21.2 MB/s eta 0:00:00
Requirement already satisfied: beautifulsoup4<5.0.0,>=4.12.3 in /usr/local/lib/python3.10/dist-packages (from llama-index-readers-file<0.2.0,>=0.1.4->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague) (4.12.3)
Collecting pypdf<5.0.0,>=4.0.1 (from llama-index-readers-file<0.2.0,>=0.1.4->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading pypdf-4.2.0-py3-none-any.whl (290 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 290.4/290.4 kB 37.2 MB/s eta 0:00:00
Collecting striprtf<0.0.27,>=0.0.26 (from llama-index-readers-file<0.2.0,>=0.1.4->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading striprtf-0.0.26-py3-none-any.whl (6.9 kB)
Collecting llama-parse<0.5.0,>=0.4.0 (from llama-index-readers-llama-parse<0.2.0,>=0.1.2->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading llama_parse-0.4.4-py3-none-any.whl (8.0 kB)
Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.10/dist-packages (from pexpect>4.3->ipython<8.0.0,>=7.34.0->lavague-core<0.3.0,>=0.2.0->lavague) (0.7.0)
Requirement already satisfied: wcwidth in /usr/local/lib/python3.10/dist-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython<8.0.0,>=7.34.0->lavague-core<0.3.0,>=0.2.0->lavague) (0.2.13)
Requirement already satisfied: annotated-types>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from pydantic<3,>=1->langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague) (0.7.0)
Requirement already satisfied: pydantic-core==2.18.4 in /usr/local/lib/python3.10/dist-packages (from pydantic<3,>=1->langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague) (2.18.4)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2->langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague) (3.7)
Requirement already satisfied: greenlet!=0.4.17 in /usr/local/lib/python3.10/dist-packages (from SQLAlchemy<3,>=1.4->langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague) (3.0.3)
Requirement already satisfied: sortedcontainers in /usr/local/lib/python3.10/dist-packages (from trio~=0.17->selenium<5.0.0,>=4.18.1->lavague-drivers-selenium<0.3.0,>=0.2.0->lavague) (2.4.0)
Collecting outcome (from trio~=0.17->selenium<5.0.0,>=4.18.1->lavague-drivers-selenium<0.3.0,>=0.2.0->lavague)
Downloading outcome-1.3.0.post0-py2.py3-none-any.whl (10 kB)
Requirement already satisfied: sniffio>=1.3.0 in /usr/local/lib/python3.10/dist-packages (from trio~=0.17->selenium<5.0.0,>=4.18.1->lavague-drivers-selenium<0.3.0,>=0.2.0->lavague) (1.3.1)
Requirement already satisfied: exceptiongroup in /usr/local/lib/python3.10/dist-packages (from trio~=0.17->selenium<5.0.0,>=4.18.1->lavague-drivers-selenium<0.3.0,>=0.2.0->lavague) (1.2.1)
Collecting wsproto>=0.14 (from trio-websocket~=0.9->selenium<5.0.0,>=4.18.1->lavague-drivers-selenium<0.3.0,>=0.2.0->lavague)
Downloading wsproto-1.2.0-py3-none-any.whl (24 kB)
Requirement already satisfied: pysocks!=1.5.7,<2.0,>=1.5.6 in /usr/local/lib/python3.10/dist-packages (from urllib3[socks]<3,>=1.26->selenium<5.0.0,>=4.18.1->lavague-drivers-selenium<0.3.0,>=0.2.0->lavague) (1.7.1)
Requirement already satisfied: anyio in /usr/local/lib/python3.10/dist-packages (from httpx->llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague) (3.7.1)
Collecting httpcore==1.* (from httpx->llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading httpcore-1.0.5-py3-none-any.whl (77 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.9/77.9 kB 13.1 MB/s eta 0:00:00
Collecting h11<0.15,>=0.13 (from httpcore==1.*->httpx->llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading h11-0.14.0-py3-none-any.whl (58 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.3/58.3 kB 9.6 MB/s eta 0:00:00
Requirement already satisfied: six>=1.11.0 in /usr/local/lib/python3.10/dist-packages (from azure-core>=1.23.0->azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai<0.2.0,>=0.1.8->lavague-contexts-openai<0.3.0,>=0.2.0->lavague) (1.16.0)
Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.10/dist-packages (from beautifulsoup4<5.0.0,>=4.12.3->llama-index-readers-file<0.2.0,>=0.1.4->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague) (2.5)
Requirement already satisfied: cffi>=1.12 in /usr/local/lib/python3.10/dist-packages (from cryptography>=2.5->azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai<0.2.0,>=0.1.8->lavague-contexts-openai<0.3.0,>=0.2.0->lavague) (1.16.0)
Requirement already satisfied: pytz in /usr/local/lib/python3.10/dist-packages (from dateparser>=1.1.2->htmldate>=1.8.1->trafilatura<2.0.0,>=1.9.0->lavague-core<0.3.0,>=0.2.0->lavague) (2023.4)
Requirement already satisfied: regex!=2019.02.19,!=2021.8.27 in /usr/local/lib/python3.10/dist-packages (from dateparser>=1.1.2->htmldate>=1.8.1->trafilatura<2.0.0,>=1.9.0->lavague-core<0.3.0,>=0.2.0->lavague) (2024.5.15)
Requirement already satisfied: tzlocal in /usr/local/lib/python3.10/dist-packages (from dateparser>=1.1.2->htmldate>=1.8.1->trafilatura<2.0.0,>=1.9.0->lavague-core<0.3.0,>=0.2.0->lavague) (5.2)
Collecting jsonpointer>=1.9 (from jsonpatch<2.0,>=1.33->langchain-core<0.2.0,>=0.1.52->langchain<0.2.0,>=0.1.20->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading jsonpointer-2.4-py2.py3-none-any.whl (7.8 kB)
WARNING: lxml 4.9.4 does not provide the extra 'html_clean'
INFO: pip is looking at multiple versions of lxml[html-clean] to determine which version is compatible with other requirements. This could take a while.
Requirement already satisfied: PyJWT[crypto]<3,>=1.0.0 in /usr/lib/python3/dist-packages (from msal>=1.24.0->azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai<0.2.0,>=0.1.8->lavague-contexts-openai<0.3.0,>=0.2.0->lavague) (2.3.0)
Collecting portalocker<3,>=1.0 (from msal-extensions>=0.3.0->azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai<0.2.0,>=0.1.8->lavague-contexts-openai<0.3.0,>=0.2.0->lavague)
Downloading portalocker-2.8.2-py3-none-any.whl (17 kB)
Requirement already satisfied: click in /usr/local/lib/python3.10/dist-packages (from nltk<4.0.0,>=3.8.1->llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague) (8.1.7)
Requirement already satisfied: joblib in /usr/local/lib/python3.10/dist-packages (from nltk<4.0.0,>=3.8.1->llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague) (1.4.2)
Requirement already satisfied: distro<2,>=1.7.0 in /usr/lib/python3/dist-packages (from openai>=1.1.0->llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague) (1.7.0)
Collecting mypy-extensions>=0.3.0 (from typing-inspect>=0.8.0->llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague)
Downloading mypy_extensions-1.0.0-py3-none-any.whl (4.7 kB)
Requirement already satisfied: tzdata>=2022.1 in /usr/local/lib/python3.10/dist-packages (from pandas->llama-index-core==0.10.43->llama-index<0.11.0,>=0.10.19->lavague-core<0.3.0,>=0.2.0->lavague) (2024.1)
Requirement already satisfied: pycparser in /usr/local/lib/python3.10/dist-packages (from cffi>=1.12->cryptography>=2.5->azure-identity<2.0.0,>=1.15.0->llama-index-llms-azure-openai<0.2.0,>=0.1.8->lavague-contexts-openai<0.3.0,>=0.2.0->lavague) (2.22)
Installing collected packages: striprtf, dirtyjson, tld, rank-bm25, pypdf, portalocker, packaging, outcome, orjson, mypy-extensions, lxml, jsonpointer, jedi, h11, deprecated, wsproto, typing-inspect, trio, tiktoken, marshmallow, lxml-html-clean, jsonpatch, httpcore, dateparser, courlan, azure-core, trio-websocket, langsmith, httpx, htmldate, dataclasses-json, selenium, openai, msal, llamaindex-py-client, langchain-core, justext, trafilatura, msal-extensions, llama-index-legacy, llama-index-core, langchain-text-splitters, langchain-community, llama-parse, llama-index-retrievers-bm25, llama-index-readers-file, llama-index-llms-openai, llama-index-indices-managed-llama-cloud, llama-index-embeddings-openai, langchain, azure-identity, llama-index-readers-llama-parse, llama-index-multi-modal-llms-openai, llama-index-llms-azure-openai, llama-index-cli, llama-index-agent-openai, llama-index-program-openai, llama-index-multi-modal-llms-azure-openai, llama-index-question-gen-openai, llama-index, lavague-core, lavague-drivers-selenium, lavague-contexts-openai, lavague
Attempting uninstall: packaging
Found existing installation: packaging 24.0
Uninstalling packaging-24.0:
Successfully uninstalled packaging-24.0
Attempting uninstall: lxml
Found existing installation: lxml 4.9.4
Uninstalling lxml-4.9.4:
Successfully uninstalled lxml-4.9.4
Successfully installed azure-core-1.30.1 azure-identity-1.16.0 courlan-1.2.0 dataclasses-json-0.6.6 dateparser-1.2.0 deprecated-1.2.14 dirtyjson-1.0.8 h11-0.14.0 htmldate-1.8.1 httpcore-1.0.5 httpx-0.27.0 jedi-0.19.1 jsonpatch-1.33 jsonpointer-2.4 justext-3.0.1 langchain-0.1.20 langchain-community-0.0.38 langchain-core-0.1.52 langchain-text-splitters-0.0.2 langsmith-0.1.72 lavague-1.1.0 lavague-contexts-openai-0.2.0 lavague-core-0.2.7 lavague-drivers-selenium-0.2.1 llama-index-0.10.43 llama-index-agent-openai-0.2.7 llama-index-cli-0.1.12 llama-index-core-0.10.43 llama-index-embeddings-openai-0.1.10 llama-index-indices-managed-llama-cloud-0.1.6 llama-index-legacy-0.9.48 llama-index-llms-azure-openai-0.1.8 llama-index-llms-openai-0.1.22 llama-index-multi-modal-llms-azure-openai-0.1.4 llama-index-multi-modal-llms-openai-0.1.6 llama-index-program-openai-0.1.6 llama-index-question-gen-openai-0.1.3 llama-index-readers-file-0.1.23 llama-index-readers-llama-parse-0.1.4 llama-index-retrievers-bm25-0.1.3 llama-parse-0.4.4 llamaindex-py-client-0.1.19 lxml-5.2.2 lxml-html-clean-0.1.1 marshmallow-3.21.2 msal-1.28.0 msal-extensions-1.1.0 mypy-extensions-1.0.0 openai-1.31.1 orjson-3.10.3 outcome-1.3.0.post0 packaging-23.2 portalocker-2.8.2 pypdf-4.2.0 rank-bm25-0.2.2 selenium-4.21.0 striprtf-0.0.26 tiktoken-0.7.0 tld-0.13 trafilatura-1.10.0 trio-0.25.1 trio-websocket-0.11.1 typing-inspect-0.9.0 wsproto-1.2.0
Initialize your Navigation Engine¶
from lavague.drivers.selenium import SeleniumDriver
from lavague.core.navigation import NavigationEngine
selenium_driver = SeleniumDriver(headless=True, url="https://huggingface.co/")
nav_engine = NavigationEngine(selenium_driver)
Performing RAG¶
instruction = "Click on the PEFT section."
nodes = nav_engine.get_nodes(instruction)
from IPython.display import display, HTML, Code
for node in nodes:
display(HTML(node))
display(Code(node, language="html"))
print("--------------")
Build your portfolio
Share your work with the world and build your ML profile.
Accelerate your ML
We provide paid Compute and Enterprise solutions.
Compute
Deploy on optimized Inference Endpoints or update your Spaces applications to a GPU in a few clicks.
Starting at $0.60/hour for GPU
<div class="flex justify-between p-6 md:p-8" xpath="/html/body/div/main/div[3]/div[2]/div[4]/div[1]"><div xpath="/html/body/div/main/div[3]/div[2]/div[4]/div[1]/div"><h3 class="text-xl font-semibold 2xl:text-2xl" xpath="/html/body/div/main/div[3]/div[2]/div[4]/div[1]/div/h3">Build your portfolio</h3>
<p class="text-base text-gray-500 2xl:text-lg" xpath="/html/body/div/main/div[3]/div[2]/div[4]/div[1]/div/p">Share your work with the world and build your ML profile.</p></div>
<a class="flex-none self-start rounded-full border border-transparent bg-gray-900 px-2.5 py-1.5 text-smd leading-none text-white hover:border-black hover:bg-white hover:text-black" href="/join" xpath="/html/body/div/main/div[3]/div[2]/div[4]/div[1]/a">Sign Up
</a></div>
<img alt="Younes Belkada Hugging Face profile" class="ml-auto w-full flex-1 overflow-hidden border-t border-gray-100 object-cover object-left-top" src="/front/assets/homepage/younes.svg" xpath="/html/body/div/main/div[3]/div[2]/div[4]/img"/>
<div class="pointer-events-none absolute inset-x-0 bottom-0 h-40 select-none bg-gradient-to-tl from-white/80 to-white/0" xpath="/html/body/div/main/div[3]/div[2]/div[4]/div[2]"></div></div></div>
<div class="flex w-full flex-col items-stretch pb-24 pt-24 text-center" xpath="/html/body/div/main/div[3]/div[3]"><div class="mb-2 flex items-center justify-center gap-2 text-xl font-bold" xpath="/html/body/div/main/div[3]/div[3]/div"><div class="mr-4 h-px flex-1 bg-gradient-to-l from-gray-100 to-white" xpath="/html/body/div/main/div[3]/div[3]/div/div[1]"></div>
<h2 class="text-3xl font-bold 2xl:text-4xl" xpath="/html/body/div/main/div[3]/div[3]/div/h2">Accelerate your ML</h2>
<div class="ml-4 h-px flex-1 bg-gradient-to-r from-gray-100 to-white" xpath="/html/body/div/main/div[3]/div[3]/div/div[2]"></div></div>
<p class="text-lg text-gray-500 2xl:text-xl" style="text-wrap: balance;" xpath="/html/body/div/main/div[3]/div[3]/p">We provide paid Compute and Enterprise solutions.
</p></div>
<div class="mx-auto grid max-w-5xl grid-cols-1 gap-10 2xl:max-w-7xl" xpath="/html/body/div/main/div[3]/div[4]"><div class="col-span-1 grid h-[450px] grid-cols-1 items-center overflow-hidden rounded-xl border bg-white shadow-sm lg:h-[400px] lg:grid-cols-3" xpath="/html/body/div/main/div[3]/div[4]/div[1]"><div class="col-span-1 p-7 md:p-10" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]"><h3 class="mb-4 text-2xl font-semibold" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/h3">Compute</h3>
<p class="mb-6 text-base text-gray-500 lg:mb-8 2xl:text-lg" style="text-wrap: balance;" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/p">Deploy on optimized <a class="underline" href="/pricing#endpoints" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/p/a[1]">Inference Endpoints</a> or update your
<a class="underline" href="/pricing#spaces" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/p/a[2]">Spaces applications</a> to a GPU in a few clicks.
</p>
<div class="flex items-center gap-x-2.5 whitespace-nowrap sm:gap-x-3.5" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/div"><a class="leading-black rounded-lg border border-transparent bg-black px-3.5 py-1 text-base text-white hover:border-black hover:bg-white hover:text-gray-900 2xl:text-lg" href="/pricing" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/div/a">View pricing
</a>
<p class="text-smd text-gray-400 2xl:text-base" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/div/p">Starting at $0.60/hour for GPU</p></div></div>
<div class="col-span-1 self-stretch lg:col-span-2" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[2]"><img alt="Hugging face compute offering" class="pointer-events-none h-full w-full select-none bg-bottom object-cover object-left" src="/front/assets/homepage/compute.svg" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[2]/img"/></div></div>
--------------
Build your portfolio
Share your work with the world and build your ML profile.
Accelerate your ML
We provide paid Compute and Enterprise solutions.
Compute
Deploy on optimized Inference Endpoints or update your Spaces applications to a GPU in a few clicks.
Starting at $0.60/hour for GPU
<div class="flex justify-between p-6 md:p-8" xpath="/html/body/div/main/div[3]/div[2]/div[4]/div[1]"><div xpath="/html/body/div/main/div[3]/div[2]/div[4]/div[1]/div"><h3 class="text-xl font-semibold 2xl:text-2xl" xpath="/html/body/div/main/div[3]/div[2]/div[4]/div[1]/div/h3">Build your portfolio</h3>
<p class="text-base text-gray-500 2xl:text-lg" xpath="/html/body/div/main/div[3]/div[2]/div[4]/div[1]/div/p">Share your work with the world and build your ML profile.</p></div>
<a class="flex-none self-start rounded-full border border-transparent bg-gray-900 px-2.5 py-1.5 text-smd leading-none text-white hover:border-black hover:bg-white hover:text-black" href="/join" xpath="/html/body/div/main/div[3]/div[2]/div[4]/div[1]/a">Sign Up
</a></div>
<img alt="Younes Belkada Hugging Face profile" class="ml-auto w-full flex-1 overflow-hidden border-t border-gray-100 object-cover object-left-top" src="/front/assets/homepage/younes.svg" xpath="/html/body/div/main/div[3]/div[2]/div[4]/img"/>
<div class="pointer-events-none absolute inset-x-0 bottom-0 h-40 select-none bg-gradient-to-tl from-white/80 to-white/0" xpath="/html/body/div/main/div[3]/div[2]/div[4]/div[2]"></div></div></div>
<div class="flex w-full flex-col items-stretch pb-24 pt-24 text-center" xpath="/html/body/div/main/div[3]/div[3]"><div class="mb-2 flex items-center justify-center gap-2 text-xl font-bold" xpath="/html/body/div/main/div[3]/div[3]/div"><div class="mr-4 h-px flex-1 bg-gradient-to-l from-gray-100 to-white" xpath="/html/body/div/main/div[3]/div[3]/div/div[1]"></div>
<h2 class="text-3xl font-bold 2xl:text-4xl" xpath="/html/body/div/main/div[3]/div[3]/div/h2">Accelerate your ML</h2>
<div class="ml-4 h-px flex-1 bg-gradient-to-r from-gray-100 to-white" xpath="/html/body/div/main/div[3]/div[3]/div/div[2]"></div></div>
<p class="text-lg text-gray-500 2xl:text-xl" style="text-wrap: balance;" xpath="/html/body/div/main/div[3]/div[3]/p">We provide paid Compute and Enterprise solutions.
</p></div>
<div class="mx-auto grid max-w-5xl grid-cols-1 gap-10 2xl:max-w-7xl" xpath="/html/body/div/main/div[3]/div[4]"><div class="col-span-1 grid h-[450px] grid-cols-1 items-center overflow-hidden rounded-xl border bg-white shadow-sm lg:h-[400px] lg:grid-cols-3" xpath="/html/body/div/main/div[3]/div[4]/div[1]"><div class="col-span-1 p-7 md:p-10" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]"><h3 class="mb-4 text-2xl font-semibold" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/h3">Compute</h3>
<p class="mb-6 text-base text-gray-500 lg:mb-8 2xl:text-lg" style="text-wrap: balance;" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/p">Deploy on optimized <a class="underline" href="/pricing#endpoints" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/p/a[1]">Inference Endpoints</a> or update your
<a class="underline" href="/pricing#spaces" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/p/a[2]">Spaces applications</a> to a GPU in a few clicks.
</p>
<div class="flex items-center gap-x-2.5 whitespace-nowrap sm:gap-x-3.5" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/div"><a class="leading-black rounded-lg border border-transparent bg-black px-3.5 py-1 text-base text-white hover:border-black hover:bg-white hover:text-gray-900 2xl:text-lg" href="/pricing" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/div/a">View pricing
</a>
<p class="text-smd text-gray-400 2xl:text-base" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/div/p">Starting at $0.60/hour for GPU</p></div></div>
<div class="col-span-1 self-stretch lg:col-span-2" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[2]"><img alt="Hugging face compute offering" class="pointer-events-none h-full w-full select-none bg-bottom object-cover object-left" src="/front/assets/homepage/compute.svg" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[2]/img"/></div></div>
--------------
Build your portfolio
Share your work with the world and build your ML profile.
Accelerate your ML
We provide paid Compute and Enterprise solutions.
Compute
Deploy on optimized Inference Endpoints or update your Spaces applications to a GPU in a few clicks.
Starting at $0.60/hour for GPU
<div class="flex justify-between p-6 md:p-8" xpath="/html/body/div/main/div[3]/div[2]/div[4]/div[1]"><div xpath="/html/body/div/main/div[3]/div[2]/div[4]/div[1]/div"><h3 class="text-xl font-semibold 2xl:text-2xl" xpath="/html/body/div/main/div[3]/div[2]/div[4]/div[1]/div/h3">Build your portfolio</h3>
<p class="text-base text-gray-500 2xl:text-lg" xpath="/html/body/div/main/div[3]/div[2]/div[4]/div[1]/div/p">Share your work with the world and build your ML profile.</p></div>
<a class="flex-none self-start rounded-full border border-transparent bg-gray-900 px-2.5 py-1.5 text-smd leading-none text-white hover:border-black hover:bg-white hover:text-black" href="/join" xpath="/html/body/div/main/div[3]/div[2]/div[4]/div[1]/a">Sign Up
</a></div>
<img alt="Younes Belkada Hugging Face profile" class="ml-auto w-full flex-1 overflow-hidden border-t border-gray-100 object-cover object-left-top" src="/front/assets/homepage/younes.svg" xpath="/html/body/div/main/div[3]/div[2]/div[4]/img"/>
<div class="pointer-events-none absolute inset-x-0 bottom-0 h-40 select-none bg-gradient-to-tl from-white/80 to-white/0" xpath="/html/body/div/main/div[3]/div[2]/div[4]/div[2]"></div></div></div>
<div class="flex w-full flex-col items-stretch pb-24 pt-24 text-center" xpath="/html/body/div/main/div[3]/div[3]"><div class="mb-2 flex items-center justify-center gap-2 text-xl font-bold" xpath="/html/body/div/main/div[3]/div[3]/div"><div class="mr-4 h-px flex-1 bg-gradient-to-l from-gray-100 to-white" xpath="/html/body/div/main/div[3]/div[3]/div/div[1]"></div>
<h2 class="text-3xl font-bold 2xl:text-4xl" xpath="/html/body/div/main/div[3]/div[3]/div/h2">Accelerate your ML</h2>
<div class="ml-4 h-px flex-1 bg-gradient-to-r from-gray-100 to-white" xpath="/html/body/div/main/div[3]/div[3]/div/div[2]"></div></div>
<p class="text-lg text-gray-500 2xl:text-xl" style="text-wrap: balance;" xpath="/html/body/div/main/div[3]/div[3]/p">We provide paid Compute and Enterprise solutions.
</p></div>
<div class="mx-auto grid max-w-5xl grid-cols-1 gap-10 2xl:max-w-7xl" xpath="/html/body/div/main/div[3]/div[4]"><div class="col-span-1 grid h-[450px] grid-cols-1 items-center overflow-hidden rounded-xl border bg-white shadow-sm lg:h-[400px] lg:grid-cols-3" xpath="/html/body/div/main/div[3]/div[4]/div[1]"><div class="col-span-1 p-7 md:p-10" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]"><h3 class="mb-4 text-2xl font-semibold" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/h3">Compute</h3>
<p class="mb-6 text-base text-gray-500 lg:mb-8 2xl:text-lg" style="text-wrap: balance;" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/p">Deploy on optimized <a class="underline" href="/pricing#endpoints" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/p/a[1]">Inference Endpoints</a> or update your
<a class="underline" href="/pricing#spaces" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/p/a[2]">Spaces applications</a> to a GPU in a few clicks.
</p>
<div class="flex items-center gap-x-2.5 whitespace-nowrap sm:gap-x-3.5" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/div"><a class="leading-black rounded-lg border border-transparent bg-black px-3.5 py-1 text-base text-white hover:border-black hover:bg-white hover:text-gray-900 2xl:text-lg" href="/pricing" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/div/a">View pricing
</a>
<p class="text-smd text-gray-400 2xl:text-base" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[1]/div/p">Starting at $0.60/hour for GPU</p></div></div>
<div class="col-span-1 self-stretch lg:col-span-2" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[2]"><img alt="Hugging face compute offering" class="pointer-events-none h-full w-full select-none bg-bottom object-cover object-left" src="/front/assets/homepage/compute.svg" xpath="/html/body/div/main/div[3]/div[4]/div[1]/div[2]/img"/></div></div>
--------------
Enterprise
Give your team the most advanced platform to build AI with enterprise-grade security, access controls and dedicated support.
Starting at $20/user/month
<div class="relative col-span-1 grid h-[450px] grid-cols-1 items-center rounded-xl bg-gradient-to-b from-gray-900 to-gray-950 text-gray-200 shadow-sm lg:h-[400px] lg:grid-cols-3" xpath="/html/body/div/main/div[3]/div[4]/div[2]"><div class="col-span-1 p-7 md:p-10" xpath="/html/body/div/main/div[3]/div[4]/div[2]/div[1]"><h3 class="mb-4 text-2xl font-semibold" xpath="/html/body/div/main/div[3]/div[4]/div[2]/div[1]/h3">Enterprise</h3>
<p class="mb-6 text-base text-gray-500 lg:mb-8 2xl:text-lg" style="text-wrap: balance;" xpath="/html/body/div/main/div[3]/div[4]/div[2]/div[1]/p">Give your team the most advanced platform to build AI with enterprise-grade security, access controls and
dedicated support.
</p>
<div class="flex items-center gap-x-2.5 whitespace-nowrap sm:gap-x-3.5" xpath="/html/body/div/main/div[3]/div[4]/div[2]/div[1]/div"><a class="leading-black rounded-lg border border-transparent bg-gray-200 px-3.5 py-1 text-base text-gray-900 hover:border-white hover:bg-black hover:text-white 2xl:text-lg" href="/enterprise" xpath="/html/body/div/main/div[3]/div[4]/div[2]/div[1]/div/a">Getting started
</a>
<p class="text-smd text-gray-400 2xl:text-base" xpath="/html/body/div/main/div[3]/div[4]/div[2]/div[1]/div/p">Starting at $20/user/month</p></div></div>
<div class="col-span-1 self-stretch rounded-r-xl lg:relative lg:col-span-2 lg:ml-8" xpath="/html/body/div/main/div[3]/div[4]/div[2]/div[2]"><div class="absolute right-20 top-8 hidden h-[300px] w-full max-w-2xl lg:block" xpath="/html/body/div/main/div[3]/div[4]/div[2]/div[2]/div[1]"><a class="top-16 left-24 absolute z-2 rounded-lg border border-white/10 bg-white/10 px-4 py-2 text-sm font-semibold text-white backdrop-blur-sm transition-all duration-200 hover:bg-white/15" href="/enterprise" xpath="/html/body/div/main/div[3]/div[4]/div[2]/div[2]/div[1]/a[1]">Single Sign-On</a><a class="left-1/2 -translate-x-1/2 absolute z-2 rounded-lg border border-white/10 bg-white/10 px-4 py-2 text-sm font-semibold text-white backdrop-blur-sm transition-all duration-200 hover:bg-white/15" href="/enterprise" xpath="/html/body/div/main/div[3]/div[4]/div[2]/div[2]/div[1]/a[2]">Regions</a><a class="right-10 bottom-16 absolute z-2 rounded-lg border border-white/10 bg-white/10 px-4 py-2 text-sm font-semibold text-white backdrop-blur-sm transition-all duration-200 hover:bg-white/15" href="/enterprise" xpath="/html/body/div/main/div[3]/div[4]/div[2]/div[2]/div[1]/a[3]">Priority Support</a><a class="left-10 xl:left-6 bottom-1/3 absolute z-2 rounded-lg border border-white/10 bg-white/10 px-4 py-2 text-sm font-semibold text-white backdrop-blur-sm transition-all duration-200 hover:bg-white/15" href="/enterprise" xpath="/html/body/div/main/div[3]/div[4]/div[2]/div[2]/div[1]/a[4]">Audit Logs</a><a class="bottom-0 right-1/2 absolute z-2 rounded-lg border border-white/10 bg-white/10 px-4 py-2 text-sm font-semibold text-white backdrop-blur-sm transition-all duration-200 hover:bg-white/15" href="/enterprise" xpath="/html/body/div/main/div[3]/div[4]/div[2]/div[2]/div[1]/a[5]">Ressource Groups</a><a class="right-0 top-20 absolute z-2 rounded-lg border border-white/10 bg-white/10 px-4 py-2 text-sm font-semibold text-white backdrop-blur-sm transition-all duration-200 hover:bg-white/15" href="/enterprise" xpath="/html/body/div/main/div[3]/div[4]/div[2]/div[2]/div[1]/a[6]">Private Datasets Viewer</a></div>
<div class="pointer-events-none absolute right-0 top-0 hidden h-64 w-64 overflow-hidden rounded-r-xl lg:block" xpath="/html/body/div/main/div[3]/div[4]/div[2]/div[2]/div[2]">
--------------
<div class="h-2 w-2 flex-none rounded-full bg-lime-500" xpath="/html/body/div/main/div[3]/div[7]/a[5]/h4/div"></div>
Tokenizers</h4>
<div class="flex items-center gap-1.5 text-lg" xpath="/html/body/div/main/div[3]/div[7]/a[5]/div"><svg aria-hidden="true" class="text-xs text-gray-700" focusable="false" height="1em" preserveaspectratio="xMidYMid meet" role="img" viewbox="0 0 256 250" width="1.03em" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xpath="/html/body/div/main/div[3]/div[7]/a[5]/div/svg"><path d="M128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46c6.397 1.185 8.746-2.777 8.746-6.158c0-3.052-.12-13.135-.174-23.83c-35.61 7.742-43.124-15.103-43.124-15.103c-5.823-14.795-14.213-18.73-14.213-18.73c-11.613-7.944.876-7.78.876-7.78c12.853.902 19.621 13.19 19.621 13.19c11.417 19.568 29.945 13.911 37.249 10.64c1.149-8.272 4.466-13.92 8.127-17.116c-28.431-3.236-58.318-14.212-58.318-63.258c0-13.975 5-25.394 13.188-34.358c-1.329-3.224-5.71-16.242 1.24-33.874c0 0 10.749-3.44 35.21 13.121c10.21-2.836 21.16-4.258 32.038-4.307c10.878.049 21.837 1.47 32.066 4.307c24.431-16.56 35.165-13.12 35.165-13.12c6.967 17.63 2.584 30.65 1.255 33.873c8.207 8.964 13.173 20.383 13.173 34.358c0 49.163-29.944 59.988-58.447 63.157c4.591 3.972 8.682 11.762 8.682 23.704c0 17.126-.148 30.91-.148 35.126c0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002C256 57.307 198.691 0 128.001 0zm-80.06 182.34c-.282.636-1.283.827-2.194.39c-.929-.417-1.45-1.284-1.15-1.922c.276-.655 1.279-.838 2.205-.399c.93.418 1.46 1.293 1.139 1.931zm6.296 5.618c-.61.566-1.804.303-2.614-.591c-.837-.892-.994-2.086-.375-2.66c.63-.566 1.787-.301 2.626.591c.838.903 1 2.088.363 2.66zm4.32 7.188c-.785.545-2.067.034-2.86-1.104c-.784-1.138-.784-2.503.017-3.05c.795-.547 2.058-.055 2.861 1.075c.782 1.157.782 2.522-.019 3.08zm7.304 8.325c-.701.774-2.196.566-3.29-.49c-1.119-1.032-1.43-2.496-.726-3.27c.71-.776 2.213-.558 3.315.49c1.11 1.03 1.45 2.505.701 3.27zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033c-1.448-.439-2.395-1.613-2.103-2.626c.301-1.01 1.747-1.484 3.207-1.028c1.446.436 2.396 1.602 2.095 2.622zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95c-1.53.034-2.769-.82-2.786-1.86c0-1.065 1.202-1.932 2.733-1.958c1.522-.03 2.768.818 2.768 1.868zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37c-1.485.271-2.861-.365-3.05-1.386c-.184-1.056.893-2.114 2.376-2.387c1.514-.263 2.868.356 3.061 1.403z" fill="currentColor" xpath="/html/body/div/main/div[3]/div[7]/a[5]/div/svg/path"></path></svg>
<span xpath="/html/body/div/main/div[3]/div[7]/a[5]/div/span">8,567</span></div>
<p class="mt-auto text-sm text-gray-500 md:text-base 2xl:text-lg" xpath="/html/body/div/main/div[3]/div[7]/a[5]/p">Fast tokenizers, optimized for both research and production.</p>
</a>
<a class="relative col-span-1 flex h-48 flex-col rounded-[1.6rem] border border-gray-100 bg-white/80 p-5 shadow-sm transition-transform will-change-transform hover:translate-y-px hover:shadow-inner sm:h-56 sm:p-6 2xl:h-72 2xl:p-10 lg:translate-y-12 lg:hover:!translate-y-[calc(3rem+1px)]" href="/docs/peft" xpath="/html/body/div/main/div[3]/div[7]/a[6]"><h4 class="flex items-center gap-1.5 text-lg font-bold !leading-tight sm:gap-2 sm:text-xl 2xl:text-2xl" xpath="/html/body/div/main/div[3]/div[7]/a[6]/h4"><div class="h-2 w-2 flex-none rounded-full bg-red-500" xpath="/html/body/div/main/div[3]/div[7]/a[6]/h4/div"></div>
PEFT</h4>
--------------
context = "\n".join(nodes)
action = nav_engine.get_action_from_context(context, instruction)
display(Code(action, language="python"))
# Let's think step by step
# First, we notice that the query asks us to click on the "PEFT" section.
# In the provided HTML, we see that the "PEFT" section is within an anchor element (<a>) with a specific class and href attribute.
# The "PEFT" section can be identified by its anchor element with the text 'PEFT'.
# Specifically, for the "PEFT" section, there is an anchor element within a div element:
# /html/body/div/main/div[3]/div[7]/a[6]
# We can use this XPATH to identify and click on the "PEFT" section:
peft_section = driver.find_element(By.XPATH, "/html/body/div/main/div[3]/div[7]/a[6]")
peft_section.click()
# Let's think step by step
# First, we notice that the query asks us to click on the PEFT section.
# In the provided HTML, we see that the PEFT section is represented by an anchor element (<a>) with a specific href attribute "/docs/peft".
# The PEFT section is located within a div element with a specific class and contains a heading (<h4>) with the text "PEFT".
# We need to identify the correct anchor element that represents the PEFT section.
# Specifically, for the PEFT section, there is an anchor element with the following XPath:
# /html/body/div/main/div[3]/div[7]/a[6]
# Thus, we believe this is the correct element to be interacted with:
peft_section = driver.find_element(By.XPATH, "/html/body/div/main/div[3]/div[7]/a[6]")
# Then we can click on the PEFT section
peft_section.click()
Generating the code¶
context = "\n".join(nodes)
action = nav_engine.get_action_from_context(context, instruction)
display(Code(action, language="python"))
# Let's think step by step
# First, we notice that the query asks us to click on the "PEFT" section.
# In the provided HTML, we see that the "PEFT" section is within an anchor element (<a>) with a specific class and href attribute.
# The "PEFT" section can be identified by its anchor element which contains a child <h4> element with the text "PEFT".
# Specifically, for the "PEFT" section, there is an anchor element with the following XPath:
# /html/body/div/main/div[3]/div[7]/a[6]
# We can use this XPath to identify and click on the "PEFT" section:
peft_section = driver.find_element(By.XPATH, "/html/body/div/main/div[3]/div[7]/a[6]")
peft_section.click()
Prompt template¶
from lavague.core.navigation import NAVIGATION_ENGINE_PROMPT_TEMPLATE
print(NAVIGATION_ENGINE_PROMPT_TEMPLATE.prompt_template)
metadata={'prompt_type': <PromptType.CUSTOM: 'custom'>} template_vars=['driver_capability', 'context_str', 'query_str'] kwargs={} output_parser=None template_var_mappings=None function_mappings=None template='\n{driver_capability}\n\nHere is a the next example to answer:\n\nHTML:\n{context_str}\nQuery: {query_str}\nCompletion:\n\n'
print(selenium_driver.get_capability())
You are a Selenium expert in writing code to interact with web pages. You have been given a series of HTML snippets and queries.
Your goal is to write Selenium code to answer queries. Your answer must be a Python markdown only.
Always target elements by XPATH.
Provide high level explanations about why you think this element is the right one.
Your answer must be short and concise.
Here are examples of previous answers:
HTML:
<div class="QS5gu ud1jmf" role="none" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[1]/div/div/button/div">Inloggen</div></button></div></div></div><div class="GZ7xNe" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]"><h1 class="I90TVb" id="S3BnEe" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]/h1">Voordat je verdergaat naar Google</h1><div class="AG96lb" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]/div"><div class="eLZYyf" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]/div/div[1]">We gebruiken <a class="F4a1l" href="https://policies.google.com/technologies/cookies?utm_source=ucbs&hl=nl" target="_blank" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]/div/div[1]/a">cookies</a> en gegevens voor het volgende:<ul class="dbXO9" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]/div/div[1]/ul"><li class="gowsYd ibCF0c" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]/div/div[1]/ul/li[1]">Google-services leveren en onderhouden</li><li class="gowsYd GwwhGf" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]/div/div[1]/ul/li[2]">Uitval bijhouden en bescherming bieden tegen spam, fraude en misbruik</li><li class="gowsYd v8Bpfb" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]/div/div[1]/ul/li[3]">Doelgroepbetrokkenheid en sitestatistieken meten om inzicht te krijgen in hoe onze services worden gebruikt en de kwaliteit van die services te verbeteren</li></ul></div><div class="eLZYyf" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]/div/div[2]">Als je Alles accepteren kiest, gebruiken we cookies en gegevens ook voor het volgende:<ul class="dbXO9" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]/div/div[2]/ul"><li class="gowsYd M6j9qf" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]/div/div[2]/ul/li[1]">Nieuwe services ontwikkelen en verbeteren</li><li class="gowsYd v8Bpfb" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]/div/div[2]/ul/li[2]">Advertenties laten zien en de effectiviteit ervan meten</li><li class="gowsYd e21Mac" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]/div/div[2]/ul/li[3]">Gepersonaliseerde content laten zien (afhankelijk van je instellingen)</li><li class="gowsYd ohEWPc" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]/div/div[2]/ul/li[4]">Gepersonaliseerde advertenties laten zien (afhankelijk van je instellingen)</li></ul><div class="jLhwdc" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]/div/div[2]/div">Als je Alles afwijzen kiest, gebruiken we cookies niet voor deze aanvullende doeleinden.</div></div><div class="yS1nld" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]/div/div[3]">Niet-gepersonaliseerde content wordt beïnvloed door factoren zoals de content die je op dat moment bekijkt, activiteit in je actieve zoeksessie en je locatie. Niet-gepersonaliseerde advertenties worden beïnvloed door de content die je op dat moment bekijkt en je algemene locatie. Gepersonaliseerde content en advertenties kunnen ook relevantere resultaten, aanbevelingen en op jou toegespitste advertenties omvatten die zijn gebaseerd op eerdere activiteit van deze browser, zoals uitgevoerde Google-zoekopdrachten. We gebruiken cookies en gegevens ook om te zorgen dat de functionaliteit geschikt is voor je leeftijd, als dit relevant is.</div><div class="yS1nld" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]/div/div[4]">Selecteer Meer opties om meer informatie te bekijken, waaronder over hoe je je privacyinstellingen beheert. Je kunt ook altijd naar <span xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[2]/div/div[4]/span">g.co/privacytools</span> gaan.</div></div></div><div class="spoKVd" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]">
<div class="spoKVd" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]"><div class="GzLjMd" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]/div[1]"><button class="tHlp8d" data-ved="0ahUKEwjX3bmBmKeGAxU2xQIHHcGoAg4Q4cIICHw" id="W0wltc" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]/div[1]/button[1]"><div class="QS5gu sy4vM" role="none" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]/div[1]/button[1]/div">Alles afwijzen</div></button><button class="tHlp8d" data-ved="0ahUKEwjX3bmBmKeGAxU2xQIHHcGoAg4QiZAHCH0" id="L2AGLb" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]/div[1]/button[2]"><div class="QS5gu sy4vM" role="none" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]/div[1]/button[2]/div">Alles accepteren</div></button></div><div class="GzLjMd" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]/div[2]"><button class="tHlp8d" data-ved="0ahUKEwjX3bmBmKeGAxU2xQIHHcGoAg4QiJAHCH4" id="VnjCcb" role="link" tabindex="-1" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]/div[2]/button"><a class="eOjPIe" tabindex="0" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]/div[2]/button/a">Meer opties</a></button></div></div><div class="XWlrff cG0Dmf" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[4]"><a class="peRL2e" data-ved="0ahUKEwjX3bmBmKeGAxU2xQIHHcGoAg4Qj5AHCH8" href="https://policies.google.com/privacy?hl=nl&fg=1&utm_source=ucbs" id="RP3V5c" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[4]/a[1]">Privacy</a>
<div class="spoKVd" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]"><div class="GzLjMd" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]/div[1]"><button class="tHlp8d" data-ved="0ahUKEwjX3bmBmKeGAxU2xQIHHcGoAg4Q4cIICHw" id="W0wltc" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]/div[1]/button[1]"><div class="QS5gu sy4vM" role="none" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]/div[1]/button[1]/div">Alles afwijzen</div></button><button class="tHlp8d" data-ved="0ahUKEwjX3bmBmKeGAxU2xQIHHcGoAg4QiZAHCH0" id="L2AGLb" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]/div[1]/button[2]"><div class="QS5gu sy4vM" role="none" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]/div[1]/button[2]/div">Alles accepteren</div></button></div><div class="GzLjMd" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]/div[2]"><button class="tHlp8d" data-ved="0ahUKEwjX3bmBmKeGAxU2xQIHHcGoAg4QiJAHCH4" id="VnjCcb" role="link" tabindex="-1" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]/div[2]/button"><a class="eOjPIe" tabindex="0" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]/div[2]/button/a">Meer opties</a></button></div></div><div class="XWlrff cG0Dmf" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[4]"><a class="peRL2e" data-ved="0ahUKEwjX3bmBmKeGAxU2xQIHHcGoAg4Qj5AHCH8" href="https://policies.google.com/privacy?hl=nl&fg=1&utm_source=ucbs" id="RP3V5c" xpath="/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[4]/a[1]">Privacy</a>
Query: Click on the button labeled 'Alles accepteren' to accept all cookies.
Completion:
```python
# Let's think step by step
# First, we notice that the query asks us to click on the button labeled 'Alles accepteren' to accept all cookies.
# In the provided HTML, we can see several button elements.
# We need to identify the correct button labeled 'Alles accepteren'.
# Upon examining the HTML structure, we see that the button with the text 'Alles accepteren' is located within a specific hierarchy.
# We need to navigate through the hierarchy to accurately locate this button.
# The correct button is located within a div element with a specific class and role attribute, which helps us ensure that we are targeting the right element.
# Specifically, for 'Alles accepteren', there is a button element with a unique ID 'L2AGLb' which contains a div with the text 'Alles accepteren'.
# We observe that this button element has the following XPath:
# /html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]/div[1]/button[2]
# Thus, we believe this is the correct element to be interacted with:
accept_all_button = driver.find_element(By.XPATH, "/html/body/div[2]/div[2]/div[3]/span/div/div/div/div[3]/div[1]/button[2]")
# Then we can click on the button
accept_all_button.click()
```
---
HTML:
<div class="devsite-top-logo-row-middle" xpath="/html/body/section/devsite-header/div/div[1]/div/div/div[2]">
<div class="devsite-header-upper-tabs" xpath="/html/body/section/devsite-header/div/div[1]/div/div/div[2]/div[1]">
<devsite-tabs class="upper-tabs devsite-overflow-menu--open" connected="" xpath="/html/body/section/devsite-header/div/div[1]/div/div/div[2]/div[1]/devsite-tabs">
<nav aria-label="Upper tabs" class="devsite-tabs-wrapper" xpath="/html/body/section/devsite-header/div/div[1]/div/div/div[2]/div[1]/devsite-tabs/nav">
<tab class="devsite-active" xpath="/html/body/section/devsite-header/div/div[1]/div/div/div[2]/div[1]/devsite-tabs/nav/tab[1]">
<a aria-label="Gemini API, selected" class="devsite-tabs-content gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Tab: Gemini API" href="https://ai.google.dev/gemini-api" track-metadata-eventdetail="https://ai.google.dev/gemini-api" track-metadata-module="primary nav" track-metadata-position="nav - gemini api" track-name="gemini api" track-type="nav" xpath="/html/body/section/devsite-header/div/div[1]/div/div/div[2]/div[1]/devsite-tabs/nav/tab[1]/a">
Gemini API
</a>
</tab>
<tab class="devsite-overflow-tab" xpath="/html/body/section/devsite-header/div/div[1]/div/div/div[2]/div[1]/devsite-tabs/nav/tab[2]"><!-- -->
<a aria-label="Extended Navigation" class="devsite-icon devsite-icon-arrow-drop-down" href="#" style="border: 2px solid red;" xpath="/html/body/section/devsite-header/div/div[1]/div/div/div[2]/div[1]/devsite-tabs/nav/tab[2]/a"><!--?lit$8296333005$-->More</a>
<div class="devsite-tabs-overflow-menu" scrollbars="" xpath="/html/body/section/devsite-header/div/div[1]/div/div/div[2]/div[1]/devsite-tabs/nav/tab[2]/div">
<tab xpath="/html/body/section/devsite-header/div/div[1]/div/div/div[2]/div[1]/devsite-tabs/nav/tab[2]/div/tab[1]">
<a class="devsite-tabs-content gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Tab: Gemma" href="https://ai.google.dev/gemma" track-metadata-eventdetail="https://ai.google.dev/gemma" track-metadata-module="primary nav" track-metadata-position="nav - gemma" track-name="gemma" track-type="nav" xpath="/html/body/section/devsite-header/div/div[1]/div/div/div[2]/div[1]/devsite-tabs/nav/tab[2]/div/tab[1]/a">
Gemma
</a>
</tab><tab xpath="/html/body/section/devsite-header/div/div[1]/div/div/div[2]/div[1]/devsite-tabs/nav/tab[2]/div/tab[2]">
<a class="devsite-tabs-content gc-analytics-event" data-category="Site-Wide Custom Events" data-label="Tab: Google AI Edge" href="https://ai.google.dev/edge" track-metadata-eventdetail="https://ai.google.dev/edge" track-metadata-module="primary nav" track-metadata-position="nav - google ai edge" track-name="google ai edge" track-type="nav" xpath="/html/body/section/devsite-header/div/div[1]/div/div/div[2]/div[1]/devsite-tabs/nav/tab[2]/div/tab[2]/a">
Google AI Edge
Query: Click on "Gemma" under the "More" dropdown menu.
Completion:
```python
# Let's think step by step
# First, we notice that the query asks us to click on the "Gemma" option under the "More" dropdown menu.
# In the provided HTML, we see that the "More" dropdown menu is within a tab element with a specific class and role attribute.
# The "More" dropdown menu can be identified by its class 'devsite-overflow-tab' and contains a link element with the text 'More'.
# We need to interact with this dropdown menu to reveal the hidden options.
# Specifically, for the "More" dropdown menu, there is an anchor element within a tab element:
# /html/body/section/devsite-header/div/div[1]/div/div/div[2]/div[1]/devsite-tabs/nav/tab[2]/a
# We can use this XPATH to identify and click on the "More" dropdown menu:
more_dropdown = driver.find_element(By.XPATH, "/html/body/section/devsite-header/div/div[1]/div/div/div[2]/div[1]/devsite-tabs/nav/tab[2]/a")
more_dropdown.click()
# After clicking the "More" dropdown, we need to select the "Gemma" option from the revealed menu.
# The "Gemma" option is located within the dropdown menu and can be identified by its anchor element with the corresponding text:
# /html/body/section/devsite-header/div/div[1]/div/div/div[2]/div[1]/devsite-tabs/nav/tab[2]/div/tab[1]/a
# Thus, we use this XPATH to identify and click on the "Gemma" option:
gemma_option = driver.find_element(By.XPATH, "/html/body/section/devsite-header/div/div[1]/div/div/div[2]/div[1]/devsite-tabs/nav/tab[2]/div/tab[1]/a")
gemma_option.click()
```
---