@@ -82,7 +82,7 @@ def validate_source_connect_config(config: Dict) -> (bool, str):
8282 return True , ""
8383
8484
85- def validate_bot_config (model , config : Dict , bot , memory ) -> (bool , str ):
85+ def validate_bot_config (model , config : Dict , type , memory ) -> (bool , str ):
8686 try :
8787 Predictor .from_model (model , PredictorType .CUSTOM_LLM , ** config )
8888 except Exception as e :
@@ -91,9 +91,9 @@ def validate_bot_config(model, config: Dict, bot, memory) -> (bool, str):
9191 try :
9292 # validate the prompt
9393 prompt_template = config .get ("prompt_template" , None )
94- if prompt_template and bot . type == BotType .KNOWLEDGE :
94+ if prompt_template and type == BotType .KNOWLEDGE :
9595 PromptTemplate (template = prompt_template , input_variables = ["query" , "context" ])
96- elif prompt_template and bot . type == BotType .COMMON :
96+ elif prompt_template and type == BotType .COMMON :
9797 PromptTemplate (template = prompt_template , input_variables = ["query" ])
9898 # pass
9999 except ValidationError :
@@ -103,9 +103,9 @@ def validate_bot_config(model, config: Dict, bot, memory) -> (bool, str):
103103 try :
104104 # validate the memory prompt
105105 prompt_template = config .get ("memory_prompt_template" , None )
106- if prompt_template and bot . type == BotType .KNOWLEDGE :
106+ if prompt_template and type == BotType .KNOWLEDGE :
107107 PromptTemplate (template = prompt_template , input_variables = ["query" , "context" ])
108- elif prompt_template and bot . type == BotType .COMMON :
108+ elif prompt_template and type == BotType .COMMON :
109109 PromptTemplate (template = prompt_template , input_variables = ["query" ])
110110 # pass
111111 except ValidationError :
0 commit comments