RoboWaiter/robowaiter/scene/tasks/GQA.py

46 lines
1.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""
具身多轮对话 GQA
点餐order的对话咖啡厅服务员可以为客人NPC完成点餐基本对话
场景对话GQA结合场景询问卫生间、附近娱乐场所数据来源自主定义
开始条件顾客NPC发出点餐指令
结束条件顾客NPC发出指令表示不再需要服务
"""
# todo: 使用大模型进行对话,获得指令信息,适时结束对话
# order = {...}
from robowaiter.scene.scene import Scene
class SceneGQA(Scene):
def __init__(self, robot):
super().__init__(robot)
# 在这里加入场景中发生的事件, (事件发生的时间,事件函数)
self.event_list = [
(5, self.create_chat_event("洗手间在哪里")),
(12, self.create_chat_event("可以带我去吗")),
]
def _reset(self):
self.clean_walker()
self.add_walker(50, 500, 0)
self.walker_bubble("洗手间在哪里")
# self.control_walker([self.walker_control_generator(0, False, 100, 755, 1900, 180)])
def _run(self):
pass
if __name__ == '__main__':
import os
from robowaiter.robot.robot import Robot
robot = Robot()
# create task
task = SceneGQA(robot)
task.reset()
task.run()