diff --git a/visual_chatgpt.py b/visual_chatgpt.py index 4ddf5764..12165494 100644 --- a/visual_chatgpt.py +++ b/visual_chatgpt.py @@ -1458,6 +1458,45 @@ def get_mask(self, image_path): return mask +class SearchAssist: + def __init__(self, device): + print(f"Initializing SearchAssist to {device}") + self.device = device + # def __init__(self,inputs): + # self.inputs=inputs + @prompts(name="Search Order", + description="useful for when you need to answer questions about customers orders") + def inference(self,inputs): + return "订单状态;已发货;发货日期;2023-01-01;预计送达时间:2023-01-10" + + + +class RecommandProduct: + def __init__(self, device): + print(f"Initializing RecommandProduct to {device}") + self.device = device + + # def __init__(self,inputs): + # self.inputs=inputs + + @prompts(name="Recommend Product", + description="useful for when you need to answer questions about product recommendations") + def inference(self, inputs): + return "收钱吧扫码王" + +class FQA: + def __init__(self, device): + print(f"Initializing SearchAssist to {device}") + self.device = device + # def __init__(self,inputs): + # self.inputs=inputs + @prompts(name="FAQ", + description="useful for when you need to answer questions about shopping policies, like return policy, shipping policy, etc.s") + def inference(self, inputs): + return "七天无理由退换货" + + + class ConversationBot: def __init__(self, load_dict): @@ -1577,4 +1616,4 @@ def run_image(self, image, state, txt, lang): clear.click(bot.memory.clear) clear.click(lambda: [], None, chatbot) clear.click(lambda: [], None, state) - demo.launch(server_name="0.0.0.0", server_port=7861) + demo.launch(server_name="0.0.0.0", server_port=7861) \ No newline at end of file