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_sandbox_backend.SandboxBackend: DeepAgents backend that executes via the remote AstraForge sandbox API.
  • astraforge_sandbox_backend.DeepAgentClient: HTTP client for DeepAgent conversations and streaming replies.

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_sandbox_backend import SandboxBackend

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)

Call DeepAgent over HTTP

from astraforge_sandbox_backend 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.1.tar.gz (5.7 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.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: astraforge_toolkit-0.1.1.tar.gz
  • Upload date:
  • Size: 5.7 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.1.tar.gz
Algorithm Hash digest
SHA256 62cf373de5971efb6c7b6db2c481cc8fcfab416fc7210efb328ed0f46a6c1b10
MD5 dd3e0ffde6015fcf2c2ea3a127756138
BLAKE2b-256 bb6a14afe5f497ccbc48fe9db420a41c525471c0f78d3dcc231d4364c5ff6b83

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for astraforge_toolkit-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f1a846b359dcde76c048b7cecb8897993981bbd9ed43c2617c1d2c1e9324a97
MD5 dec3a7cd62d19b06e256341c007d907c
BLAKE2b-256 d9684217c6e6a384cdbe3a16622428219ee24f3c193b0a437e582f29b685889c

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