Generic generate methods (#3566) * sendOpenAIRequest/getTextGenGenerationData methods are improved, now it can use custom API, instead of active ones * Added missing model param * Removed unnecessary variable * active_oai_settings -> settings * settings -> textgenerationwebui_settings * Better presetToSettings names, simpler settings name in getTextGenGenerationData, * Removed unused jailbreak_system * Reverted most core changes, new custom-request.js file * Forced stream to false, removed duplicate method, exported settingsToUpdate * Rewrite typedefs to define props one by one * Added extractData param for simplicity * Fixed typehints * Fixed typehints (again) --------- Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>

7d568dd4e0ff5fe6eebeb98c853dfb1b1ea3f17d

bmen25124 <bmen25124@gmail.com>

Signed
7 files changed, +280 -89Showing whitespace changes
default/content/presets/openai/Default.json+0 -1
@@ -28,7 +28,6 @@
2828 "wrap_in_quotes": false,
2929 "names_behavior": 0,
3030 "send_if_empty": "",
31- "jailbreak_system": false,
3231 "impersonation_prompt": "[Write your next reply from the point of view of {{user}}, using the chat history so far as a guideline for the writing style of {{user}}. Don't write as {{char}} or system. Don't describe actions of {{char}}.]",
3332 "new_chat_prompt": "[Start a new Chat]",
3433 "new_group_chat_prompt": "[Start a new group chat. Group members: {{group}}]",
default/content/settings.json+0 -1
@@ -626,7 +626,6 @@
626626 "ai21_model": "jamba-1.5-large",
627627 "windowai_model": "",
628628 "openrouter_model": "OR_Website",
629- "jailbreak_system": true,
630629 "reverse_proxy": "",
631630 "chat_completion_source": "openai",
632631 "max_context_unlocked": false,
public/script.js+1 -1
@@ -5647,7 +5647,7 @@ export async function sendStreamingRequest(type, data) {
56475647 * @returns {string} Generation URL
56485648 * @throws {Error} If the API is unknown
56495649 */
56505650export function getGenerateUrl(api) {
56515651 switch (api) {
56525652 case 'kobold':
56535653 return '/api/backends/kobold/generate';
public/scripts/custom-request.js+189 -0
@@ -0,0 +1,189 @@
1+import { getPresetManager } from './preset-manager.js';
2+import { extractMessageFromData, getGenerateUrl, getRequestHeaders } from '../script.js';
3+import { getTextGenServer } from './textgen-settings.js';
4+
5+// #region Type Definitions
6+/**
7+ * @typedef {Object} TextCompletionRequestBase
8+ * @property {string} prompt - The text prompt for completion
9+ * @property {number} max_tokens - Maximum number of tokens to generate
10+ * @property {string} [model] - Optional model name
11+ * @property {string} api_type - Type of API to use
12+ * @property {string} [api_server] - Optional API server URL
13+ * @property {number} [temperature] - Optional temperature parameter
14+ */
15+
16+/** @typedef {Record<string, any> & TextCompletionRequestBase} TextCompletionRequest */
17+
18+/**
19+ * @typedef {Object} TextCompletionPayloadBase
20+ * @property {string} prompt - The text prompt for completion
21+ * @property {number} max_tokens - Maximum number of tokens to generate
22+ * @property {number} max_new_tokens - Alias for max_tokens
23+ * @property {string} [model] - Optional model name
24+ * @property {string} api_type - Type of API to use
25+ * @property {string} api_server - API server URL
26+ * @property {number} [temperature] - Optional temperature parameter
27+ */
28+
29+/** @typedef {Record<string, any> & TextCompletionPayloadBase} TextCompletionPayload */
30+
31+/**
32+ * @typedef {Object} ChatCompletionMessage
33+ * @property {string} role - The role of the message author (e.g., "user", "assistant", "system")
34+ * @property {string} content - The content of the message
35+ */
36+
37+/**
38+ * @typedef {Object} ChatCompletionPayloadBase
39+ * @property {ChatCompletionMessage[]} messages - Array of chat messages
40+ * @property {string} [model] - Optional model name to use for completion
41+ * @property {string} chat_completion_source - Source provider for chat completion
42+ * @property {number} max_tokens - Maximum number of tokens to generate
43+ * @property {number} [temperature] - Optional temperature parameter for response randomness
44+ */
45+
46+/** @typedef {Record<string, any> & ChatCompletionPayloadBase} ChatCompletionPayload */
47+// #endregion
48+
49+/**
50+ * Creates & sends a text completion request. Streaming is not supported.
51+ */
52+export class TextCompletionService {
53+ static TYPE = 'textgenerationwebui';
54+
55+ /**
56+ * @param {TextCompletionRequest} custom
57+ * @returns {TextCompletionPayload}
58+ */
59+ static createRequestData({ prompt, max_tokens, model, api_type, api_server, temperature, ...props }) {
60+ return {
61+ ...props,
62+ prompt,
63+ max_tokens,
64+ max_new_tokens: max_tokens,
65+ model,
66+ api_type,
67+ api_server: api_server ?? getTextGenServer(api_type),
68+ temperature,
69+ stream: false,
70+ };
71+ }
72+
73+ /**
74+ * Sends a text completion request to the specified server
75+ * @param {TextCompletionPayload} data Request data
76+ * @param {boolean?} extractData Extract message from the response. Default true
77+ * @returns {Promise<string | any>} Extracted data or the raw response
78+ * @throws {Error}
79+ */
80+ static async sendRequest(data, extractData = true) {
81+ const response = await fetch(getGenerateUrl(this.TYPE), {
82+ method: 'POST',
83+ headers: getRequestHeaders(),
84+ cache: 'no-cache',
85+ body: JSON.stringify(data),
86+ signal: new AbortController().signal,
87+ });
88+
89+ if (!response.ok) {
90+ throw await response.json();
91+ }
92+
93+ const json = await response.json();
94+ return extractData ? extractMessageFromData(json, this.TYPE) : json;
95+ }
96+
97+ /**
98+ * @param {string} presetName
99+ * @param {TextCompletionRequest} custom
100+ * @param {boolean?} extractData Extract message from the response. Default true
101+ * @returns {Promise<string | any>} Extracted data or the raw response
102+ * @throws {Error}
103+ */
104+ static async sendRequestWithPreset(presetName, custom, extractData = true) {
105+ const presetManager = getPresetManager(this.TYPE);
106+ if (!presetManager) {
107+ throw new Error('Preset manager not found');
108+ }
109+
110+ const preset = presetManager.getCompletionPresetByName(presetName);
111+ if (!preset) {
112+ throw new Error('Preset not found');
113+ }
114+
115+ const data = this.createRequestData({ ...preset, ...custom });
116+
117+ return await this.sendRequest(data, extractData);
118+ }
119+}
120+
121+/**
122+ * Creates & sends a chat completion request. Streaming is not supported.
123+ */
124+export class ChatCompletionService {
125+ static TYPE = 'openai';
126+
127+ /**
128+ * @param {ChatCompletionPayload} custom
129+ * @returns {ChatCompletionPayload}
130+ */
131+ static createRequestData({ messages, model, chat_completion_source, max_tokens, temperature, ...props }) {
132+ return {
133+ ...props,
134+ messages,
135+ model,
136+ chat_completion_source,
137+ max_tokens,
138+ temperature,
139+ stream: false,
140+ };
141+ }
142+
143+ /**
144+ * Sends a chat completion request
145+ * @param {ChatCompletionPayload} data Request data
146+ * @param {boolean?} extractData Extract message from the response. Default true
147+ * @returns {Promise<string | any>} Extracted data or the raw response
148+ * @throws {Error}
149+ */
150+ static async sendRequest(data, extractData = true) {
151+ const response = await fetch('/api/backends/chat-completions/generate', {
152+ method: 'POST',
153+ headers: getRequestHeaders(),
154+ cache: 'no-cache',
155+ body: JSON.stringify(data),
156+ signal: new AbortController().signal,
157+ });
158+
159+ if (!response.ok) {
160+ throw await response.json();
161+ }
162+
163+ const json = await response.json();
164+ return extractData ? extractMessageFromData(json, this.TYPE) : json;
165+ }
166+
167+ /**
168+ * @param {string} presetName
169+ * @param {ChatCompletionPayload} custom
170+ * @param {boolean} extractData Extract message from the response. Default true
171+ * @returns {Promise<string | any>} Extracted data or the raw response
172+ * @throws {Error}
173+ */
174+ static async sendRequestWithPreset(presetName, custom, extractData = true) {
175+ const presetManager = getPresetManager(this.TYPE);
176+ if (!presetManager) {
177+ throw new Error('Preset manager not found');
178+ }
179+
180+ const preset = presetManager.getCompletionPresetByName(presetName);
181+ if (!preset) {
182+ throw new Error('Preset not found');
183+ }
184+
185+ const data = this.createRequestData({ ...preset, ...custom });
186+
187+ return await this.sendRequest(data, extractData);
188+ }
189+}
public/scripts/openai.js+81 -80
@@ -224,6 +224,87 @@ const sensitiveFields = [
224224 'custom_include_headers',
225225];
226226
227+/**
228+ * preset_name -> [selector, setting_name, is_checkbox]
229+ * @type {Record<string, [string, string, boolean]>}
230+ */
231+export const settingsToUpdate = {
232+ chat_completion_source: ['#chat_completion_source', 'chat_completion_source', false],
233+ temperature: ['#temp_openai', 'temp_openai', false],
234+ frequency_penalty: ['#freq_pen_openai', 'freq_pen_openai', false],
235+ presence_penalty: ['#pres_pen_openai', 'pres_pen_openai', false],
236+ top_p: ['#top_p_openai', 'top_p_openai', false],
237+ top_k: ['#top_k_openai', 'top_k_openai', false],
238+ top_a: ['#top_a_openai', 'top_a_openai', false],
239+ min_p: ['#min_p_openai', 'min_p_openai', false],
240+ repetition_penalty: ['#repetition_penalty_openai', 'repetition_penalty_openai', false],
241+ max_context_unlocked: ['#oai_max_context_unlocked', 'max_context_unlocked', true],
242+ openai_model: ['#model_openai_select', 'openai_model', false],
243+ claude_model: ['#model_claude_select', 'claude_model', false],
244+ windowai_model: ['#model_windowai_select', 'windowai_model', false],
245+ openrouter_model: ['#model_openrouter_select', 'openrouter_model', false],
246+ openrouter_use_fallback: ['#openrouter_use_fallback', 'openrouter_use_fallback', true],
247+ openrouter_group_models: ['#openrouter_group_models', 'openrouter_group_models', false],
248+ openrouter_sort_models: ['#openrouter_sort_models', 'openrouter_sort_models', false],
249+ openrouter_providers: ['#openrouter_providers_chat', 'openrouter_providers', false],
250+ openrouter_allow_fallbacks: ['#openrouter_allow_fallbacks', 'openrouter_allow_fallbacks', true],
251+ openrouter_middleout: ['#openrouter_middleout', 'openrouter_middleout', false],
252+ ai21_model: ['#model_ai21_select', 'ai21_model', false],
253+ mistralai_model: ['#model_mistralai_select', 'mistralai_model', false],
254+ cohere_model: ['#model_cohere_select', 'cohere_model', false],
255+ perplexity_model: ['#model_perplexity_select', 'perplexity_model', false],
256+ groq_model: ['#model_groq_select', 'groq_model', false],
257+ nanogpt_model: ['#model_nanogpt_select', 'nanogpt_model', false],
258+ deepseek_model: ['#model_deepseek_select', 'deepseek_model', false],
259+ zerooneai_model: ['#model_01ai_select', 'zerooneai_model', false],
260+ blockentropy_model: ['#model_blockentropy_select', 'blockentropy_model', false],
261+ custom_model: ['#custom_model_id', 'custom_model', false],
262+ custom_url: ['#custom_api_url_text', 'custom_url', false],
263+ custom_include_body: ['#custom_include_body', 'custom_include_body', false],
264+ custom_exclude_body: ['#custom_exclude_body', 'custom_exclude_body', false],
265+ custom_include_headers: ['#custom_include_headers', 'custom_include_headers', false],
266+ custom_prompt_post_processing: ['#custom_prompt_post_processing', 'custom_prompt_post_processing', false],
267+ google_model: ['#model_google_select', 'google_model', false],
268+ openai_max_context: ['#openai_max_context', 'openai_max_context', false],
269+ openai_max_tokens: ['#openai_max_tokens', 'openai_max_tokens', false],
270+ wrap_in_quotes: ['#wrap_in_quotes', 'wrap_in_quotes', true],
271+ names_behavior: ['#names_behavior', 'names_behavior', false],
272+ send_if_empty: ['#send_if_empty_textarea', 'send_if_empty', false],
273+ impersonation_prompt: ['#impersonation_prompt_textarea', 'impersonation_prompt', false],
274+ new_chat_prompt: ['#newchat_prompt_textarea', 'new_chat_prompt', false],
275+ new_group_chat_prompt: ['#newgroupchat_prompt_textarea', 'new_group_chat_prompt', false],
276+ new_example_chat_prompt: ['#newexamplechat_prompt_textarea', 'new_example_chat_prompt', false],
277+ continue_nudge_prompt: ['#continue_nudge_prompt_textarea', 'continue_nudge_prompt', false],
278+ bias_preset_selected: ['#openai_logit_bias_preset', 'bias_preset_selected', false],
279+ reverse_proxy: ['#openai_reverse_proxy', 'reverse_proxy', false],
280+ wi_format: ['#wi_format_textarea', 'wi_format', false],
281+ scenario_format: ['#scenario_format_textarea', 'scenario_format', false],
282+ personality_format: ['#personality_format_textarea', 'personality_format', false],
283+ group_nudge_prompt: ['#group_nudge_prompt_textarea', 'group_nudge_prompt', false],
284+ stream_openai: ['#stream_toggle', 'stream_openai', true],
285+ prompts: ['', 'prompts', false],
286+ prompt_order: ['', 'prompt_order', false],
287+ api_url_scale: ['#api_url_scale', 'api_url_scale', false],
288+ show_external_models: ['#openai_show_external_models', 'show_external_models', true],
289+ proxy_password: ['#openai_proxy_password', 'proxy_password', false],
290+ assistant_prefill: ['#claude_assistant_prefill', 'assistant_prefill', false],
291+ assistant_impersonation: ['#claude_assistant_impersonation', 'assistant_impersonation', false],
292+ claude_use_sysprompt: ['#claude_use_sysprompt', 'claude_use_sysprompt', true],
293+ use_makersuite_sysprompt: ['#use_makersuite_sysprompt', 'use_makersuite_sysprompt', true],
294+ use_alt_scale: ['#use_alt_scale', 'use_alt_scale', true],
295+ squash_system_messages: ['#squash_system_messages', 'squash_system_messages', true],
296+ image_inlining: ['#openai_image_inlining', 'image_inlining', true],
297+ inline_image_quality: ['#openai_inline_image_quality', 'inline_image_quality', false],
298+ continue_prefill: ['#continue_prefill', 'continue_prefill', true],
299+ continue_postfix: ['#continue_postfix', 'continue_postfix', false],
300+ function_calling: ['#openai_function_calling', 'function_calling', true],
301+ show_thoughts: ['#openai_show_thoughts', 'show_thoughts', true],
302+ reasoning_effort: ['#openai_reasoning_effort', 'reasoning_effort', false],
303+ seed: ['#seed_openai', 'seed', false],
304+ n: ['#n_openai', 'n', false],
305+ bypass_status_check: ['#openai_bypass_status_check', 'bypass_status_check', true],
306+};
307+
227308const default_settings = {
228309 preset_settings_openai: 'Default',
229310 temp_openai: 1.0,
@@ -277,7 +358,6 @@ const default_settings = {
277358 openrouter_providers: [],
278359 openrouter_allow_fallbacks: true,
279360 openrouter_middleout: openrouter_middleout_types.ON,
280- jailbreak_system: false,
281361 reverse_proxy: '',
282362 chat_completion_source: chat_completion_sources.OPENAI,
283363 max_context_unlocked: false,
@@ -357,7 +437,6 @@ const oai_settings = {
357437 openrouter_providers: [],
358438 openrouter_allow_fallbacks: true,
359439 openrouter_middleout: openrouter_middleout_types.ON,
360- jailbreak_system: false,
361440 reverse_proxy: '',
362441 chat_completion_source: chat_completion_sources.OPENAI,
363442 max_context_unlocked: false,
@@ -3219,7 +3298,6 @@ function loadOpenAISettings(data, settings) {
32193298 $('#openai_max_tokens').val(oai_settings.openai_max_tokens);
32203299
32213300 $('#wrap_in_quotes').prop('checked', oai_settings.wrap_in_quotes);
3222- $('#jailbreak_system').prop('checked', oai_settings.jailbreak_system);
32233301 $('#openai_show_external_models').prop('checked', oai_settings.show_external_models);
32243302 $('#openai_external_category').toggle(oai_settings.show_external_models);
32253303 $('#claude_use_sysprompt').prop('checked', oai_settings.claude_use_sysprompt);
@@ -3503,7 +3581,6 @@ async function saveOpenAIPreset(name, settings, triggerUi = true) {
35033581 names_behavior: settings.names_behavior,
35043582 send_if_empty: settings.send_if_empty,
35053583 jailbreak_prompt: settings.jailbreak_prompt,
3506- jailbreak_system: settings.jailbreak_system,
35073584 impersonation_prompt: settings.impersonation_prompt,
35083585 new_chat_prompt: settings.new_chat_prompt,
35093586 new_group_chat_prompt: settings.new_group_chat_prompt,
@@ -3923,82 +4000,6 @@ async function onLogitBiasPresetDeleteClick() {
39234000
39244001// Load OpenAI preset settings
39254002function onSettingsPresetChange() {
3926- const settingsToUpdate = {
3927- chat_completion_source: ['#chat_completion_source', 'chat_completion_source', false],
3928- temperature: ['#temp_openai', 'temp_openai', false],
3929- frequency_penalty: ['#freq_pen_openai', 'freq_pen_openai', false],
3930- presence_penalty: ['#pres_pen_openai', 'pres_pen_openai', false],
3931- top_p: ['#top_p_openai', 'top_p_openai', false],
3932- top_k: ['#top_k_openai', 'top_k_openai', false],
3933- top_a: ['#top_a_openai', 'top_a_openai', false],
3934- min_p: ['#min_p_openai', 'min_p_openai', false],
3935- repetition_penalty: ['#repetition_penalty_openai', 'repetition_penalty_openai', false],
3936- max_context_unlocked: ['#oai_max_context_unlocked', 'max_context_unlocked', true],
3937- openai_model: ['#model_openai_select', 'openai_model', false],
3938- claude_model: ['#model_claude_select', 'claude_model', false],
3939- windowai_model: ['#model_windowai_select', 'windowai_model', false],
3940- openrouter_model: ['#model_openrouter_select', 'openrouter_model', false],
3941- openrouter_use_fallback: ['#openrouter_use_fallback', 'openrouter_use_fallback', true],
3942- openrouter_group_models: ['#openrouter_group_models', 'openrouter_group_models', false],
3943- openrouter_sort_models: ['#openrouter_sort_models', 'openrouter_sort_models', false],
3944- openrouter_providers: ['#openrouter_providers_chat', 'openrouter_providers', false],
3945- openrouter_allow_fallbacks: ['#openrouter_allow_fallbacks', 'openrouter_allow_fallbacks', true],
3946- openrouter_middleout: ['#openrouter_middleout', 'openrouter_middleout', false],
3947- ai21_model: ['#model_ai21_select', 'ai21_model', false],
3948- mistralai_model: ['#model_mistralai_select', 'mistralai_model', false],
3949- cohere_model: ['#model_cohere_select', 'cohere_model', false],
3950- perplexity_model: ['#model_perplexity_select', 'perplexity_model', false],
3951- groq_model: ['#model_groq_select', 'groq_model', false],
3952- nanogpt_model: ['#model_nanogpt_select', 'nanogpt_model', false],
3953- deepseek_model: ['#model_deepseek_select', 'deepseek_model', false],
3954- zerooneai_model: ['#model_01ai_select', 'zerooneai_model', false],
3955- blockentropy_model: ['#model_blockentropy_select', 'blockentropy_model', false],
3956- custom_model: ['#custom_model_id', 'custom_model', false],
3957- custom_url: ['#custom_api_url_text', 'custom_url', false],
3958- custom_include_body: ['#custom_include_body', 'custom_include_body', false],
3959- custom_exclude_body: ['#custom_exclude_body', 'custom_exclude_body', false],
3960- custom_include_headers: ['#custom_include_headers', 'custom_include_headers', false],
3961- custom_prompt_post_processing: ['#custom_prompt_post_processing', 'custom_prompt_post_processing', false],
3962- google_model: ['#model_google_select', 'google_model', false],
3963- openai_max_context: ['#openai_max_context', 'openai_max_context', false],
3964- openai_max_tokens: ['#openai_max_tokens', 'openai_max_tokens', false],
3965- wrap_in_quotes: ['#wrap_in_quotes', 'wrap_in_quotes', true],
3966- names_behavior: ['#names_behavior', 'names_behavior', false],
3967- send_if_empty: ['#send_if_empty_textarea', 'send_if_empty', false],
3968- impersonation_prompt: ['#impersonation_prompt_textarea', 'impersonation_prompt', false],
3969- new_chat_prompt: ['#newchat_prompt_textarea', 'new_chat_prompt', false],
3970- new_group_chat_prompt: ['#newgroupchat_prompt_textarea', 'new_group_chat_prompt', false],
3971- new_example_chat_prompt: ['#newexamplechat_prompt_textarea', 'new_example_chat_prompt', false],
3972- continue_nudge_prompt: ['#continue_nudge_prompt_textarea', 'continue_nudge_prompt', false],
3973- bias_preset_selected: ['#openai_logit_bias_preset', 'bias_preset_selected', false],
3974- reverse_proxy: ['#openai_reverse_proxy', 'reverse_proxy', false],
3975- wi_format: ['#wi_format_textarea', 'wi_format', false],
3976- scenario_format: ['#scenario_format_textarea', 'scenario_format', false],
3977- personality_format: ['#personality_format_textarea', 'personality_format', false],
3978- group_nudge_prompt: ['#group_nudge_prompt_textarea', 'group_nudge_prompt', false],
3979- stream_openai: ['#stream_toggle', 'stream_openai', true],
3980- prompts: ['', 'prompts', false],
3981- prompt_order: ['', 'prompt_order', false],
3982- api_url_scale: ['#api_url_scale', 'api_url_scale', false],
3983- show_external_models: ['#openai_show_external_models', 'show_external_models', true],
3984- proxy_password: ['#openai_proxy_password', 'proxy_password', false],
3985- assistant_prefill: ['#claude_assistant_prefill', 'assistant_prefill', false],
3986- assistant_impersonation: ['#claude_assistant_impersonation', 'assistant_impersonation', false],
3987- claude_use_sysprompt: ['#claude_use_sysprompt', 'claude_use_sysprompt', true],
3988- use_makersuite_sysprompt: ['#use_makersuite_sysprompt', 'use_makersuite_sysprompt', true],
3989- use_alt_scale: ['#use_alt_scale', 'use_alt_scale', true],
3990- squash_system_messages: ['#squash_system_messages', 'squash_system_messages', true],
3991- image_inlining: ['#openai_image_inlining', 'image_inlining', true],
3992- inline_image_quality: ['#openai_inline_image_quality', 'inline_image_quality', false],
3993- continue_prefill: ['#continue_prefill', 'continue_prefill', true],
3994- continue_postfix: ['#continue_postfix', 'continue_postfix', false],
3995- function_calling: ['#openai_function_calling', 'function_calling', true],
3996- show_thoughts: ['#openai_show_thoughts', 'show_thoughts', true],
3997- reasoning_effort: ['#openai_reasoning_effort', 'reasoning_effort', false],
3998- seed: ['#seed_openai', 'seed', false],
3999- n: ['#n_openai', 'n', false],
4000- };
4001-
40024003 const presetNameBefore = oai_settings.preset_settings_openai;
40034004
40044005 const presetName = $('#settings_preset_openai').find(':selected').text();
public/scripts/st-context.js+3 -0
@@ -77,6 +77,7 @@ import { accountStorage } from './util/AccountStorage.js';
7777import { timestampToMoment, uuidv4 } from './utils.js';
7878import { getGlobalVariable, getLocalVariable, setGlobalVariable, setLocalVariable } from './variables.js';
7979import { convertCharacterBook, loadWorldInfo, saveWorldInfo, updateWorldInfoList } from './world-info.js';
80+import { ChatCompletionService, TextCompletionService } from './custom-request.js';
8081
8182export function getContext() {
8283 return {
@@ -207,6 +208,8 @@ export function getContext() {
207208 getChatCompletionModel,
208209 printMessages,
209210 clearChat,
211+ ChatCompletionService,
212+ TextCompletionService,
210213 };
211214}
212215
public/scripts/textgen-settings.js+6 -6
@@ -108,12 +108,12 @@ const BIAS_KEY = '#textgenerationwebui_api-settings';
108108// (7 days later) The future has come.
109109const MANCER_SERVER_KEY = 'mancer_server';
110110const MANCER_SERVER_DEFAULT = 'https://neuro.mancer.tech';
111111export let MANCER_SERVER = localStorage.getItem(MANCER_SERVER_KEY) ?? MANCER_SERVER_DEFAULT;
112112export let TOGETHERAI_SERVER = 'https://api.together.xyz';
113113export let INFERMATICAI_SERVER = 'https://api.totalgpt.ai';
114114export let DREAMGEN_SERVER = 'https://dreamgen.com';
115115export let OPENROUTER_SERVER = 'https://openrouter.ai/api';
116116export let FEATHERLESS_SERVER = 'https://api.featherless.ai/v1';
117117
118118export const SERVER_INPUTS = {
119119 [textgen_types.OOBA]: '#textgenerationwebui_api_url_text',