Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

⚡️ robocorp-actions

⚠️ Deprecation Notice: Development of this package has moved and continues under a new PyPI package: sema4ai-actions. You can follow the development in this GitHub repository. The robocorp-actions package will no longer receive updates, so please update your dependencies to ensure continued support and improvements.

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 and bool 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.

Metadata

Release files for robocorp-actions 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for robocorp-actions 0.2.3
File Size Uploaded
robocorp_actions-0.2.3.tar.gz 16.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for robocorp-actions 0.2.3
File Interpreter ABI Platform
robocorp_actions-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 36.1 kB

Release files / robocorp_actions-0.2.3.tar.gz

Download URL robocorp_actions-0.2.3.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c58f6fbbd1b301c63da8454b561b019496670c5f80bfe60a49230603207c32f2
BLAKE2b-256 checksum
How to use checksums
5abd9021aa13c4b2af25f5a76df6f2b43f4ccd18741497c6ac97e735c22c65d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.12.3 Linux/6.8.0-1021-azure

Release files / robocorp_actions-0.2.3-py3-none-any.whl

Download URL robocorp_actions-0.2.3-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8efdd898c2bb14fe3424c906c8b155ca86463353fa916948f230be4776ed06e
BLAKE2b-256 checksum
How to use checksums
a845134d9067bdcfe5e7b50f6d935b15c4c183831859fbc293d4002e736492e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.12.3 Linux/6.8.0-1021-azure
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page