优化Gemini提示词变量格式

This commit is contained in:
John Smith
2024-02-27 22:21:09 +08:00
parent 0d7f847dc8
commit 263d4d8e65
2 changed files with 3 additions and 3 deletions

View File

@@ -730,7 +730,7 @@ class GeminiTranslate(TranslateProvider):
return self._cool_down_timer_handle is None and super().is_available
async def _do_translate(self, text) -> Optional[str]:
input_text = self._prompt.replace('{{original_text}}', text)
input_text = self._prompt.format(original_text=text)
self._body['contents'][0]['parts'][0]['text'] = input_text
try:
async with utils.request.http_session.post(