Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic: runtime error: index out of range [0] with length 0 #16

Closed
tkawachi opened this issue Mar 11, 2023 · 0 comments · Fixed by #17
Closed

panic: runtime error: index out of range [0] with length 0 #16

tkawachi opened this issue Mar 11, 2023 · 0 comments · Fixed by #17

Comments

@tkawachi
Copy link
Owner

goroutine 1 [running]:
main.streamCompletion(0x0?, {{0x70a77a, 0xd}, {0xc0000c01e0, 0x1, 0x1}, 0x1f4, 0x3f000000, 0x0, 0x0, ...}, ...)
        /home/kawachi/ghq/github.com/tkawachi/aichat/aichat.go:44 +0x379
main.(*AIChat).stdChatLoop(0xc000193d90)
        /home/kawachi/ghq/github.com/tkawachi/aichat/aichat.go:90 +0x3bf
main.main()
        /home/kawachi/ghq/github.com/tkawachi/aichat/aichat.go:157 +0x6e5
tkawachi added a commit that referenced this issue Mar 11, 2023
This commit adds an error handling for empty response in the AI chatbot.
If the response from the server does not contain any choices, the program will return an error message.

Fixes #16
@mergify mergify bot closed this as completed in #17 Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant