gptscript-ai/gptscript

Getting a panic error when attempting to use the runner as a library

Closed this issue · 2 comments

I am not sure if this is intentional but I've tried to use gptscript as a library to run my scripts and I always get the following error:

panic: runtime error: slice bounds out of range [:-1]

goroutine 1 [running]:
github.com/gptscript-ai/gptscript/pkg/mvl.Package()
	/Users/hectorfernandez/go/pkg/mod/github.com/gptscript-ai/gptscript@v0.1.1/pkg/mvl/log.go:51 +0x108
github.com/gptscript-ai/gptscript/pkg/builtin.init()
	/Users/hectorfernandez/go/pkg/mod/github.com/gptscript-ai/gptscript@v0.1.1/pkg/builtin/log.go:5 +0x24
FAIL	github.com/chainguard-dev/infra-images/wolfi-bump/pkg/gptscript/gptscript	0.287s

@hectorj2f thanks for reporting the issue!

It looks like this panic was fixed in main with #6126d27, which is also in v0.1.4 (currently the latest release tag).

Bumping the module version should resolve the issue. If it doesn't, or you run into any other issues trying to use the gptscript's packages directly, please let us know.

Thanks @njhale!