Skip to main content

Radius AI Agent Toolkit - Core

Core abstractions and base classes for the Radius AI Agent Toolkit. This package provides the foundation for building AI agent tools and plugins for interacting with the Radius platform.

This package is part of the Radius AI Agent Toolkit, which provides tools for integrating AI agents with the Radius platform.

Installation

# Install this specific package
pip install radius-ai-agent-sdk

# Required dependencies will be installed automatically:
# pydantic>=2.0.0, asyncio>=3.4.1, typing-extensions>=4.12.2

Prerequisites

  • Python >=3.10
  • pydantic >=2.0.0
  • asyncio >=3.4.1
  • typing-extensions >=4.12.2

Usage

The core package provides base classes and decorators for building AI agent tools and plugins:

from radius.classes.plugin_base import PluginBase
from radius.decorators.tool import Tool
from pydantic import BaseModel

# First, create parameter models using Pydantic
class MyToolParams(BaseModel):
    param1: str = "A string parameter"
    param2: int = "A number parameter"

# Create service class that implements the tool logic
class MyService:
    @Tool({
        "description": "Does something useful",
        "parameters_schema": MyToolParams
    })
    def my_custom_tool(self, params: dict) -> str:
        # Tool implementation
        return f"Processed {params['param1']} with value {params['param2']}"

# Create a custom plugin by extending PluginBase
class MyCustomPlugin(PluginBase):
    def __init__(self):
        # Pass the name and tool providers to the parent constructor
        service = MyService()
        super().__init__("my_custom_plugin", [service])
        self.service = service
    
    # Implement required abstract method
    def supports_chain(self, chain) -> bool:
        # For simplicity, support all chains in this example
        return True

# Create a mock wallet client (simplified for example)
class MockWalletClient:
    def get_address(self):
        return "0x..."
    def get_chain(self):
        return {"type": "evm", "id": 1}
    # Other required wallet methods

# Create an instance of your plugin
my_plugin = MyCustomPlugin()
wallet_client = MockWalletClient()

# Get all tools from the plugin (passing required wallet client)
tools = my_plugin.get_tools(wallet_client)

# Execute a tool
if tools:
    result = tools[0].execute({
        "param1": "test-string",
        "param2": 42
    })
    print(result)  # "Processed test-string with value 42"

API Reference

Base Classes

PluginBase

Abstract base class for creating Radius AI agent plugins. Plugins provide a way to organize related tools.

Constructor:

  • __init__(name: str, tool_providers: List[object]): Creates a new plugin with the given name and tool providers

Properties:

  • name: The name of the plugin
  • tool_providers: Array of objects that provide tools (using the @Tool decorator)

Methods:

  • get_tools(wallet_client: WalletClientBase): Returns all tools defined in the plugin
  • supports_chain(chain: Chain): Abstract method that must be implemented to check if the plugin supports a chain

ToolBase

Base class for creating standalone AI agent tools. Tools created with this class can be used directly without a plugin.

Constructor:

  • __init__(config: ToolConfig): Creates a new tool with configuration containing name, description, and parameters

Properties:

  • name: The name of the tool
  • description: Description of what the tool does
  • parameters: Pydantic model class defining the tool's parameters

Methods:

  • execute(parameters: dict[str, Any]): Executes the tool with the given parameters

Factory Function:

The create_tool function can be used to create a new ToolBase instance:

from radius.classes.tool_base import create_tool
from pydantic import BaseModel

class MyParams(BaseModel):
    value: str = "A parameter"

my_tool = create_tool(
    {
        "name": "my_tool",
        "description": "Does something useful",
        "parameters": MyParams
    },
    lambda params: f"Processed {params['value']}"
)

Decorators

@Tool(params)

Decorator for marking methods as AI agent tools.

Parameters:

  • params["name"] (str, optional): The name of the tool (defaults to the method name in snake_case)
  • params["description"] (str): Description of what the tool does
  • params["parameters_schema"] (Type[BaseModel]): Pydantic model class to validate parameters
from radius.decorators.tool import Tool
from pydantic import BaseModel

class AddNumbersParams(BaseModel):
    a: int = "First number"
    b: int = "Second number"

class MathService:
    @Tool({
        "description": "Adds two numbers together",
        "parameters_schema": AddNumbersParams
    })
    def add_numbers(self, params: dict) -> int:
        return params["a"] + params["b"]

Integration Examples

For complete examples integrating this package with AI frameworks, see:

Resources

Contributing

Please see the Contributing Guide for detailed information about contributing to this toolkit.

License

This project is licensed under the MIT License.

Metadata

Release files for radius-ai-agent-sdk 1.0.0

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

Source distribution (sdist)

Source distribution for radius-ai-agent-sdk 1.0.0
File Size Uploaded Provenance Actions
radius_ai_agent_sdk-1.0.0.tar.gz 16.9 kB Without provenance Details for radius_ai_agent_sdk-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for radius-ai-agent-sdk 1.0.0
File Interpreter ABI Platform Actions
radius_ai_agent_sdk-1.0.0-py3-none-any.whl Python 3 none any Details for radius_ai_agent_sdk-1.0.0-py3-none-any.whl

Total release size: 27.7 kB

Release files / radius_ai_agent_sdk-1.0.0.tar.gz

Download URL radius_ai_agent_sdk-1.0.0.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f3ed63f3a52f85c184c5bb91793c3aaa879ce898bcfaf8e42f0c6c0f77abc045
BLAKE2b-256 checksum
How to use checksums
f4d722cf65fd429b8597304d74fc812e0f85f6e74928d02443707f1c68beb978
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release files / radius_ai_agent_sdk-1.0.0-py3-none-any.whl

Download URL radius_ai_agent_sdk-1.0.0-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d605faae034839c4085b80eda8cef2784bba07e6d48b8fad7102486f3fd5a6a
BLAKE2b-256 checksum
How to use checksums
1c1307a41368dee99295e4543452895e3fb3bf7c7ce83b9749db0ea8c3d48e9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Security for radius-ai-agent-sdk 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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