Rename /textgenerationwebui endpoint

I'd like to migrate over to using "textgen" to mean text-generation APIs
in general, so I've renamed the /textgenerationwebui/* endpoints to
/backends/text-completions/*.
This commit is contained in:
valadaptive
2023-12-11 23:13:26 -05:00
parent 3d7706e6b3
commit 5b3c96df50
3 changed files with 5 additions and 5 deletions

View File

@@ -928,7 +928,7 @@ async function getStatusKobold() {
} }
async function getStatusTextgen() { async function getStatusTextgen() {
const url = '/api/textgenerationwebui/status'; const url = '/api/backends/text-completions/status';
let endpoint = textgen_settings.type === MANCER ? let endpoint = textgen_settings.type === MANCER ?
MANCER_SERVER : MANCER_SERVER :
@@ -4428,7 +4428,7 @@ function getGenerateUrl(api) {
if (api == 'kobold') { if (api == 'kobold') {
generate_url = '/generate'; generate_url = '/generate';
} else if (api == 'textgenerationwebui') { } else if (api == 'textgenerationwebui') {
generate_url = '/api/textgenerationwebui/generate'; generate_url = '/api/backends/text-completions/generate';
} else if (api == 'novel') { } else if (api == 'novel') {
generate_url = '/api/novelai/generate'; generate_url = '/api/novelai/generate';
} }

View File

@@ -468,7 +468,7 @@ function setSettingByName(setting, value, trigger) {
async function generateTextGenWithStreaming(generate_data, signal) { async function generateTextGenWithStreaming(generate_data, signal) {
generate_data.stream = true; generate_data.stream = true;
const response = await fetch('/api/textgenerationwebui/generate', { const response = await fetch('/api/backends/text-completions/generate', {
headers: { headers: {
...getRequestHeaders(), ...getRequestHeaders(),
}, },

View File

@@ -447,7 +447,7 @@ app.post('/generate', jsonParser, async function (request, response_generate) {
}); });
//************** Text generation web UI //************** Text generation web UI
app.post('/api/textgenerationwebui/status', jsonParser, async function (request, response) { app.post('/api/backends/text-completions/status', jsonParser, async function (request, response) {
if (!request.body) return response.sendStatus(400); if (!request.body) return response.sendStatus(400);
try { try {
@@ -555,7 +555,7 @@ app.post('/api/textgenerationwebui/status', jsonParser, async function (request,
} }
}); });
app.post('/api/textgenerationwebui/generate', jsonParser, async function (request, response_generate) { app.post('/api/backends/text-completions/generate', jsonParser, async function (request, response_generate) {
if (!request.body) return response_generate.sendStatus(400); if (!request.body) return response_generate.sendStatus(400);
try { try {