mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 01:10:14 +01:00
fix(openai/completions): use old method for instruct/davinci/text gen models (#1166)
This commit is contained in:
parent
d5259e1525
commit
9ca84edb9a
1 changed files with 3 additions and 2 deletions
|
|
@ -367,7 +367,7 @@ If your reverse proxy is compatible to OpenAI specs in every other way, it may s
|
||||||
let streamResult = null;
|
let streamResult = null;
|
||||||
this.modelOptions.user = this.user;
|
this.modelOptions.user = this.user;
|
||||||
const invalidBaseUrl = this.completionsUrl && extractBaseURL(this.completionsUrl) === null;
|
const invalidBaseUrl = this.completionsUrl && extractBaseURL(this.completionsUrl) === null;
|
||||||
const useOldMethod = !!(this.azure || invalidBaseUrl);
|
const useOldMethod = !!(this.azure || invalidBaseUrl || !this.isChatCompletion);
|
||||||
if (typeof opts.onProgress === 'function' && useOldMethod) {
|
if (typeof opts.onProgress === 'function' && useOldMethod) {
|
||||||
await this.getCompletion(
|
await this.getCompletion(
|
||||||
payload,
|
payload,
|
||||||
|
|
@ -702,9 +702,10 @@ ${convo}
|
||||||
if (typeof onProgress === 'function') {
|
if (typeof onProgress === 'function') {
|
||||||
modelOptions.stream = true;
|
modelOptions.stream = true;
|
||||||
}
|
}
|
||||||
if (this.isChatGptModel) {
|
if (this.isChatCompletion) {
|
||||||
modelOptions.messages = payload;
|
modelOptions.messages = payload;
|
||||||
} else {
|
} else {
|
||||||
|
// TODO: unreachable code. Need to implement completions call for non-chat models
|
||||||
modelOptions.prompt = payload;
|
modelOptions.prompt = payload;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue