continue icon indicating copy to clipboard operation
continue copied to clipboard

Many models cannot use the /edit command

Open jueinin opened this issue 7 months ago • 3 comments

Before submitting your bug report

Relevant environment info

- OS:
- Continue:
- IDE:
- Model:
- config.json:

Description

I found that when using certain models, the /edit command is completely unusable. After capturing the packet, I found that the requested interface is /v1/completions, but it should actually be /v1/chat/completions. After investigation, I found that at https://vscode.dev/github/continuedev/continue/blob/dev/core/commands/slash/edit.ts#L490, a raw attribute is passed in. I'm not sure what the raw attribute is used for, but after passing in raw, when calling openai, according to this line of code, it will automatically go to the legacy logic https://vscode.dev/github/continuedev/continue/blob/dev/core/llm/llms/OpenAI.ts#L205, so the URL is incorrect.

At the same time, this chat-only models issue also has problems, it should be written in the configuration file, not hardcoded directly in the code. I'm using the DeepSeek model, which is not on this list, so

!CHAT_ONLY_MODELS.includes(options.model) && this.supportsCompletions() && (NON_CHAT_MODELS.includes(options.model) || this.useLegacyCompletionsEndpoint || options.raw)

is true && true && true and is routed to the legacy system.

To reproduce

you can try any provider which do not support legacy complete and do not on chat only model list. for example chatglm deepseek o

and using /edit command, it will not work

Log output

No response

jueinin avatar Jul 21 '24 08:07 jueinin