Skip to content

Commit bee687b

Browse files
committed
Update ChatGPTTranslator to support Chinese translation in JSON format
1 parent f3a7d4b commit bee687b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Mikoto/Translators/Implementations/ChatGPTTranslator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public string GetLastError()
4343
return null;
4444
}
4545
string retString;
46-
string jsonParam = $"{{\"model\": \"{openai_model}\",\"messages\": [{{\"role\": \"system\", \"content\": \"Translate {srcLang} To {desLang} output them in JSON format\"}},{{\"role\": \"user\", \"content\": \"{q}\"}}], \"response_format\": {{\"type\": \"{format}\"}}, \"max_tokens\": {max_tokens}, \"temperature\": {temperature}}}";
46+
string jsonParam = $"{{\"model\": \"{openai_model}\",\"messages\": [{{\"role\": \"system\", \"content\": \"翻译{srcLang}{desLang}以JSON format输出\"}},{{\"role\": \"user\", \"content\": \"{q}\"}}], \"response_format\": {{\"type\": \"{format}\"}}, \"max_tokens\": {max_tokens}, \"temperature\": {temperature}}}";
4747
var hc = CommonHttpClient.Instance;
4848
var req = new StringContent(jsonParam, null, "application/json");
4949
hc.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", apiKey);

0 commit comments

Comments
 (0)