WebsiteTools enable an Assistant to parse a website and add its contents to the knowledge base.

Example

The following assistant will read the contents of a website and add it to the knowledge base.

cookbook/tools/website_tools.py
from phi.assistant import Assistant
from phi.tools.website import WebsiteTools

assistant = Assistant(tools=[WebsiteTools()], show_tool_calls=True)
assistant.print_response("Search web page: 'https://docs.phidata.com/introduction'", markdown=True)

Toolkit Params

knowledge_base
WebsiteKnowledgeBase

The knowledge base associated with the website, containing various data and resources linked to the website’s content.

Toolkit Functions

add_website_to_knowledge_base

This function adds a websites content to the knowledge base. NOTE: The website must start with https:// and should be a valid website. Use this function to get information about products from the internet

read_website

This function reads a website and returns the content.