diff --git a/babeldoc/translator/translator.py b/babeldoc/translator/translator.py index 117962b7e..73d2d727e 100644 --- a/babeldoc/translator/translator.py +++ b/babeldoc/translator/translator.py @@ -307,7 +307,7 @@ def do_llm_translate(self, text, rate_limit_params: dict = None): options = {} if self.send_temperature: options.update(self.options) - if self.enable_json_mode_if_requested and rate_limit_params.get( + if self.enable_json_mode_if_requested and rate_limit_params and rate_limit_params.get( "request_json_mode", False ): options["response_format"] = {"type": "json_object"}