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.66.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.66-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for watasu_code_interpreter-0.1.66.tar.gz
Algorithm Hash digest
SHA256 0d7f340f5608476af83b9ea6846b92fa33bc864102e3d90f71d5d02cf5b1fda7
MD5 aec3eda72dd62731800844b3bee05eaf
BLAKE2b-256 e6acbf61835b18dd5702456718d468308915690fe410d5fd6bea05f7f3bb4da2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for watasu_code_interpreter-0.1.66-py3-none-any.whl
Algorithm Hash digest
SHA256 5f1f5978f2ab7773723f7487d1de49d78e0978b0e4866633bc12b45170e9b54b
MD5 eb88218849f7ed4857d3f9f530b92881
BLAKE2b-256 4b932e40a22540f255cccf786214d48123a931e12e3252d6ab57a280671625ab

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