python

package
v0.0.0-...-a40ddb2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Python tool to execute code in a docker container

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{TimeSeconds: 120, MemoryBytes: 1024 * 1024 * 1024, OutputBytes: 10000}

Functions

This section is empty.

Types

type Config

type Config struct {
	TimeSeconds int
	MemoryBytes int
	OutputBytes int
}

Limits for python code execution.

type Python

type Python struct {
	// contains filtered or unexported fields
}

Python tool - implements the api.ToolFunction interface

func New

func New(config ...Config) *Python

Create a new python tool. Uses DefaultConfig if config is omitted.

func (*Python) Call

func (c *Python) Call(input string) (code, resp string, err error)

Execute python code within container with time limit

func (*Python) Definition

func (c *Python) Definition() shared.FunctionDefinitionParam

Provide definition for model prompt

func (*Python) Stop

func (c *Python) Stop()

Stop current container if running

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL