Spaces:
Sleeping
Sleeping
class Skill: | |
def __init__(self:object) -> None: | |
pass | |
def set_tokenizer(self:object, tokenizer:object): | |
self.tokenizer = tokenizer | |
def process(self:object, input_txt:str, history_list:list, role_card:dict): | |
output_txt:str = None | |
for tag in role_card.keys(): | |
prefix:str = "{}=".format(tag) | |
if input_txt.startswith( prefix ): | |
role_card[tag]=input_txt[len(prefix):] | |
output_txt = "已设置{}为{}".format(tag, role_card[tag]) | |
break | |
return output_txt, history_list, role_card | |