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

Conversation

devanshkaloti
Copy link

Error 1

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[2], line 1
----> 1 from llama_index.tools import FunctionTool
      2 from playwright.async_api import async_playwright
      3 from tarsier import Tarsier, GoogleVisionOCRService

ModuleNotFoundError: No module named 'llama_index.tools'

Changes:

  • Changed from llama_index.tools import FunctionTool to from llama_index.core.tools import FunctionTool

Error 2

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[5], line 1
----> 1 from llama_index.agent import OpenAIAgent
      2 from llama_index.llms import OpenAI
      4 llm = OpenAI(model="gpt-4")

ImportError: cannot import name 'OpenAIAgent' from 'llama_index.agent' (unknown location)

Changes:

  • Changed OpenAI import statements

Error 3

Error: Locator.press_sequentially: selector: expected string, got object
  • element = page.locator(x_path) -> element = page.locator(x_path['xpath'])

Additional

  • Changed the default example model from gpt-4 to gpt-4o since it has much better performance and is cheaper.
  • These changes work with Python version 3.12.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant