Merge branch 'bufferoverflow-fix/supportscompletions' into preview
This commit is contained in:
commit
84fe459fe9
3 changed files with 10 additions and 4 deletions
|
|
@ -52,7 +52,8 @@ export abstract class BaseLLM implements ILLM {
|
|||
if (this.providerName === "openai") {
|
||||
if (
|
||||
this.apiBase?.includes("api.groq.com") ||
|
||||
this.apiBase?.includes(":1337")
|
||||
this.apiBase?.includes(":1337") ||
|
||||
this._llmOptions.useLegacyCompletionsEndpoint?.valueOf() === false
|
||||
) {
|
||||
// Jan + Groq don't support completions : (
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -38,12 +38,11 @@ const CHAT_ONLY_MODELS = [
|
|||
];
|
||||
|
||||
class OpenAI extends BaseLLM {
|
||||
public useLegacyCompletionsEndpoint = false;
|
||||
public useLegacyCompletionsEndpoint: boolean | undefined = undefined;
|
||||
|
||||
constructor(options: LLMOptions) {
|
||||
super(options);
|
||||
this.useLegacyCompletionsEndpoint =
|
||||
options.useLegacyCompletionsEndpoint ?? false;
|
||||
this.useLegacyCompletionsEndpoint = options.useLegacyCompletionsEndpoint;
|
||||
}
|
||||
|
||||
static providerName: ModelProvider = "openai";
|
||||
|
|
|
|||
|
|
@ -52,4 +52,10 @@ If you are [using an OpenAI compatible server / API](../../model-setup/select-pr
|
|||
}
|
||||
```
|
||||
|
||||
To force usage of `chat/completions` instead of `completions` endpoint you can set
|
||||
|
||||
```json
|
||||
"useLegacyCompletionsEndpoint": false
|
||||
```
|
||||
|
||||
[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/OpenAI.ts)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue