Rename chat completions endpoints
OpenAI calls this the "Chat Completions API", in contrast to their previous "Text Completions API", so that's what I'm naming it; both because other services besides OpenAI implement it, and to avoid confusion with the existing /api/openai route used for OpenAI extras.
This commit is contained in:
parent
796659f68c
commit
92bd766bcb
|
@ -1556,7 +1556,7 @@ async function sendOpenAIRequest(type, messages, signal) {
|
|||
generate_data['seed'] = oai_settings.seed;
|
||||
}
|
||||
|
||||
const generate_url = '/generate_openai';
|
||||
const generate_url = '/api/backends/chat-completions/generate';
|
||||
const response = await fetch(generate_url, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(generate_data),
|
||||
|
@ -1646,7 +1646,7 @@ async function calculateLogitBias() {
|
|||
let result = {};
|
||||
|
||||
try {
|
||||
const reply = await fetch(`/openai_bias?model=${getTokenizerModel()}`, {
|
||||
const reply = await fetch(`/api/backends/chat-completions/bias?model=${getTokenizerModel()}`, {
|
||||
method: 'POST',
|
||||
headers: getRequestHeaders(),
|
||||
body,
|
||||
|
@ -2439,7 +2439,7 @@ async function getStatusOpen() {
|
|||
}
|
||||
|
||||
try {
|
||||
const response = await fetch('/getstatus_openai', {
|
||||
const response = await fetch('/api/backends/chat-completions/status', {
|
||||
method: 'POST',
|
||||
headers: getRequestHeaders(),
|
||||
body: JSON.stringify(data),
|
||||
|
|
|
@ -626,7 +626,7 @@ function cleanUploads() {
|
|||
}
|
||||
|
||||
/* OpenAI */
|
||||
app.post('/getstatus_openai', jsonParser, async function (request, response_getstatus_openai) {
|
||||
app.post('/api/backends/chat-completions/status', jsonParser, async function (request, response_getstatus_openai) {
|
||||
if (!request.body) return response_getstatus_openai.sendStatus(400);
|
||||
|
||||
let api_url;
|
||||
|
@ -702,7 +702,7 @@ app.post('/getstatus_openai', jsonParser, async function (request, response_gets
|
|||
}
|
||||
});
|
||||
|
||||
app.post('/openai_bias', jsonParser, async function (request, response) {
|
||||
app.post('/api/backends/chat-completions/bias', jsonParser, async function (request, response) {
|
||||
if (!request.body || !Array.isArray(request.body))
|
||||
return response.sendStatus(400);
|
||||
|
||||
|
@ -1067,7 +1067,7 @@ async function sendPalmRequest(request, response) {
|
|||
}
|
||||
}
|
||||
|
||||
app.post('/generate_openai', jsonParser, function (request, response_generate_openai) {
|
||||
app.post('/api/backends/chat-completions/generate', jsonParser, function (request, response_generate_openai) {
|
||||
if (!request.body) return response_generate_openai.status(400).send({ error: true });
|
||||
|
||||
switch (request.body.chat_completion_source) {
|
||||
|
|
Loading…
Reference in New Issue