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 personal access token authentication. Set EVERRUNS_API_KEY or pass the token explicitly. For personal access tokens with access to multiple organizations, set EVERRUNS_ORG_ID or pass org_id explicitly:

# From environment
client = Everruns()

Or with an explicit token and organization:

client = Everruns(api_key="evr_pat_...", 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,
)

Workspaces

Workspaces hold files shared across sessions.

workspace = await client.workspaces.create(name="team-docs")

await client.workspace_files.create(
    workspace.id,
    "/notes/welcome.md",
    "# Welcome\n",
    encoding="text",
)
file = await client.workspace_files.read(workspace.id, "/notes/welcome.md")
files = await client.workspace_files.list(workspace.id, recursive=True)

Runnable example: examples/workspaces.py

Memories

Memories are long-term, searchable knowledge stores for agents.

memory = await client.memories.create(name="product-knowledge")

await client.memories.create_file(
    memory.id,
    "/facts/product.md",
    "# Product\n",
    encoding="text",
)
results = await client.memories.grep_files(memory.id, "product")
await client.memories.sync(memory.id)

Runnable example: examples/memories.py

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.10.tar.gz (142.9 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.10-py3-none-any.whl (95.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: everruns_sdk-0.1.10.tar.gz
  • Upload date:
  • Size: 142.9 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.10.tar.gz
Algorithm Hash digest
SHA256 0ed7ee16d3f800cb0d146906631c3e2a689a8d37fd7c077546a3c92a761e86a3
MD5 cdd87c805262e0f5cda53099e2711380
BLAKE2b-256 3741f317355a9cf259d03d93208337667c51b528c45e6e2a9cc4dd8767345c38

See more details on using hashes here.

Provenance

The following attestation bundles were made for everruns_sdk-0.1.10.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.10-py3-none-any.whl.

File metadata

  • Download URL: everruns_sdk-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 95.1 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.10-py3-none-any.whl
Algorithm Hash digest
SHA256 7c60908ebd3a5623c43436ce8abd828402f0c86c160a566472cb2f473947f59e
MD5 57f03b4eb04e834a4577bff55cea4afd
BLAKE2b-256 ca7cabf40027223f4c7db4ad29cd0654bef2717df74a870dcf6cb726428458d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for everruns_sdk-0.1.10-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