方便NLP的测试

This commit is contained in:
ChenXL97 2023-11-19 14:46:31 +08:00
parent de79f4c448
commit d44b0389b8
2 changed files with 79 additions and 0 deletions

View File

@ -0,0 +1,32 @@
selector
{
sequence
{
cond CustomerChatting()
act DealChatNLP()
}
sequence
{
cond HasSubTask()
sequence
{
act SubTaskPlaceHolder()
}
}
sequence
{
cond FocusingCustomer()
act ServeCustomer()
}
sequence
{
cond NewCustomerComing()
selector
{
cond At(Robot,Bar)
act MoveTo(Bar)
}
act GreetCustomer()
}
}

View File

@ -0,0 +1,47 @@
"""
具身多轮对话 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.new_event_list = [
(3, self.customer_say, ("System","哪里有蛋糕"))
]
def _reset(self):
# self.clean_walker()
# self.add_walkers([[50, 500,90]])
pass
# 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
from robowaiter.utils.basic import get_root_path
root_path = get_root_path()
ptml_path = os.path.join(root_path, 'robowaiter/robot/DefaultNLP.ptml')
robot = Robot(ptml_path=ptml_path)
# create task
task = SceneGQA(robot)
task.reset()
task.run()