Skip to main content

Python SDK for the Unmanaged Agent API

Project description

Unmanaged Agent Python SDK

Python client for the Unmanaged Agent API.

Install

pip install unmanaged-agent

Usage

from unmanaged_agent import UnmanagedAgentClient

client = UnmanagedAgentClient("http://localhost:8000")

# Create an agent
agent = client.agents.create(
    name="coding-assistant",
    model="claude-sonnet-4-6",
    system_prompt="You are a helpful coding assistant.",
)

# Create an environment
env = client.environments.create(
    name="python-sandbox",
    sandbox_provider="e2b",
    config={"packages": ["python3"]},
)

# Create a session
session = client.sessions.create(
    agent_id=agent.id,
    environment_id=env.id,
    title="My first session",
)

# Send a message and stream the response
for event in client.sessions.send_event(
    session.id,
    type="message",
    content={"text": "Write a hello world script in Python."},
):
    print(event["event"], event["data"])

# Fetch event history
events = client.sessions.list_events(session.id)

Async

import asyncio
from unmanaged_agent import AsyncUnmanagedAgentClient

async def main():
    async with AsyncUnmanagedAgentClient("http://localhost:8000") as client:
        agent = await client.agents.create(
            name="coding-assistant",
            model="claude-sonnet-4-6",
        )

        env = await client.environments.create(
            name="python-sandbox",
            sandbox_provider="e2b",
        )

        session = await client.sessions.create(
            agent_id=agent.id,
            environment_id=env.id,
        )

        async for event in client.sessions.send_event(
            session.id,
            type="message",
            content={"text": "Hello!"},
        ):
            print(event["event"], event["data"])

asyncio.run(main())

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

unmanaged_agent-0.1.0.tar.gz (38.7 kB view details)

Uploaded Source

Built Distribution

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

unmanaged_agent-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: unmanaged_agent-0.1.0.tar.gz
  • Upload date:
  • Size: 38.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for unmanaged_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 114c9c3c82ff565d832c2ca30b09361b2aa14518df62eb4afbb24bbee1f82185
MD5 4ae4f9887db48eea5ef9d02b944a28cb
BLAKE2b-256 e52c78e958b0b89753cf1bd3c4c56731fc60ab7e6abc9f61b520651e2d9a47df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for unmanaged_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2df22df4e303082fe73b7a4e9444e2870c7a7a8c62e27b4a0c2dd2610dad70c3
MD5 0c461e1bcf628e7c4ccc60f036829270
BLAKE2b-256 a7361de39bee8745a71b248912d64ee83778cce2c13c689f90864eecf162d736

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