Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors in the LlamaIndex Cookbook Example #162

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions cookbook/llama-index-web-agent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
},
"outputs": [],
"source": [
"from llama_index.tools import FunctionTool\n",
"from llama_index.core.tools import FunctionTool\n",
"from playwright.async_api import async_playwright\n",
"from tarsier import Tarsier, GoogleVisionOCRService\n",
"import os\n",
Expand Down Expand Up @@ -219,7 +219,7 @@
" \"\"\"\n",
" x_path = tag_to_xpath[element_id]\n",
" print(x_path)\n",
" element = page.locator(x_path)\n",
" element = page.locator(x_path['xpath'])\n",
" await element.scroll_into_view_if_needed()\n",
" await page.wait_for_timeout(1000)\n",
" await element.click()\n",
Expand All @@ -236,7 +236,7 @@
" \"\"\"\n",
" x_path = tag_to_xpath[element_id]\n",
" print(x_path)\n",
" await page.locator(x_path).press_sequentially(text)\n",
" await page.locator(x_path['xpath']).press_sequentially(text)\n",
" return await read_page()\n",
"\n",
"\n",
Expand Down Expand Up @@ -276,10 +276,10 @@
},
"outputs": [],
"source": [
"from llama_index.agent import OpenAIAgent\n",
"from llama_index.llms import OpenAI\n",
"from llama_index.agent.openai import OpenAIAgent\n",
"from llama_index.llms.openai import OpenAI\n",
"\n",
"llm = OpenAI(model=\"gpt-4\")\n",
"llm = OpenAI(model=\"gpt-4o\")\n",
"tarsier_agent = OpenAIAgent.from_tools(\n",
" [read_page_tool, click_tool, type_text_tool, press_key_tool],\n",
" llm=llm,\n",
Expand Down Expand Up @@ -585,7 +585,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
"version": "3.12.7"
}
},
"nbformat": 4,
Expand Down