Getting Started
Pickaxe Action Structure
All actions are a combination of a few basic parts:
- A name & description, which is used both by AI and by users to understand what the action does.
- An icon, which is used to identify the action in the UI.
- A readme, which is used to provide more information about the action to potential users.
- A trigger prompt, which is used to determine when the action should be run by the AI.
- Function inputs, which are used to pass information to the action from the AI when it is run.
- Environment variables, which are used to pass information to the action from the builder that set it up (e.g. a specific API key).
- Additional packages, which are python packages that are needed by the action.
- Python code, which is the main code that is used to run the action.
Action Code
import requests
import example_package
def function_name(function_input_1: str, function_input_2: str):
"""
This is the fucntion description.
Args:
function_input_1 (str): The first function input.
function_input_2 (str): The second function input.
Returns:
str: The return value.
"""
# Insert your PYTHON code below. You can access environment variables using os.environ[].
# Currently, only the requests library is supported, but more libraries will be available soon.
# Use print statements or return values to display results to the user.
# If you save a png, pdf, csv, jpg, webp, gif, or html file in the root directory, it will be automatically displayed to the user.
# You do not have to call this function as the bot will automatically call and fill in the parameters.
env_var_1 = os.environ["ENV_VAR_1"]
env_var_2 = os.environ["ENV_VAR_2"]
print(f"ENV_VAR_1: {env_var_1}")
print(f"ENV_VAR_2: {env_var_2}")
return "Hello, world!"
This code will be run by the bot when the action is run. The bot will automatically call and fill in the parameters.