Robocorp Actions
Project description
⚡️ robocorp-actions
A Python library designed to simplify the development of Python actions (AI or otherwise) to be run with the Robocorp Action Server.
Getting started
If you have not setup Action Server already, see the 🏃♂️ Quickstart on how to do that.
Decorate your Python function with the @action
decorator:
from robocorp.actions import action
@action
def sum_numbers(a: float, b: float) -> float:
...
And your function is now an ⚡️Action!
You can now run and debug your action by Starting Action Server with action-server start
and accessing the UI at http://localhost:8080.
Note: Action inputs and outputs support only
int
,float
,str
andbool
types.
Describe your action
For an action's purpose and usage to be understood by AI models (and humans) it needs to be documented correctly.
To do that, use Google Style Docstring to write a clear and concise description on what your action does and document the action inputs and expected output:
@action
def get_weather_forecast(city: str, days: int, scale: str = "celsius") -> str:
"""
Returns weather conditions forecast for a given city.
Args:
city (str): Target city to get the weather conditions for
days: How many day forecast to return
scale (str): Temperature scale to use, should be one of "celsius" or "fahrenheit"
Returns:
str: The requested weather conditions forecast
"""
...
Tip: Experiment with and iterate the exact documentation wording to get more predictable results when using your action with AI apps.
Consequential flag
You can explicitly provide the is_consequential
flag for an action to mark it's operations as "must always prompt the user for confirmation before running" by OpenAI GPTs (and possibly by other providers). If set to False
, the user will be provided with an "always allow" feature.
@action(is_consequential=True)
def get_weather_forecast(city: str, days: int, scale: str = "celsius") -> str:
Execution
To get the full benefits of your actions, the suggested way to run them is using Action Server. But it's also possible to do that directly in command line by passing the named arguments:
python -m robocorp.actions run -- --city=Helsinki --days=3
Guides
API Reference
Explore our API for extensive documentation.
Changelog
A list of releases and corresponding changes can be found in the changelog.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file robocorp_actions-0.1.3.tar.gz
.
File metadata
- Download URL: robocorp_actions-0.1.3.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-1017-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 471a2f1b6f47028d292383ee186cf0752dbbea4d83faeeba3b447b08051d87f7 |
|
MD5 | 40ba0b0823f1357f3a2dc1b2ba294002 |
|
BLAKE2b-256 | cf715c6eedb4f94c33542622fe375b976a699e773d5dd8bfe2d06a895b848277 |
File details
Details for the file robocorp_actions-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: robocorp_actions-0.1.3-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-1017-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c7e8fa79e34a2335e3a614f9225c9f67b7d9137a804ed5e60a1f4330df833b4 |
|
MD5 | b6101595d78d3e35cbb443e9cf867884 |
|
BLAKE2b-256 | d6af8f3d44aff147d599e6ee52337530be3c8fe4ecbef66bcd8acbec20f7d00a |