diff options
| author | Xe Iaso <me@xeiaso.net> | 2024-08-27 17:54:42 -0400 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2024-08-27 17:54:42 -0400 |
| commit | 57284a25058002911ee571a576740888b6086313 (patch) | |
| tree | ae863c83e4feb3ba406a75fe4681097510c5e924 /llm/codeinterpreter/python | |
| parent | 374d545192421c08bff8283550525b5fd6600425 (diff) | |
| download | x-57284a25058002911ee571a576740888b6086313.tar.xz x-57284a25058002911ee571a576740888b6086313.zip | |
cmd/mimi: fix tool use
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'llm/codeinterpreter/python')
| -rw-r--r-- | llm/codeinterpreter/python/python.go | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/llm/codeinterpreter/python/python.go b/llm/codeinterpreter/python/python.go index 5f2ac6f..c90d9f6 100644 --- a/llm/codeinterpreter/python/python.go +++ b/llm/codeinterpreter/python/python.go @@ -32,8 +32,11 @@ func init() { } type Result struct { - Stdout string - Stderr string + UserCode string + Stdout string + Stderr string + PlatformError string + Instruction string } func Run(ctx context.Context, tmpDir, userCode string) (*Result, error) { @@ -63,8 +66,11 @@ func Run(ctx context.Context, tmpDir, userCode string) (*Result, error) { mod, err := r.InstantiateModule(ctx, code, config) if err != nil { result := &Result{ - Stdout: fout.String(), - Stderr: ferr.String(), + UserCode: userCode, + Stdout: fout.String(), + Stderr: ferr.String(), + PlatformError: err.Error(), + Instruction: "Include the user code and any stderr or platform errors in code fences.", } return result, err } @@ -72,7 +78,9 @@ func Run(ctx context.Context, tmpDir, userCode string) (*Result, error) { defer mod.Close(ctx) return &Result{ - Stdout: fout.String(), - Stderr: ferr.String(), + UserCode: userCode, + Stdout: fout.String(), + Stderr: ferr.String(), + Instruction: "Include the user code, output, and any stderr or platform errors in code fences.", }, nil } |
