Skip to main content

Python SDK for Everruns API

Project description

Everruns SDK for Python

Python SDK for the Everruns API.

Installation

pip install everruns-sdk

Quick Start

import asyncio
from everruns_sdk import Everruns

async def main():
    # Uses EVERRUNS_API_KEY and optional EVERRUNS_ORG_ID environment variables
    client = Everruns()
    
    # Create an agent
    agent = await client.agents.create(
        name="Assistant",
        system_prompt="You are a helpful assistant.",
    )
    
    # Create a session
    session = await client.sessions.create(agent_id=agent.id)
    
    # Send a message
    await client.messages.create(session.id, "Hello!")
    
    # Stream events
    async for event in client.events.stream(session.id):
        if event.type == "output.message.completed":
            print(event.data)
            break
    
    await client.close()

asyncio.run(main())

Initial Files

from everruns_sdk import Everruns, InitialFile

client = Everruns()

session = await client.sessions.create(
    agent_id="agent_...",
    initial_files=[
        InitialFile(
            path="/workspace/README.md",
            content="# Demo Project\n",
            encoding="text",
            is_readonly=True,
        ),
        InitialFile(
            path="/workspace/src/app.py",
            content='print("hello")\n',
            encoding="text",
        ),
    ],
)

Runnable example: examples/initial_files.py

Authentication

The SDK uses API key authentication. Set EVERRUNS_API_KEY or pass the key explicitly. For API keys with access to multiple organizations, set EVERRUNS_ORG_ID or pass org_id explicitly:

# From environment
client = Everruns()

# Explicit key and organization
client = Everruns(api_key="evr_...", org_id="org_...")

Agent Versions

version = await client.agents.create_version(
    "agent_...",
    change_kind="manual",
    summary="Baseline",
)

versions = await client.agents.list_versions("agent_...")
diff = await client.agents.diff_versions("agent_...", "agentver_1", version.id)
fork = await client.agents.fork_version(
    "agent_...",
    version.id,
    name="forked-agent",
)
rollback = await client.agents.rollback_version(
    "agent_...",
    version.id,
    save_version=True,
)

License

MIT

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

everruns_sdk-0.1.9.tar.gz (91.3 kB view details)

Uploaded Source

Built Distribution

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

everruns_sdk-0.1.9-py3-none-any.whl (46.3 kB view details)

Uploaded Python 3

File details

Details for the file everruns_sdk-0.1.9.tar.gz.

File metadata

  • Download URL: everruns_sdk-0.1.9.tar.gz
  • Upload date:
  • Size: 91.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for everruns_sdk-0.1.9.tar.gz
Algorithm Hash digest
SHA256 4f390ea315960b8ce1bb37776c8e0e6bb5087ae6f40e694c5f4f351058fe0426
MD5 c67e2c122ad58e91c51bdbbf7c9f0fee
BLAKE2b-256 209b3de93b247b193a31eaccef0ce27f0ebc6f7e9fc79406d88fe2f4b6e564e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for everruns_sdk-0.1.9.tar.gz:

Publisher: publish.yml on everruns/sdk

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

File details

Details for the file everruns_sdk-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: everruns_sdk-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 46.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for everruns_sdk-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c29a30aad38c7ca6833c1d27c8b778b8fa3171a6be746f17fb1b7acda628aa5e
MD5 a05a536a051cb96617379fecd55734b1
BLAKE2b-256 e4b1dbe4284642bcd1125f8def7778980a659589b918ee3d80a28899d76c98b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for everruns_sdk-0.1.9-py3-none-any.whl:

Publisher: publish.yml on everruns/sdk

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