Skip to main content

A customizable Ossarth AI-powered open-source operating system toolkit

Project description

Here's the professional and refined README for your Ossarth module:


Ossarth

AI-Powered Open-Source OS Customization Framework

An AI-driven framework for customizing Ossarth OS by dynamically creating and integrating custom tools & helper functions.


What is Ossarth?

Ossarth is an AI-powered customization framework designed exclusively for Ossarth OS. It allows users to extend their OS functionality dynamically by creating custom AI tools and general-purpose functions.

With Ossarth, users can:
Modify and enhance their OS in real-time.
Define and integrate LangChain-compatible AI tools.
Create automation scripts and system utilities.
Customize system monitoring and OS-level functionalities.
Run a Flask-based AI-powered backend for managing custom tools.


Features

  • AI-driven OS customization with dynamic tool creation.
  • Create and integrate LangChain-compatible AI tools.
  • Automate system tasks with helper functions.
  • Predefined templates for structured function generation.
  • Dynamic module generation for scalable OS enhancements.
  • Designed specifically for Ossarth OS.

Installation

To install Ossarth, use PyPI:

pip install ossarth

Or install the latest version from GitHub:

pip install git+https://github.com/Siddharth-magesh/Ossarth.git

Quick Start

1. Import the Module

from ossarth.tool_manager import ToolManager

2. Initialize the Tool Manager

manager = ToolManager()

3. Create a Custom AI Tool

manager.create_custom_tool(
    func_name="get_disk_usage",
    description="Retrieves disk usage statistics.",
    params="",
    args_doc="None",
    return_type="dict",
    return_desc="A dictionary with total, used, and free disk space in GB.",
    body="""
import shutil
path = "/"
total, used, free = shutil.disk_usage(path)
gb = 1024 * 1024 * 1024
return {
    "total": f"{total / gb:.2f} GB",
    "used": f"{used / gb:.2f} GB",
    "free": f"{free / gb:.2f} GB"
}
""",
    result_dir="custom_os_functions"
)

This will generate a Python file custom_os_functions/get_disk_usage.py, allowing Ossarth OS to retrieve disk usage dynamically.


Creating a Helper Function

manager.create_custom_function(
    func_name="calculate_cpu_load",
    description="Calculates the average CPU load over a given interval.",
    params="interval: int",
    args_doc="interval (int): The time interval for calculating CPU load.",
    return_type="float",
    return_desc="The average CPU load percentage.",
    body="""
import psutil
return psutil.cpu_percent(interval=interval)
""",
    result_dir="custom_helpers"
)

This will generate custom_helpers/calculate_cpu_load.py, a general Python function to monitor CPU load.


Folder Structure

After defining tools and functions, your directory structure will look like this:

Ossarth/
│── custom_os_functions/
│   ├── get_disk_usage.py  # AI Tool for OS customization
│── custom_helpers/
│   ├── calculate_cpu_load.py  # General function
│── ossarth/
│   ├── tool_manager.py    # Core logic for tool management
│   ├── templates/
│   │   ├── general_template.py
│── README.md
│── setup.py
│── requirements.txt

Advanced Usage

Adding Multiple Functions in a Single File

To append new functions to an existing file instead of creating a new one:

manager.create_custom_tool(
    func_name="get_memory_usage",
    description="Retrieves system memory usage statistics.",
    params="",
    args_doc="None",
    return_type="dict",
    return_desc="A dictionary with total, used, and available memory in GB.",
    body="""
import psutil
mem = psutil.virtual_memory()
gb = 1024 * 1024 * 1024
return {
    "total": f"{mem.total / gb:.2f} GB",
    "used": f"{mem.used / gb:.2f} GB",
    "available": f"{mem.available / gb:.2f} GB"
}
""",
    result_dir="custom_os_functions",
    filename="system_monitoring.py"
)

This will add get_memory_usage to system_monitoring.py instead of creating a new file.


Testing the Ossarth Module

Use the following test cases to verify that Ossarth is correctly generating tools and functions:

from ossarth.tool_manager import CustomFunctionManager

manager = CustomFunctionManager(result_dir="tests")

# Test AI tool creation
manager.create_custom_tool(
    func_name="test_tool",
    description="A test tool function.",
    params="param1: int, param2: str",
    args_doc="param1 (int): An integer.\nparam2 (str): A string.",
    return_type="str",
    return_desc="A formatted string.",
    body="return f'Test tool with {param1} and {param2}'",
    filename="new"
)

# Test helper function creation
manager.create_custom_function(
    func_name="test_function",
    description="A test helper function.",
    params="x: int, y: int",
    args_doc="x (int): First number.\ny (int): Second number.",
    return_type="int",
    return_desc="Sum of x and y.",
    body="return x + y",
    filename="new"
)

These tests will ensure that Ossarth is correctly generating AI tools and helper functions for the OS.


License

Ossarth is licensed under the MIT License. You are free to modify and distribute it.


Contributing

We welcome contributions!

To contribute:

  1. Fork the repository.
  2. Make your changes in a new branch.
  3. Submit a pull request.

Contact & Support

For any questions or support:
📧 Email: siddharthmagesh007@gmail.com
🐙 GitHub: Siddharth-magesh


Project details


Download files

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

Source Distribution

ossarth-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

Ossarth-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file ossarth-0.1.0.tar.gz.

File metadata

  • Download URL: ossarth-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for ossarth-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7b88ba0d47a2908cbb1de90b4090e5903059bcdb05eca1220db15986022a0bd0
MD5 cdd7573349a29c39da0f139cb780a8a0
BLAKE2b-256 8e6fe4ad5df1675688ddc32e848afa277a0ca43e651bbb1c0e1c365e4f624213

See more details on using hashes here.

File details

Details for the file Ossarth-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: Ossarth-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for Ossarth-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74631796b34b67d08fb2d4042a15cf93bf424b8d0d849a1d3382b2dba867f598
MD5 cbec98849a7bca59a3c8428d18915702
BLAKE2b-256 b2d07a2acba9686a851ba705211ba8865fe34448baa067863cb2ff185bba71ba

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