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>
This commit is contained in:
bmen25124
2025-03-03 11:30:20 +03:00
committed by GitHub
parent 0088333ebf
commit 7d568dd4e0
7 changed files with 280 additions and 89 deletions

View File

@ -5647,7 +5647,7 @@ export async function sendStreamingRequest(type, data) {
* @returns {string} Generation URL
* @throws {Error} If the API is unknown
*/
function getGenerateUrl(api) {
export function getGenerateUrl(api) {
switch (api) {
case 'kobold':
return '/api/backends/kobold/generate';