Datalayer VS Code Extension - v0.0.9
    Preparing search index...
    • Execute code directly on a Datalayer runtime using Jupyter kernel protocol.

      This function:

      1. Creates a WebSocket connection to the runtime
      2. Connects to the default kernel (or starts a new one)
      3. Executes the code using KernelExecutor
      4. Returns standard Jupyter IOutput[] objects

      Parameters

      • runtime: RuntimeDTO

        The runtime to execute code on (must have ingress and token)

      • code: string

        Python code to execute

      Returns Promise<ExecuteCodeResult>

      Promise resolving to execution result with outputs

      const runtime = await strategy.tryConnect({ runtimesTreeProvider });
      const result = await executeOnRuntime(runtime, "print('hello')");
      if (result.success) {
      console.log("Outputs:", result.outputs);
      }