Skip to main content

HTTP client and sandbox backend for AstraForge DeepAgent.

Project description

AstraForge Toolkit

Lightweight Python package for using AstraForge DeepAgent and sandboxes from another project.

Contents:

  • astraforge_toolkit.SandboxBackend: DeepAgents backend that executes via the remote AstraForge sandbox API.
  • astraforge_toolkit.DeepAgentClient: HTTP client for DeepAgent conversations and streaming replies.
  • Remote sandbox tools: sandbox_shell, sandbox_python_repl, sandbox_open_url_with_playwright, sandbox_view_image — all execute inside the sandbox via HTTP.

Install

pip install astraforge-toolkit

Quick start

Create a sandbox-backed DeepAgent

from deepagents import create_deep_agent
from langchain_openai import ChatOpenAI
from astraforge_toolkit import (
    SandboxBackend,
    sandbox_shell,
    sandbox_python_repl,
    sandbox_open_url_with_playwright,
    sandbox_view_image,
)

def backend_factory(rt):
    return SandboxBackend(
        rt,
        base_url="https://your.astra.forge/api",
        api_key="your-api-key",
        # optional: session_params={"image": "astraforge/codex-cli:latest"},
    )

model = ChatOpenAI(model="gpt-4o", api_key="...")
agent = create_deep_agent(model=model, backend=backend_factory)

# Optional: register sandbox tools with your agent/tool registry
tools = [sandbox_shell, sandbox_python_repl, sandbox_open_url_with_playwright, sandbox_view_image]

Call DeepAgent over HTTP

from astraforge_toolkit import DeepAgentClient

client = DeepAgentClient(base_url="https://your.astra.forge/api", api_key="your-api-key")
conv = client.create_conversation()

for chunk in client.stream_message(conv.conversation_id, "Hello, sandbox!"):
    print(chunk)

Build & publish

cd astraforge-python-package
python -m build
python -m twine upload dist/*  # or use --repository testpypi

Configure ~/.pypirc or set TWINE_USERNAME=__token__ and TWINE_PASSWORD=<pypi-token> for uploads.

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

astraforge_toolkit-0.1.2.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

astraforge_toolkit-0.1.2-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file astraforge_toolkit-0.1.2.tar.gz.

File metadata

  • Download URL: astraforge_toolkit-0.1.2.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.10

File hashes

Hashes for astraforge_toolkit-0.1.2.tar.gz
Algorithm Hash digest
SHA256 56de48dc9ace4f823828125d730444acb64d257579e35faa5fc55af7c1caa274
MD5 ed9e2b56de95c96e42b41ca52c0dbbee
BLAKE2b-256 a723e01a5d01ae357a5dcfd55fb30f0e020422582941887faf9be2b843566071

See more details on using hashes here.

File details

Details for the file astraforge_toolkit-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for astraforge_toolkit-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9639b6b4b7bc08c2fdeb016fcffc4784b9bd8325e8c044444b8156a2b3ee490a
MD5 efc47b63b83cc14665832200d68263b4
BLAKE2b-256 84d423d1886175c08e607878b6d2bcad00214e2c336eb2b79162ea58081900bc

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