Skip to main content

A Python library providing foundational actions for file system operations and output management in LLM applications.

Project description

fabricatio-actions

MIT Python Versions PyPI Version PyPI Downloads PyPI Downloads Build Tool: uv

A Python library providing foundational actions for file system operations and output management in LLM applications.


📦 Installation

This package is part of the fabricatio monorepo and can be installed as an optional dependency using either pip or uv:

pip install fabricatio[actions]
# or
uv pip install fabricatio[actions]

For a full installation that includes this package and all other components of fabricatio:

pip install fabricatio[full]
# or
uv pip install fabricatio[full]

🔍 Overview

Provides foundational actions for file system operations and output management in LLM applications. The package offers robust functionality for reading and writing files, handling file paths, and formatting output for clear presentation in AI-driven workflows.

🧩 Key Features

  • File System Operations: Robust functionality for reading and writing files with encoding handling
  • Output Formatting: Tools for presenting results in clear and organized manner
  • Path Handling: Efficient file path management and validation
  • Task Execution Building Blocks: Foundation components for complex task workflows
  • Agent Integration: Seamless integration with Fabricatio agent framework
  • Asynchronous Support: Built-in async support for non-blocking operations

🧩 Usage Example

from fabricatio.actions import ReadText
from fabricatio import Role, Event, Task, WorkFlow
import asyncio

(Role(name="file_reader", description="file reader role")
 .register_workflow(Event.quick_instantiate("read_text"), WorkFlow(steps=(ReadText().to_task_output(),))
                    ))

async def main():
    ret: str = await Task(name="read_file", goals=["read file"], description="read file").update_init_context(
        read_path="path/to/file"
    ).delegate("read_text")
    print(ret)

asyncio.run(main())

📁 Structure

fabricatio-actions/
├── actions/          - Action implementations
│   ├── fs.py         - File system operations
│   └── output.py     - Output formatting and display
├── models/           - Data models
│   └── generic.py    - Shared type definitions
└── __init__.py       - Package entry point

🔗 Dependencies

Core dependencies:

  • fabricatio-core - Core interfaces and utilities
  • fabricatio-capabilities - Base capability patterns

📄 License

MIT – see LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fabricatio_actions-0.1.12.dev0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file fabricatio_actions-0.1.12.dev0-py3-none-any.whl.

File metadata

  • Download URL: fabricatio_actions-0.1.12.dev0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fabricatio_actions-0.1.12.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 a27ab53cdea6e2ac072fb4659a3f1fcd67cdc8f84fcf67698294a4d560928e59
MD5 73fbe13ee8e9bad28f69cdff5183254a
BLAKE2b-256 f5a1d5b6a9f7f158576c0d5f9df416ab60f19256de3b32c31cc30dd1cf76215f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page