diff --git a/src/lang/en.ts b/src/lang/en.ts index fdd2c713..e30bd208 100644 --- a/src/lang/en.ts +++ b/src/lang/en.ts @@ -96,6 +96,7 @@ export const languageEnglish = { metrica: 'Metric Systemizer is a plugin that converts metrics to imperial units when request, and vice versa on output to show user metric system while using imperial for performace. it is not recommended to use this plugin when using imperial units on chat.', lorePlus: "LoreBook+ is a experimental feature that uses vectordb instead of just string matching for better bot making experience and better matching performace.", topP: "Top P is a probability threshold for nucleus sampling. model considers the results of the tokens with top_p probability mass.", + openAIFixer: "OpenAI Fixer is a plugin that fixes some of the problems of OpenAI.", }, setup: { chooseProvider: "Choose AI Provider", diff --git a/src/lib/Setting/Pages/PluginSettings.svelte b/src/lib/Setting/Pages/PluginSettings.svelte index 310ee448..b9f4967f 100644 --- a/src/lib/Setting/Pages/PluginSettings.svelte +++ b/src/lib/Setting/Pages/PluginSettings.svelte @@ -31,7 +31,7 @@
- OpenAI Fixer (Official Plugin) + OpenAI Fixer (Official Plugin)
diff --git a/src/ts/plugins/fixer.ts b/src/ts/plugins/fixer.ts index e6edba2e..eacf379a 100644 --- a/src/ts/plugins/fixer.ts +++ b/src/ts/plugins/fixer.ts @@ -1,4 +1,8 @@ -export function OaifixEmdash(bias:{[key:number]:number}){ +import { get } from "svelte/store" +import { DataBase } from "../storage/database" + +export function OaifixBias(bias:{[key:number]:number}){ + const db = get(DataBase) const emdashes = [ 2001, 2345, 8713, 16620, 17223, 22416, 29096, 29472, 30697, 35192, @@ -11,8 +15,15 @@ export function OaifixEmdash(bias:{[key:number]:number}){ 90863, 93830, 96197, 99563 ] - for (const emdash of emdashes) { - bias[emdash] = -100 + const biases = [] + + if(db.officialplugins.oaiFixEmdash){ + biases.push(...emdashes) + } + + + for (const key of biases) { + bias[key] = -100 } return bias diff --git a/src/ts/process/request.ts b/src/ts/process/request.ts index dc1d7bcf..be9920e4 100644 --- a/src/ts/process/request.ts +++ b/src/ts/process/request.ts @@ -18,7 +18,7 @@ import { Sha256 } from "@aws-crypto/sha256-js"; import { v4 } from "uuid"; import { cloneDeep } from "lodash"; import { supportsInlayImage } from "../image"; -import { OaifixEmdash } from "../plugins/fixer"; +import { OaifixBias } from "../plugins/fixer"; import { Capacitor } from "@capacitor/core"; import { getFreeOpenRouterModel } from "../model/openrouter"; import { runTransformers } from "./embedding/transformers"; @@ -243,10 +243,9 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model' } } - - if(db.officialplugins.oaiFix && db.officialplugins.oaiFixEmdash){ - if(raiModel.startsWith('gpt35') || raiModel.startsWith('gpt4')){ - bias = OaifixEmdash(bias) + if(raiModel.startsWith('gpt')){ + if(db.officialplugins.oaiFix){ + bias = OaifixBias(bias) } }