From d43175d46d917b5d33989fb4462d2712f2bd459f Mon Sep 17 00:00:00 2001 From: binary-husky Date: Tue, 21 May 2024 13:18:38 +0000 Subject: [PATCH] fix type hint --- crazy_functions/plugin_template/plugin_class_template.py | 2 +- toolbox.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crazy_functions/plugin_template/plugin_class_template.py b/crazy_functions/plugin_template/plugin_class_template.py index 95884266..cf4393a3 100644 --- a/crazy_functions/plugin_template/plugin_class_template.py +++ b/crazy_functions/plugin_template/plugin_class_template.py @@ -6,7 +6,7 @@ from typing import List class ArgProperty(BaseModel): # PLUGIN_ARG_MENU title: str = Field(description="The title", default="") description: str = Field(description="The description", default="") - default_value: str|float = Field(description="The default value", default="") + default_value: str = Field(description="The default value", default="") type: str = Field(description="The type", default="") # currently we support ['string', 'dropdown'] options: List[str] = Field(default=[], description="List of options available for the argument") # only used when type is 'dropdown' diff --git a/toolbox.py b/toolbox.py index 63ee7dab..9715c7e9 100644 --- a/toolbox.py +++ b/toolbox.py @@ -90,7 +90,7 @@ def ArgsGeneralWrapper(f): """ def decorated(request: gradio.Request, cookies:dict, max_length:int, llm_model:str, txt:str, txt2:str, top_p:float, temperature:float, chatbot:list, - history:list, system_prompt:str, plugin_advanced_arg:str|dict, *args): + history:list, system_prompt:str, plugin_advanced_arg:dict, *args): txt_passon = txt if txt == "" and txt2 != "": txt_passon = txt2 # 引入一个有cookie的chatbot