Skip to main content

Code Interpreter SDK for Watasu

Project description

Watasu Code Interpreter Python SDK

Python package for Watasu code interpreter sandboxes.

Install

pip install watasu-code-interpreter

Set WATASU_API_KEY before using the SDK.

Usage

from watasu_code_interpreter import Sandbox

with Sandbox.create() as sbx:
    context = sbx.create_code_context()
    execution = sbx.run_code(
        "print('hello')\n2 + 3",
        context=context,
        on_stdout=lambda message: print(message.line),
    )

    print(execution.text)
    sbx.remove_code_context(context)

Sandbox.create() starts the code-interpreter template by default. Code runs in persistent contexts and returns structured results, logs, and error fields for each execution.

The package installs watasu and exposes the watasu_code_interpreter import path.

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

watasu_code_interpreter-0.1.48.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

watasu_code_interpreter-0.1.48-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file watasu_code_interpreter-0.1.48.tar.gz.

File metadata

File hashes

Hashes for watasu_code_interpreter-0.1.48.tar.gz
Algorithm Hash digest
SHA256 f56f66b6fd7390e6d1492f03ae7b5092f0478dc788f9bc1481e7447349f48211
MD5 3bfe8bde1f83c2658a5997d272f5644d
BLAKE2b-256 b6df19010936aa38d7afd7ff60ff0a2c9acbce2f06977f31c8e543cce4b4d770

See more details on using hashes here.

File details

Details for the file watasu_code_interpreter-0.1.48-py3-none-any.whl.

File metadata

File hashes

Hashes for watasu_code_interpreter-0.1.48-py3-none-any.whl
Algorithm Hash digest
SHA256 9fb38e81c57afbea0b2b0232e1ff289732b59cbe239330a14fd6ad0957f26c1d
MD5 caac5e95a73e93abd228bd60bbe165a3
BLAKE2b-256 b3b5d44c8a01f6100982b2a4e5d2dcdb8ac8f2acfc0ace511e01ebf9dc46f1e1

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