Apify
ApifyActor #
Bases: BaseReader
Apify Actor reader. Calls an Actor on the Apify platform and reads its resulting dataset when it finishes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
apify_api_token |
str
|
Apify API token. |
required |
Source code in llama-index-integrations/readers/llama-index-readers-apify/llama_index/readers/apify/actor/base.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
load_data #
load_data(actor_id: str, run_input: Dict, dataset_mapping_function: Callable[[Dict], Document], *, build: Optional[str] = None, memory_mbytes: Optional[int] = None, timeout_secs: Optional[int] = None) -> List[Document]
Call an Actor on the Apify platform, wait for it to finish, and return its resulting dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actor_id |
str
|
The ID or name of the Actor. |
required |
run_input |
Dict
|
The input object of the Actor that you're trying to run. |
required |
dataset_mapping_function |
Callable
|
A function that takes a single dictionary (an Apify dataset item) and converts it to an instance of the Document class. |
required |
build |
str
|
Optionally specifies the Actor build to run. It can be either a build tag or build number. |
None
|
memory_mbytes |
int
|
Optional memory limit for the run, in megabytes. |
None
|
timeout_secs |
int
|
Optional timeout for the run, in seconds. |
None
|
Returns:
Type | Description |
---|---|
List[Document]
|
List[Document]: List of documents. |
Source code in llama-index-integrations/readers/llama-index-readers-apify/llama_index/readers/apify/actor/base.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
ApifyDataset #
Bases: BaseReader
Apify Dataset reader. Reads a dataset on the Apify platform.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
apify_api_token |
str
|
Apify API token. |
required |
Source code in llama-index-integrations/readers/llama-index-readers-apify/llama_index/readers/apify/dataset/base.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
load_data #
Load data from the Apify dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_id |
str
|
Dataset ID. |
required |
dataset_mapping_function |
Callable[[Dict], Document]
|
Function to map dataset items to Document. |
required |
Returns:
Type | Description |
---|---|
List[Document]
|
List[Document]: List of documents. |
Source code in llama-index-integrations/readers/llama-index-readers-apify/llama_index/readers/apify/dataset/base.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|