diff --git a/src/_locales/de/main.json b/src/_locales/de/main.json
index 820cd655..4eefe4ba 100644
--- a/src/_locales/de/main.json
+++ b/src/_locales/de/main.json
@@ -159,5 +159,7 @@
"Gemini (Web)": "Gemini (Web)",
"Type": "Typ",
"Mode": "Modus",
- "Custom": "Benutzerdefiniert"
+ "Custom": "Benutzerdefiniert",
+ "Presence Penalty": "Präsenzstrafe",
+ "Frequency Penalty": "Frequenzstrafe"
}
diff --git a/src/_locales/en/main.json b/src/_locales/en/main.json
index 764acbc7..2a3d2427 100644
--- a/src/_locales/en/main.json
+++ b/src/_locales/en/main.json
@@ -159,5 +159,7 @@
"Gemini (Web)": "Gemini (Web)",
"Type": "Type",
"Mode": "Mode",
- "Custom": "Custom"
+ "Custom": "Custom",
+ "Presence Penalty": "Presence Penalty",
+ "Frequency Penalty": "Frequency Penalty"
}
diff --git a/src/_locales/es/main.json b/src/_locales/es/main.json
index 8ab2a08f..b46a919d 100644
--- a/src/_locales/es/main.json
+++ b/src/_locales/es/main.json
@@ -159,5 +159,7 @@
"Gemini (Web)": "Gemini (Web)",
"Type": "Tipo",
"Mode": "Modo",
- "Custom": "Personalizado"
+ "Custom": "Personalizado",
+ "Presence Penalty": "Penalización por presencia",
+ "Frequency Penalty": "Penalización por frecuencia"
}
diff --git a/src/_locales/fr/main.json b/src/_locales/fr/main.json
index 7c4ab1e8..f0b0e51c 100644
--- a/src/_locales/fr/main.json
+++ b/src/_locales/fr/main.json
@@ -159,5 +159,7 @@
"Gemini (Web)": "Gemini (Web)",
"Type": "Type",
"Mode": "Mode",
- "Custom": "Personnalisé"
+ "Custom": "Personnalisé",
+ "Presence Penalty": "Pénalité de présence",
+ "Frequency Penalty": "Pénalité de fréquence"
}
diff --git a/src/_locales/in/main.json b/src/_locales/in/main.json
index 6696bdf0..f67aba77 100644
--- a/src/_locales/in/main.json
+++ b/src/_locales/in/main.json
@@ -159,5 +159,7 @@
"Gemini (Web)": "Gemini (Web)",
"Type": "Jenis",
"Mode": "Mode",
- "Custom": "Kustom"
+ "Custom": "Kustom",
+ "Presence Penalty": "Penalti Kehadiran",
+ "Frequency Penalty": "Penalti Frekuensi"
}
diff --git a/src/_locales/it/main.json b/src/_locales/it/main.json
index 5a40e14b..b40a3684 100644
--- a/src/_locales/it/main.json
+++ b/src/_locales/it/main.json
@@ -159,5 +159,7 @@
"Gemini (Web)": "Gemini (Web)",
"Type": "Tipo",
"Mode": "Modalità",
- "Custom": "Personalizzato"
+ "Custom": "Personalizzato",
+ "Presence Penalty": "Penalità di presenza",
+ "Frequency Penalty": "Penalità di frequenza"
}
diff --git a/src/_locales/ja/main.json b/src/_locales/ja/main.json
index e5e273bb..55ef1be6 100644
--- a/src/_locales/ja/main.json
+++ b/src/_locales/ja/main.json
@@ -159,5 +159,7 @@
"Gemini (Web)": "Gemini (Web)",
"Type": "タイプ",
"Mode": "モード",
- "Custom": "カスタム"
+ "Custom": "カスタム",
+ "Presence Penalty": "存在ペナルティ",
+ "Frequency Penalty": "頻度ペナルティ"
}
diff --git a/src/_locales/ko/main.json b/src/_locales/ko/main.json
index 89ab4b8c..de99c890 100644
--- a/src/_locales/ko/main.json
+++ b/src/_locales/ko/main.json
@@ -159,5 +159,7 @@
"Gemini (Web)": "Gemini (웹)",
"Type": "유형",
"Mode": "모드",
- "Custom": "사용자 정의"
+ "Custom": "사용자 정의",
+ "Presence Penalty": "존재 패널티",
+ "Frequency Penalty": "빈도 패널티"
}
diff --git a/src/_locales/pt/main.json b/src/_locales/pt/main.json
index f1412d2f..438f50f9 100644
--- a/src/_locales/pt/main.json
+++ b/src/_locales/pt/main.json
@@ -159,5 +159,7 @@
"Gemini (Web)": "Gemini (Web)",
"Type": "Tipo",
"Mode": "Modo",
- "Custom": "Personalizado"
+ "Custom": "Personalizado",
+ "Presence Penalty": "Penalidade de presença",
+ "Frequency Penalty": "Penalidade de frequência"
}
diff --git a/src/_locales/ru/main.json b/src/_locales/ru/main.json
index 39fc4e30..fedfe60f 100644
--- a/src/_locales/ru/main.json
+++ b/src/_locales/ru/main.json
@@ -159,5 +159,7 @@
"Gemini (Web)": "Gemini (Веб)",
"Type": "Тип",
"Mode": "Режим",
- "Custom": "Пользовательский"
+ "Custom": "Пользовательский",
+ "Presence Penalty": "Штраф за присутствие",
+ "Frequency Penalty": "Штраф за частоту"
}
diff --git a/src/_locales/tr/main.json b/src/_locales/tr/main.json
index 6d91e395..00c5cd94 100644
--- a/src/_locales/tr/main.json
+++ b/src/_locales/tr/main.json
@@ -159,5 +159,7 @@
"Gemini (Web)": "Gemini (Web)",
"Type": "Tür",
"Mode": "Mod",
- "Custom": "Özel"
+ "Custom": "Özel",
+ "Presence Penalty": "Varlık Cezası",
+ "Frequency Penalty": "Frekans Cezası"
}
diff --git a/src/_locales/zh-hans/main.json b/src/_locales/zh-hans/main.json
index 0f203c47..6f159494 100644
--- a/src/_locales/zh-hans/main.json
+++ b/src/_locales/zh-hans/main.json
@@ -164,5 +164,7 @@
"ChatGLM (GLM-4-Air, 128k)": "ChatGLM (GLM4Air, 性价比, 128k)",
"ChatGLM (GLM-4-0520, 128k)": "ChatGLM (GLM4-0520, 最智能, 128k)",
"ChatGLM (Emohaa)": "ChatGLM (Emohaa, 专业情绪咨询)",
- "ChatGLM (CharGLM-3)": "ChatGLM (CharGLM-3, 角色扮演)"
+ "ChatGLM (CharGLM-3)": "ChatGLM (CharGLM-3, 角色扮演)",
+ "Presence Penalty": "存在惩罚",
+ "Frequency Penalty": "频率惩罚"
}
diff --git a/src/_locales/zh-hant/main.json b/src/_locales/zh-hant/main.json
index de04bc3b..0c2b49ff 100644
--- a/src/_locales/zh-hant/main.json
+++ b/src/_locales/zh-hant/main.json
@@ -159,5 +159,7 @@
"Gemini (Web)": "Gemini (網頁版)",
"Type": "類型",
"Mode": "模式",
- "Custom": "自訂"
+ "Custom": "自訂",
+ "Presence Penalty": "出現懲罰 (Presence Penalty)",
+ "Frequency Penalty": "頻率懲罰 (Frequency Penalty)"
}
diff --git a/src/config/index.mjs b/src/config/index.mjs
index ecc1620e..8fedc5a4 100644
--- a/src/config/index.mjs
+++ b/src/config/index.mjs
@@ -335,6 +335,8 @@ export const defaultConfig = {
maxResponseTokenLength: 1000,
maxConversationContextLength: 9,
temperature: 1,
+ presence_penalty: 0,
+ frequency_penalty: 0,
customChatGptWebApiUrl: 'https://chatgpt.com',
customChatGptWebApiPath: '/backend-api/conversation',
customOpenAiApiUrl: 'https://api.openai.com',
diff --git a/src/popup/sections/AdvancedPart.jsx b/src/popup/sections/AdvancedPart.jsx
index 4149528b..3c64c3b0 100644
--- a/src/popup/sections/AdvancedPart.jsx
+++ b/src/popup/sections/AdvancedPart.jsx
@@ -56,6 +56,34 @@ function ApiParams({ config, updateConfig }) {
}}
/>
+
+
>
)
}
diff --git a/src/services/apis/azure-openai-api.mjs b/src/services/apis/azure-openai-api.mjs
index 40585348..4b27cd58 100644
--- a/src/services/apis/azure-openai-api.mjs
+++ b/src/services/apis/azure-openai-api.mjs
@@ -40,6 +40,8 @@ export async function generateAnswersWithAzureOpenaiApi(port, question, session)
stream: true,
max_tokens: config.maxResponseTokenLength,
temperature: config.temperature,
+ presence_penalty: config.presence_penalty,
+ frequency_penalty: config.frequency_penalty,
}),
onMessage(message) {
console.debug('sse message', message)
diff --git a/src/services/apis/openai-api.mjs b/src/services/apis/openai-api.mjs
index 2d30c3b1..c39721d2 100644
--- a/src/services/apis/openai-api.mjs
+++ b/src/services/apis/openai-api.mjs
@@ -48,6 +48,8 @@ export async function generateAnswersWithGptCompletionApi(port, question, sessio
stream: true,
max_tokens: config.maxResponseTokenLength,
temperature: config.temperature,
+ presence_penalty: config.presence_penalty,
+ frequency_penalty: config.frequency_penalty,
stop: '\nHuman',
}),
onMessage(message) {
@@ -145,6 +147,8 @@ export async function generateAnswersWithChatgptApiCompat(
stream: true,
max_tokens: config.maxResponseTokenLength,
temperature: config.temperature,
+ presence_penalty: config.presence_penalty,
+ frequency_penalty: config.frequency_penalty,
...extraBody,
}),
onMessage(message) {