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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for watasu_code_interpreter-0.1.68.tar.gz
Algorithm Hash digest
SHA256 ce55badeab2c0cb6098bae4e9a1718cabd999cb0e082de5bb446bf376d6eb6ba
MD5 724b31f2c212de788611af99d0f41fed
BLAKE2b-256 6e2b9b0f3e094a1b2524127ac494aa460079f705d9e802a525918b3e62bc0cde

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for watasu_code_interpreter-0.1.68-py3-none-any.whl
Algorithm Hash digest
SHA256 c173556e8000762229b384a7492a81df0fc63feec25933d258e9c9b36fd6b48d
MD5 36a00931069acdf17c9c6a22d669d767
BLAKE2b-256 0990a2a96460dd7d9b7bfd9313347b7d175d26da407fe916cedaea4e13363925

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