Page cover

Python Wrapper

The JuliaOS Python Wrapper provides a comprehensive Python interface to the JuliaOS backend. It allows you to create and manage agents, swarms, wallets, and more from Python applications.

Installation

pip install -e /path/to/JuliaOS/packages/python-wrapper

For additional features, you can install optional dependencies:

# With LLM support
pip install -e /path/to/JuliaOS/packages/python-wrapper[llm]

# With Google ADK support
pip install -e /path/to/JuliaOS/packages/python-wrapper[adk]

# With development tools
pip install -e /path/to/JuliaOS/packages/python-wrapper[dev]

Overview

The Python wrapper connects to the Julia backend through a WebSocket bridge and provides an async/await-based API for interacting with JuliaOS. It includes support for:

  • Creating and managing agents

  • Creating and managing swarms

  • Wallet management

  • Blockchain integration

  • Storage operations

  • LangChain integration

  • NumPy integration for scientific computing and optimization

  • Async context manager support for cleaner code

  • Comprehensive swarm algorithm implementations (DE, PSO, GWO, ACO, GA, WOA, DEPSO)

Basic Usage

Agents

The agents module provides classes and functions for creating and managing agents:

Swarms

The swarms module provides classes and functions for creating and managing swarms:

Specialized Agent Types

The Python wrapper supports specialized agent types:

Trading Agents

Research Agents

Dev Agents

NumPy Integration

The Python wrapper provides seamless integration with NumPy for scientific computing and optimization:

The NumPy integration provides the following utilities:

  • numpy_objective_wrapper: Wraps a NumPy-based objective function to make it compatible with JuliaOS swarm algorithms

  • numpy_bounds_converter: Converts NumPy-style bounds to JuliaOS-compatible bounds

  • numpy_result_converter: Converts JuliaOS optimization results to include NumPy arrays

LangChain Integration

The Python wrapper includes integration with LangChain:

Error Handling

The Python wrapper includes robust error handling:

See Also

  • LangChain Integration - Learn more about integrating JuliaOS with LangChain

  • Agents - Learn more about agents in JuliaOS

  • Swarms - Learn more about swarms in JuliaOS

  • API Reference - Detailed API reference for the Python wrapper

  • NumPy Documentationarrow-up-right - Official NumPy documentation