Apify

ApifyTools enable an Agent to access the Apify API and run actors.

Prerequisites

The following example requires the apify-client library and an API token which can be obtained from Apify.

pip install -U apify-client
export MY_APIFY_TOKEN=***

Example

The following agent will use Apify to crawl the webpage: https://docs.projectbit.ca/ and summarize it.

cookbook/tools/apify_tools.py

from bitca.agent import Agent
from bitca.tools.apify import ApifyTools

agent = Agent(tools=[ApifyTools()], show_tool_calls=True)
agent.print_response("Tell me about https://docs.bitca.com/introduction", markdown=True)

Toolkit Params

Parameter
Type
Default
Description

api_key

str

-

API key for authentication purposes.

website_content_crawler

bool

True

Enables the functionality to crawl a website using website-content-crawler actor.

web_scraper

bool

False

Enables the functionality to crawl a website using web_scraper actor.

Toolkit Functions

Function
Description

website_content_crawler

Crawls a website using Apify’s website-content-crawler actor.

web_scrapper

Scrapes a website using Apify’s web-scraper actor.

Information

Last updated