You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by if...@apache.org on 2021/03/19 01:58:19 UTC

[incubator-nlpcraft] 24/27: NLPCRAFT-91: Add examples to MinecraftModel

This is an automated email from the ASF dual-hosted git repository.

ifropc pushed a commit to branch NLPCRAFT-91
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git

commit 9ddba5e5a6a4fe05878100de0f72f59722fff985
Author: Ifropc <if...@apache.org>
AuthorDate: Mon Feb 22 18:38:52 2021 -0800

    NLPCRAFT-91: Add examples to MinecraftModel
---
 .../kotlin/org/apache/nlpcraft/example/MinecraftModel.kt  | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/nlpcraft-examples/minecraft-model/src/main/kotlin/org/apache/nlpcraft/example/MinecraftModel.kt b/nlpcraft-examples/minecraft-model/src/main/kotlin/org/apache/nlpcraft/example/MinecraftModel.kt
index 2cc667c..68efd43 100644
--- a/nlpcraft-examples/minecraft-model/src/main/kotlin/org/apache/nlpcraft/example/MinecraftModel.kt
+++ b/nlpcraft-examples/minecraft-model/src/main/kotlin/org/apache/nlpcraft/example/MinecraftModel.kt
@@ -26,6 +26,7 @@ import java.util.*
 @Suppress("unused")
 class MinecraftModel : NCModelFileAdapter("minecraft.yaml") {
     @NCIntentRef("weatherIntent")
+    @NCIntentSample("make it rain")
     fun onWeatherMatch(ctx: NCIntentMatch, @NCIntentTerm("arg") tok: NCToken): NCResult {
         if (ctx.isAmbiguous) {
             throw NCRejection("Ambiguous request")
@@ -35,6 +36,7 @@ class MinecraftModel : NCModelFileAdapter("minecraft.yaml") {
     }
 
     @NCIntentRef("timeIntent")
+    @NCIntentSample("set time to evening")
     fun onTimeMatch(ctx: NCIntentMatch, @NCIntentTerm("arg") tok: NCToken): NCResult {
         if (ctx.isAmbiguous) {
             throw NCRejection("Ambiguous request")
@@ -54,6 +56,11 @@ class MinecraftModel : NCModelFileAdapter("minecraft.yaml") {
     }
 
     @NCIntentRef("giveIntent")
+    @NCIntentSample(
+        "give me iron sword",
+        "give me 10 grass blocks",
+        "give PlayerName a jigsaw"
+    )
     fun onGiveMatch(
         ctx: NCIntentMatch,
         @NCIntentTerm("item") item: NCToken,
@@ -72,6 +79,14 @@ class MinecraftModel : NCModelFileAdapter("minecraft.yaml") {
     }
 
     @NCIntentRef("fillIntent")
+    @NCIntentSample(
+        "make a box of sand in front of me",
+        "make a cube of gold near me",
+        "make a line of grass with length of 2 near me",
+
+        "create a rectangle of dirt in front of PlayerName",
+        "make a box of sand with the size of 2 10 meters in front of me"
+    )
     fun onFillMatch(
         ctx: NCIntentMatch,
         @NCIntentTerm("shape") shape: NCToken,