panic: runtime error: index out of range [0] with length 0
goroutine 558 [running]:
github.com/jxnl/instructor-go/pkg/instructor/providers/openai.(*InstructorOpenAI).chatJSONSchema(0xacbba1b4eb0, {0x5d72b98, 0xacbba53e300}, 0xacbba923ac0, 0xacbba53ec60)
/go/pkg/mod/github.com/jxnl/instructor-go@v0.0.0-20260514165551-41cc01d2bd2f/pkg/instructor/providers/openai/chat.go:242 +0x687
github.com/jxnl/instructor-go/pkg/instructor/providers/openai.(*InstructorOpenAI).InternalChat(0xacbba1b4eb0, {0x5d72b98, 0xacbba53e300}, {0x32bcb20, 0xacbba7861a0}, 0xacbba53ec60)
/go/pkg/mod/github.com/jxnl/instructor-go@v0.0.0-20260514165551-41cc01d2bd2f/pkg/instructor/providers/openai/chat.go:88 +0x9fd
github.com/jxnl/instructor-go/pkg/instructor/core.ChatHandler({0x5d83ee8, 0xacbba1b4eb0}, {0x5d72b98, 0xacbba53e300}, {0x32bcb20, 0xacbba7861a0}, {0x2eecc80, 0xacbb9cb02e0})
/go/pkg/mod/github.com/jxnl/instructor-go@v0.0.0-20260514165551-41cc01d2bd2f/pkg/instructor/core/chat.go:135 +0x96f
github.com/jxnl/instructor-go/pkg/instructor/providers/openai.(*InstructorOpenAI).CreateChatCompletion(_, {_, _}, {{0xacbba431ee0, 0xd}, {0xacbba1b8500, 0x2, 0x2}, 0x0, 0x0, ...}, ...)
/go/pkg/mod/github.com/jxnl/instructor-go@v0.0.0-20260514165551-41cc01d2bd2f/pkg/instructor/providers/openai/chat.go:28 +0x105
github.com/pancsta/secai.(*Prompt[...]).execProvider(0x5d9b7c0, {0x5d72b98, 0xacbba53e300}, 0xacbba4a9d80, 0xacbba270380)
/workspace/jetbrains/am/opensource/secai/secai.go:412 +0x40c
github.com/pancsta/secai.(*Prompt[...]).tryProvider(0x5d9b7c0, {0x5d72b98, 0xacbba53e300}, 0xacbba4a9d80, {{{0xacbbac463e0, 0x20}, {0xacbbaa4c000, 0x5a}, {0xacbbab1c0b0, 0xb0}}})
/workspace/jetbrains/am/opensource/secai/secai.go:334 +0xd91
github.com/pancsta/secai.(*Prompt[...]).Exec(0x5d9b7c0, 0xacbba7d9500, {{{0xacbbac463e0, 0x20}, {0xacbbaa4c000, 0x5a}, {0xacbbab1c0b0, 0xb0}}}, {0x0, 0x0, ...})
/workspace/jetbrains/am/opensource/secai/secai.go:236 +0x965
github.com/pancsta/secai/examples/cook.(*Agent).GenStepsState.func1()
/workspace/jetbrains/am/opensource/secai/examples/cook/genai_cook.go:249 +0x316
github.com/pancsta/asyncmachine-go/pkg/machine.(*Machine).Go.func1()
/workspace/jetbrains/am/opensource/asyncmachine-go/pkg/machine/machine.go:3608 +0xc2
created by github.com/pancsta/asyncmachine-go/pkg/machine.(*Machine).Go in goroutine 86
/workspace/jetbrains/am/opensource/asyncmachine-go/pkg/machine/machine.go:3602 +0xdc
OpenAI using
instr.WithMode(instr.ModeJSONSchema). The length should be checked.