This commit updates the padding character in the `bypass_mode` feature of the `SSL_GeminiTextPrompt` node. The padding now uses the Word Joiner character (U+2060) instead of underscores.
The `_pad_text_with_underscores` method has been modified to implement this change. Text processed by this function will now have each character separated by U+2060, and the entire string will be prepended and appended with U+2060. For example, "hello" becomes "hello".
This commit introduces a new `bypass_mode` multiple choice input to the `SSL_GeminiTextPrompt` node. This feature allows you to choose whether to apply a special underscore padding to the "system_instruction", the "prompt", or "both" before sending them to the Gemini API. The padding format is `_c_h_a_r_a_c_t_e_r_s_`.
The following changes were made:
- Added `bypass_mode` to the `INPUT_TYPES` with options: "None", "system_instruction", "prompt", "both".
- Implemented a helper method `_pad_text_with_underscores` to perform the character padding.
- Modified the `generate` method to:
- Accept `bypass_mode` as a parameter.
- Conditionally apply padding to `system_instruction` and `prompt` based on the selected `bypass_mode`.
- Use the (potentially) padded text in the API call to Gemini.
The retry mechanism in `api_call` now encloses both the API call
itself (`client.models.generate_content`) and the subsequent processing
of the response (extraction of text and image data).
This addresses an issue where a 'NoneType' error could occur during
response processing after a technically successful API call, and this
error would not trigger a retry.
The `api_call` function will now attempt the entire sequence (call + process)
up to 3 times with exponential backoff (1s, 2s) if any exception occurs
during this sequence.
This commit translates the README.md file from Chinese to English.
The translation includes all sections of the README, preserving technical details, formatting, and contact information.
The translated README has been reviewed for clarity, grammar, and accuracy to ensure it is easily understandable for an English-speaking audience.