Python SDK

Python SDK

Send decision requests from your Python agent system

Download

Installation


  pip install noxy-sdk==2.0.1
  
Code

Quick Start


  from noxy import (
    NoxyHumanDecisionOutcome,
    init_noxy_agent_client,
    NoxyConfig,
  )
  
  client = init_noxy_agent_client(
      NoxyConfig(
          endpoint="https://relay.noxy.network",
          auth_token="your-api-token",
          decision_ttl_seconds=3600,
      )
  )
  
  resolution = client.send_decision_and_wait_for_outcome(
      "0x...",
      {
          "kind": "propose_tool_call",
          "tool": "transfer_funds",
          "args": { "to": "__your-burn-address__", "amountWei": "1" },
          "title": "Transfer 1 wei to the burn address",
          "summary": "The agent is requesting approval to send 1 wei to the burn address.",
      },
  )
  
  if resolution.outcome == NoxyHumanDecisionOutcome.APPROVED:
      # your agent should run the proposed action
  else:
      # your agent should abort the proposed action