Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

agentrux-agent-tools

Beta -- API may change before 1.0.

Framework-agnostic AI agent toolkit for AgenTrux. Exposes publish/subscribe/read operations as tool definitions compatible with OpenAI function calling, Anthropic tool_use, and any other LLM framework.

Installation

pip install agentrux-agent-tools

Or install from source:

cd plugins/agent-sdk
pip install -e .

Quick Start

1. Create the toolkit

import asyncio
from agentrux_agent_tools import AgenTruxToolkit

async def main():
    toolkit = await AgenTruxToolkit.create(
        base_url="https://api.agentrux.com",
        script_id="your-script-id",
        client_secret="your-client-secret",
    )
    # Or use environment variables:
    # export AGENTRUX_BASE_URL=https://api.agentrux.com
    # export AGENTRUX_SCRIPT_ID=...
    # export AGENTRUX_CLIENT_SECRET=...
    # toolkit = await AgenTruxToolkit.create()

2. Get tool definitions

    # OpenAI format
    tools = toolkit.get_tools()

    # Anthropic format
    tools = toolkit.get_tools_anthropic()

3. Execute tool calls from the LLM

    result = await toolkit.execute("publish_event", {
        "topic_id": "550e8400-e29b-41d4-a716-446655440000",
        "event_type": "chat.message",
        "payload": {"text": "Hello from the agent!"},
    })
    print(result)  # JSON string with event_id

Usage with OpenAI

import openai
from agentrux_agent_tools import AgenTruxToolkit

async def agent_loop():
    toolkit = await AgenTruxToolkit.create()
    client = openai.AsyncOpenAI()

    messages = [{"role": "user", "content": "Publish a greeting event"}]

    response = await client.chat.completions.create(
        model="gpt-4o",
        messages=messages,
        tools=toolkit.get_tools(),
    )

    for tool_call in response.choices[0].message.tool_calls or []:
        import json
        args = json.loads(tool_call.function.arguments)
        result = await toolkit.execute(tool_call.function.name, args)
        messages.append(response.choices[0].message)
        messages.append({
            "role": "tool",
            "tool_call_id": tool_call.id,
            "content": result,
        })

    # Continue the conversation with tool results...
    await toolkit.close()

Usage with Claude (Anthropic)

import anthropic
from agentrux_agent_tools import AgenTruxToolkit

async def agent_loop():
    toolkit = await AgenTruxToolkit.create()
    client = anthropic.AsyncAnthropic()

    response = await client.messages.create(
        model="claude-sonnet-4-20250514",
        max_tokens=1024,
        tools=toolkit.get_tools_anthropic(),
        messages=[{"role": "user", "content": "List recent events from my topic"}],
    )

    for block in response.content:
        if block.type == "tool_use":
            result = await toolkit.execute(block.name, block.input)
            # Send result back as tool_result...

    await toolkit.close()

Generic Agent Loop

import json
from agentrux_agent_tools import AgenTruxToolkit

async def generic_agent(llm_call, user_prompt: str):
    """Works with any LLM that supports function calling."""
    async with await AgenTruxToolkit.create() as toolkit:
        tools = toolkit.get_tools()
        messages = [{"role": "user", "content": user_prompt}]

        while True:
            response = await llm_call(messages, tools=tools)

            if not response.tool_calls:
                return response.text

            for call in response.tool_calls:
                result = await toolkit.execute(call.name, call.arguments)
                messages.append({"role": "tool", "content": result})

Available Tools

Tool Description
publish_event Publish a JSON event to a topic. Returns the event_id.
list_events List recent events with optional type filter.
get_event Retrieve a single event by ID.
wait_for_event Wait for the next event via SSE (with timeout).

Environment Variables

Variable Description
AGENTRUX_BASE_URL Server URL
AGENTRUX_SCRIPT_ID Script identifier
AGENTRUX_CLIENT_SECRET Client Secret
AGENTRUX_INVITE_CODE Optional invite code for cross-Alias (cross-account) access

Metadata

Release files for agentrux-agent-tools 0.4.0b1

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

Source distribution (sdist)

Source distribution for agentrux-agent-tools 0.4.0b1
File Size Uploaded Provenance
agentrux_agent_tools-0.4.0b1.tar.gz 19.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agentrux-agent-tools 0.4.0b1
File Interpreter ABI Platform
agentrux_agent_tools-0.4.0b1-py3-none-any.whl Python 3 none any Details

Total release size: 38.4 kB

Release files / agentrux_agent_tools-0.4.0b1.tar.gz

Download URL agentrux_agent_tools-0.4.0b1.tar.gz
Size 19.6 kB
Tags Source
SHA-256 checksum
How to use checksums
195821b5d9834d80a6d40c9b58d945c1680f31ca0edab44f8b8ccf75e5441858
BLAKE2b-256 checksum
How to use checksums
947e40684dcbbff55383fd99e7a6034e090053d198600a870cd18dcbc88dc123
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / agentrux_agent_tools-0.4.0b1-py3-none-any.whl

Download URL agentrux_agent_tools-0.4.0b1-py3-none-any.whl
Size 18.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61dfa429f09d9e6dfcf5c34341e354866059e8506e116a75a64feea5d247d6f8
BLAKE2b-256 checksum
How to use checksums
b43fc41609f6639732c0feb9c662046da0c6922a3d23ada8ed93b208e3460828
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for agentrux-agent-tools 0.4.0b1

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.

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