remove bare list, dict, Sequence, None, Any (#25058)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
Asuka Minato
2025-09-06 04:32:23 +09:00
committed by GitHub
parent 2b0695bdde
commit a78339a040
306 changed files with 787 additions and 817 deletions

View File

@ -30,7 +30,7 @@ class AdvancedPromptTransform(PromptTransform):
self,
with_variable_tmpl: bool = False,
image_detail_config: ImagePromptMessageContent.DETAIL = ImagePromptMessageContent.DETAIL.LOW,
) -> None:
):
self.with_variable_tmpl = with_variable_tmpl
self.image_detail_config = image_detail_config

View File

@ -126,7 +126,7 @@ class SimplePromptTransform(PromptTransform):
has_context: bool,
query_in_prompt: bool,
with_memory_prompt: bool = False,
) -> dict:
):
prompt_rules = self._get_prompt_rule(app_mode=app_mode, provider=provider, model=model)
custom_variable_keys = []
@ -277,7 +277,7 @@ class SimplePromptTransform(PromptTransform):
return prompt_message
def _get_prompt_rule(self, app_mode: AppMode, provider: str, model: str) -> dict:
def _get_prompt_rule(self, app_mode: AppMode, provider: str, model: str):
"""
Get simple prompt rule.
:param app_mode: app mode

View File

@ -15,7 +15,7 @@ from core.prompt.simple_prompt_transform import ModelMode
class PromptMessageUtil:
@staticmethod
def prompt_messages_to_prompt_for_saving(model_mode: str, prompt_messages: Sequence[PromptMessage]) -> list[dict]:
def prompt_messages_to_prompt_for_saving(model_mode: str, prompt_messages: Sequence[PromptMessage]):
"""
Prompt messages to prompt for saving.
:param model_mode: model mode

View File

@ -25,7 +25,7 @@ class PromptTemplateParser:
self.regex = WITH_VARIABLE_TMPL_REGEX if with_variable_tmpl else REGEX
self.variable_keys = self.extract()
def extract(self) -> list:
def extract(self):
# Regular expression to match the template rules
return re.findall(self.regex, self.template)