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

Error: executing vim.schedule lua callback: ...colorscheme/lua/text-to-colorscheme/internal/asserts.lua:7: [text-to-colorscheme] Assert hit! #5

Open
nyngwang opened this issue Jun 16, 2023 · 3 comments

Comments

@nyngwang
Copy link

nyngwang commented Jun 16, 2023

Error executing vim.schedule lua callback: ...colorscheme/lua/text-to-colorscheme/internal/asserts.lua:7: [text-to-colorscheme] Assert hit!
stack traceback:
	[C]: in function 'error'
	...colorscheme/lua/text-to-colorscheme/internal/asserts.lua:7: in function '_raise'
	...colorscheme/lua/text-to-colorscheme/internal/asserts.lua:19: in function 'that'
	...-colorscheme/lua/text-to-colorscheme/internal/openai.lua:203: in function 'onexit'
	...-colorscheme/lua/text-to-colorscheme/internal/openai.lua:231: in function <...-colorscheme/lua/text-to-colorscheme/internal/openai.lua:230>

my query: bg=16161d;greytext;orangekeyword;bluestring.

@svermeulen
Copy link
Owner

I wasn't able to reproduce this when using gpt-4, but do see it now when I switch to one of the gpt-3.5 models. So not sure what we can do about this. I did at least add some a more helpful error message when this does happen, so you can see what is invalid in the response now

@nyngwang
Copy link
Author

Now the error becomes

Error executing vim.schedule lua callback: ...colorscheme/lua/text-to-colorscheme/internal/asserts.lua:9: [text-to-colorscheme] Received unexpected response from OpenAI:
return {
  background = "#161616",
  foreground = "#d9d9d9",
  accents = {
     "#76b900",
     "#0066cc",
  },
}
stack traceback:
	
[C]: in function 'error'
	
...colorscheme/lua/text-to-colorscheme/internal/asserts.lua:9: in function '_raise'
	
...colorscheme/lua/text-to-colorscheme/internal/asserts.lua:19: in function 'that'
	
...-colorscheme/lua/text-to-colorscheme/internal/openai.lua:221: in function 'onexit'
	
...-colorscheme/lua/text-to-colorscheme/internal/openai.lua:249: in function <...-colorscheme/lua/text-to-colorscheme/internal/openai.lua:248>

@svermeulen
Copy link
Owner

Looks like openai didn't understand the instructions correctly, and returned only 2 accent colors instead of 7

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

No branches or pull requests

2 participants