CodeGPT icon indicating copy to clipboard operation
CodeGPT copied to clipboard

field messages is required when using code completion

Open dvdcjw opened this issue 1 year ago • 3 comments

What happened?

an error :field messages is required" occured when using code completion on a custom openai 20240711173521558

Relevant log output or stack trace

CodeGPT
field messages is required (request id:
20240711173509677817336G6FsrA8p)

Steps to reproduce

I used custom openai and turned on the "enable code completions"

CodeGPT version

1.16.0

Operating System

Windows

dvdcjw avatar Jul 11 '24 09:07 dvdcjw

It looks like the LLM you're trying to use does not support text completions. As the error indicates, the field messages is required, which is typically used only for chat completions.

Without more information, I'm unfortunately unable to provide further help.

carlrobertoh avatar Jul 12 '24 09:07 carlrobertoh

I also meet this problem. I think this problem may come from the $SUFFIX and $PREFIX. image

GThinkAndWise avatar Jul 13 '24 06:07 GThinkAndWise

It sounds like you're using the /chat/completions api instead of the default /completions.

  • /chat/completions requires a messages entry, and ignores prompt and suffix.
  • /completions requires prompt, supports suffix for gpt-3.5-turbo-instruct, and ignores messages.

Since it sounds like you've changed the default configuration; can you tell us what your config you are using? Which model are you using, and how are you sending $PREFIX and $SUFFIX? I believe that gpt-3.5-turbo-instruct is the only model that supports fill-in-the-middle (of the openai models), and that model is only suported by the /completions endpoint.

sisve avatar Jul 29 '24 11:07 sisve

The same

monk-after-90s avatar Oct 22 '24 08:10 monk-after-90s