AIML 聊天机器人响应在不同时间有所不同?

2023-12-27

我在上一篇文章中针对 AIML 机器人提出了一个单独的问题...如何创建一个在一天中不同时间做出响应的机器人?我觉得这会让他看起来更“真实”。

我无法弄清楚日期和时间显示的实际工作原理。我认为您必须与设置/获取函数一起摆弄它......但这就是我所知道的。

我希望我的机器人做这样的事情。

时间:中午

用户:嗨,机器人。

机器人:下午好,用户!对我来说已经是午餐时间了。

我从哪说起呢?谢谢。


您需要检查时间,然后使用条件给出适当的响应。在这个类别中,即使有人在半夜说“早上好”,机器人也会做出明智的反应

<category>
<pattern>GOOD MORNING</pattern>
<template>
    <think><set name="hour"><date format="%H"/></set></think>
    <condition name="hour">
        <li value="00">Hello, it's more like the middle of the night than morning. How are you this morning?</li>
        <li value="01">Hello, it's only just morning. How are you this morning?</li>
        <li value="02">Hello and how are you this morning?</li>
        <li value="03">Hello and how are you this morning?</li>
        <li value="04">Hello and how are you this morning?</li>
        <li value="05">Hello and how are you this morning?</li>
        <li value="06">Hello and how are you this morning?</li>
        <li value="07">Hello and how are you this morning?</li>
        <li value="08">Hello and how are you this morning?</li>
        <li value="09">Hello and how are you this morning?</li>
        <li value="10">Hello and how are you this morning?</li>
        <li value="11">Hello and how are you this morning?</li>
        <li value="12">You're a bit late. It's lunchtime here.</li>
        <li value="13">Morning?! It's the afternoon here.</li>
        <li value="14">Morning?! It's the afternoon here.</li>
        <li value="15">Morning?! It's the afternoon here.</li>
        <li value="16">Morning?! It's the afternoon here.</li>
        <li value="17">Morning?! It's nearly evening.</li>
        <li value="18">Morning?! It's evening here.</li>
        <li value="19">Morning?! It's evening here.</li>
        <li value="20">Morning?! It's evening here.</li>
        <li value="21">Morning?! It's night time here.</li>
        <li value="22">Morning?! It's night time here.</li>
        <li value="23">Morning?! It's night time here.</li>
    </condition>
</template>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

AIML 聊天机器人响应在不同时间有所不同? 的相关文章

随机推荐