Camel.toolkits.zapier toolkit
ZapierToolkit
A class representing a toolkit for interacting with Zapier’s NLA API.
This class provides methods for executing Zapier actions through natural language commands, allowing integration with various web services and automation of workflows through the Zapier platform.
Attributes:
api_key (str): The API key for authenticating with Zapier’s API.
base_url (str): The base URL for Zapier’s API endpoints.
timeout (Optional[float]): The timeout value for API requests
in seconds. If None, no timeout is applied.
(default: :obj:None
)
init
list_actions
Returns:
Dict[str, Any]: A dictionary containing the list of available actions.
execute_action
Execute a specific Zapier action using natural language instructions.
Parameters:
- action_id (str): The ID of the Zapier action to execute.
- instructions (str): Natural language instructions for executing the action. For example: “Send an email to john@example.com with subject ‘Hello’ and body ‘How are you?’”
Returns:
Dict[str, Any]: The result of the action execution, including status and any output data.
preview_action
Preview a specific Zapier action using natural language instructions.
Parameters:
- action_id (str): The ID of the Zapier action to preview.
- instructions (str): Natural language instructions for previewing the action. For example: “Send an email to john@example.com with subject ‘Hello’ and body ‘How are you?’”
Returns:
Dict[str, Any]: The preview result showing what parameters would be used if the action were executed.
get_execution_result
Get the execution result of a Zapier action.
Parameters:
- execution_id (str): The execution ID returned from execute_action.
Returns:
Dict[str, Any]: The execution result containing status, logs, and any output data from the action execution.
get_tools
Returns:
List[FunctionTool]: A list of FunctionTool objects representing the functions in the toolkit.