Winnie / bot /skills /give_role.py
lewiswu1209's picture
add qa skills
c1e6869
raw
history blame
599 Bytes
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