Skip to main content

Python SDK for Boring-OS tool orchestration platform

Project description

Boring-OS Python SDK

Python SDK for the Boring-OS tool orchestration platform. Provides native access to tools and seamless integration with popular AI agent frameworks.

Installation

# Core SDK
pip install boring-os

# With framework adapters
pip install boring-os[langchain]   # LangChain support
pip install boring-os[adk]         # Google ADK support
pip install boring-os[bedrock]     # AWS Bedrock support
pip install boring-os[openai]      # OpenAI support
pip install boring-os[all]         # All adapters

Quick Start

from boring_os import BoringOS

# Initialize client
client = BoringOS(
    base_url="http://localhost:8080",
    api_key="bos_dev_key_for_local_testing"
)

# Call a tool synchronously (recommended for agents)
result = client.tools.call("get_customer_profile", customer_id="cust_123")
print(result)
# {'customer_id': 'cust_123', 'name': 'John Smith', ...}

# List available tools
tools = client.tools.list()
for tool in tools.tools:
    print(f"{tool.name}: {tool.description}")

Async Usage

import asyncio
from boring_os import BoringOS

async def main():
    async with BoringOS(api_key="...") as client:
        # Concurrent tool calls
        results = await asyncio.gather(
            client.tools.call_async("get_customer_profile", customer_id="123"),
            client.tools.call_async("get_billing_details", customer_id="123"),
        )
        print(results)

asyncio.run(main())

Framework Integrations

LangChain

from boring_os import BoringOS
from boring_os.adapters.langchain import get_langchain_tools

client = BoringOS(api_key="...")
tools = get_langchain_tools(client)

# Use with LangChain agent
from langchain.agents import create_tool_calling_agent
agent = create_tool_calling_agent(llm, tools, prompt)

Google ADK

from boring_os import BoringOS
from boring_os.adapters.adk import BoringOSToolProvider

client = BoringOS(api_key="...")
provider = BoringOSToolProvider(client)

# Use with ADK agent
from google.adk import Agent
agent = Agent(tools=provider.get_tools())

AWS Bedrock

from boring_os import BoringOS
from boring_os.adapters.bedrock import create_action_group_schema, bedrock_handler

client = BoringOS(api_key="...")

# Generate OpenAPI schema for action group
schema = create_action_group_schema(client, tools=["get_customer_profile"])

# Or use Lambda handler decorator
@bedrock_handler(client)
def lambda_handler(event, context):
    pass  # Handled automatically

OpenAI

from boring_os import BoringOS
from boring_os.adapters.openai import get_openai_tools, execute_tool_call

client = BoringOS(api_key="...")
tools = get_openai_tools(client)

# Use with OpenAI
response = openai.chat.completions.create(
    model="gpt-4",
    messages=messages,
    tools=tools
)

# Execute tool calls from response
if response.choices[0].message.tool_calls:
    for tool_call in response.choices[0].message.tool_calls:
        result = execute_tool_call(client, tool_call)

Observability with Opik

The SDK integrates with Opik for comprehensive tracing of all tool calls.

Installation

pip install boring-os[opik]

Basic Tracing

from boring_os import BoringOS

# Enable Opik tracing
client = BoringOS(
    api_key="bos_dev_key_for_local_testing",
    enable_tracing=True,
    opik_project="my-agent",
    opik_use_local=True,  # Use local Opik server
)

# All tool calls are now traced
result = client.tools.call("get_customer_profile", customer_id="123")
# -> Creates span in Opik dashboard at http://localhost:5173

With Comet.com Cloud

from boring_os import BoringOS

# Use Comet cloud for production
client = BoringOS(
    api_key="...",
    enable_tracing=True,
    opik_use_local=False,
    opik_api_key="your-comet-api-key",
    opik_workspace="your-workspace",
)

Manual Span Control

from boring_os import BoringOS
import opik

client = BoringOS(api_key="...", enable_tracing=True)

# Create parent trace for agent workflow
@opik.track(name="agent_workflow")
def handle_request(user_query: str):
    # Child spans auto-nested under parent
    profile = client.tools.call("get_customer_profile", customer_id="123")
    billing = client.tools.call("get_billing_details", customer_id="123")
    return {"profile": profile, "billing": billing}

Running Local Opik Server

# Clone and run Opik
git clone https://github.com/comet-ml/opik.git
cd opik
./opik.sh

# Dashboard available at http://localhost:5173

Error Handling

from boring_os import BoringOS
from boring_os.exceptions import (
    ToolNotFoundError,
    ToolTimeoutError,
    ValidationError,
    RateLimitError,
)

client = BoringOS(api_key="...")

try:
    result = client.tools.call("unknown_tool")
except ToolNotFoundError as e:
    print(f"Tool not found: {e.tool_name}")
except ToolTimeoutError as e:
    print(f"Timed out after {e.timeout_seconds}s")
except ValidationError as e:
    print(f"Invalid params: {e.details}")
except RateLimitError as e:
    print(f"Rate limited, retry after {e.retry_after}s")

License

MIT

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

boring_os-0.1.0.tar.gz (35.3 kB view details)

Uploaded Source

Built Distribution

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

boring_os-0.1.0-py3-none-any.whl (40.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: boring_os-0.1.0.tar.gz
  • Upload date:
  • Size: 35.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.3 cpython/3.14.2 HTTPX/0.28.1

File hashes

Hashes for boring_os-0.1.0.tar.gz
Algorithm Hash digest
SHA256 77f61c98f976cbb602717db12efe11acf3e63e25dfbffdcaf6042de176690362
MD5 366adb9cf8239e985acf56fff5c2bd91
BLAKE2b-256 b93e72192d31be428e3819a9b21be5171c1ff16d193e1fd5b4737cce4679f711

See more details on using hashes here.

File details

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

File metadata

  • Download URL: boring_os-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 40.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.3 cpython/3.14.2 HTTPX/0.28.1

File hashes

Hashes for boring_os-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d814d3a0b1550140d88e54929eb6a09a8199aa64f40c038f9c5efed398fcf62
MD5 c28a54bef5293752c55e418a236f20ed
BLAKE2b-256 039d9967b74e7a21c9f71fad04416bca073aca3b47e9e22b4b642d468beb5a42

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