Snakepit.Adapters.GenericPython (snakepit v0.1.2)

Generic Python adapter for Snakepit.

This adapter provides a simple, framework-agnostic bridge to Python without any external ML dependencies. It's useful for:

  • Testing the Snakepit infrastructure
  • Simple computational tasks
  • As a template for building your own adapters

Supported Commands

  • ping - Health check and basic info
  • echo - Echo arguments back (useful for testing)
  • compute - Simple math operations (add, subtract, multiply, divide)
  • info - Bridge and system information

Configuration

config :snakepit,
  adapter_module: Snakepit.Adapters.GenericPython

Usage Examples

# Health check
{:ok, result} = Snakepit.execute("ping", %{test: true})

# Echo test
{:ok, result} = Snakepit.execute("echo", %{message: "hello"})

# Simple computation
{:ok, result} = Snakepit.execute("compute", %{
  operation: "add",
  a: 5, 
  b: 3
})

# Get bridge info
{:ok, result} = Snakepit.execute("info", %{})