Skip to main content

Sprites sandbox provider for the OpenAI Agents SDK

Project description

Sprites for OpenAI Agents

sprites-openai-agents connects Sprites to the OpenAI Agents SDK sandbox interface. It is maintained by the Sprites team and shipped separately so both sprites-py and openai-agents remain provider-agnostic.

[!NOTE] The OpenAI Agents SDK sandbox APIs are currently beta. Until they stabilize, each adapter release supports a deliberately narrow SDK version range.

Installation

pip install sprites-openai-agents

Set the credentials used by the SDKs:

export OPENAI_API_KEY=...
export SPRITES_API_TOKEN=...

Usage

from agents.run import RunConfig
from agents.sandbox import SandboxAgent, SandboxRunConfig
from sprites_openai_agents import SpritesSandboxClient

client = SpritesSandboxClient()
sandbox = await client.create()

agent = SandboxAgent(
    name="Sprite assistant",
    instructions="Inspect the workspace and complete the requested task.",
)
run_config = RunConfig(sandbox=SandboxRunConfig(session=sandbox))

async with sandbox:
    # Pass agent and run_config to Runner.run(...) or Runner.run_streamed(...).
    ...

By default, the client creates an ephemeral sprite and deletes it when the session is cleaned up. To attach to an existing sprite:

from sprites_openai_agents import SpritesSandboxClientOptions

sandbox = await client.create(
    options=SpritesSandboxClientOptions(sprite_name="my-sprite"),
)

Development

From the repository root:

python -m pip install -e .
python -m pip install -e 'integrations/openai-agents[dev]'
python -m pytest integrations/openai-agents/tests
python -m ruff check --config integrations/openai-agents/pyproject.toml integrations/openai-agents
python -m mypy --config-file integrations/openai-agents/pyproject.toml integrations/openai-agents/src
python -m build integrations/openai-agents

The adapter may use public agents.sandbox modules but must not import its old in-tree location under agents.extensions.sandbox.sprites.

Compatibility policy

The adapter imports OpenAI Agents symbols from their shortest documented public path. A few provider primitives—PTY helpers, runtime helper scripts, workspace path utilities, materialization types, and provider-facing errors—are documented as modules but are not re-exported from agents.sandbox; those imports therefore remain module-qualified. The upper bound on openai-agents prevents an untested SDK minor release from silently changing those beta sandbox interfaces.

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

sprites_openai_agents-0.1.0.tar.gz (41.6 kB view details)

Uploaded Source

Built Distribution

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

sprites_openai_agents-0.1.0-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file sprites_openai_agents-0.1.0.tar.gz.

File metadata

  • Download URL: sprites_openai_agents-0.1.0.tar.gz
  • Upload date:
  • Size: 41.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for sprites_openai_agents-0.1.0.tar.gz
Algorithm Hash digest
SHA256 80d80b9e90ce55ab40ea564ba1161db0726a0feed88e8d1d4c9685b28ef35b1f
MD5 024fa50a2f53ff8ddacc45af90cbc8f3
BLAKE2b-256 ccf4da41cec0a7c46e5fcb8e66f5d7f44a886217dff5a6e40cdab12dd9b590b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for sprites_openai_agents-0.1.0.tar.gz:

Publisher: publish-openai-agents.yml on superfly/sprites-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sprites_openai_agents-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sprites_openai_agents-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16524e08b765305018be9f624e8c59f7f013f2f42c89522442deb2989433a7ec
MD5 e2f6f417c7eaca14ab174673110db6e2
BLAKE2b-256 d4d0731152a35fdbb46ad1d2bb77f72ff6db6f22e06fcc8216b30ab8f3acee99

See more details on using hashes here.

Provenance

The following attestation bundles were made for sprites_openai_agents-0.1.0-py3-none-any.whl:

Publisher: publish-openai-agents.yml on superfly/sprites-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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