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.52.tar.gz (7.1 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.52-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for watasu_code_interpreter-0.1.52.tar.gz
Algorithm Hash digest
SHA256 115ed03905ef87d1ed2d08a57d0c681add6c24c113730afc02dac11045e0df42
MD5 36e7f784205e0d86272b166263af2c55
BLAKE2b-256 9efd6495ca2a4a374f488af253bac5ca2e7a118971f27d2828a13f9b86209daf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for watasu_code_interpreter-0.1.52-py3-none-any.whl
Algorithm Hash digest
SHA256 858bc2b1401dafc6e5c5fc488c211b4789d03c747eda835b0b7e9811cfbe1496
MD5 f2a0b7368f50a3235f10f47a82a3e1f5
BLAKE2b-256 e01d2e99af0c899134aab4f02746d5552ef6dd2b79c3edb3aa52ddf5923ef4a8

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