some fixes + gliner first implementation
This commit is contained in:
parent
e367d11b7c
commit
b427eacf35
36 changed files with 1079 additions and 73 deletions
|
|
@ -1,14 +0,0 @@
|
|||
[[commands]]
|
||||
id = "hello"
|
||||
type = "lua"
|
||||
script = "script.lua"
|
||||
sandbox = "minimal"
|
||||
timeout = 5000
|
||||
phrases.ru = [
|
||||
"привет",
|
||||
"здравствуй",
|
||||
]
|
||||
phrases.en = [
|
||||
"hello",
|
||||
"hi",
|
||||
]
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
-- simple test hello command
|
||||
|
||||
local lang = jarvis.context.language
|
||||
local hour = tonumber(jarvis.context.time.hour)
|
||||
|
||||
-- determine greeting based on time
|
||||
local greeting
|
||||
if hour >= 5 and hour < 12 then
|
||||
greeting = lang == "ru" and "Доброе утро" or "Good morning"
|
||||
elseif hour >= 12 and hour < 17 then
|
||||
greeting = lang == "ru" and "Добрый день" or "Good afternoon"
|
||||
elseif hour >= 17 and hour < 22 then
|
||||
greeting = lang == "ru" and "Добрый вечер" or "Good evening"
|
||||
else
|
||||
greeting = lang == "ru" and "Доброй ночи" or "Good night"
|
||||
end
|
||||
|
||||
jarvis.log("info", "Greeting user: " .. greeting)
|
||||
jarvis.audio.play_reply()
|
||||
|
||||
return { chain = true }
|
||||
14
resources/commands/test_slots/command.toml
Normal file
14
resources/commands/test_slots/command.toml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
[[commands]]
|
||||
id = "test_greet_name"
|
||||
type = "lua"
|
||||
script = "greet.lua"
|
||||
|
||||
[commands.phrases]
|
||||
en = ["say hello to {name}", "greet {name}"]
|
||||
ru = ["поздоровайся с {name}", "привет {name}"]
|
||||
|
||||
[commands.slots.name]
|
||||
entity = "person name"
|
||||
|
||||
[commands.slots.city]
|
||||
entity = "city name"
|
||||
2
resources/commands/test_slots/greet.lua
Normal file
2
resources/commands/test_slots/greet.lua
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
local name = jarvis.context.slots.name or "[UNKNOWN]"
|
||||
print("Hello, " .. name .. "!")
|
||||
|
|
@ -6,19 +6,16 @@ timeout = 5000
|
|||
sandbox = "standard"
|
||||
|
||||
[commands.phrases]
|
||||
ru = [
|
||||
"какая погода",
|
||||
"погода"
|
||||
]
|
||||
en = [
|
||||
"what's the weather",
|
||||
"weather"
|
||||
]
|
||||
ru = ["какая погода в {city}", "погода {city}"]
|
||||
en = ["what's the weather in {city}", "weather in {city}"]
|
||||
|
||||
[commands.sounds]
|
||||
ru = ["weather_ru_1", "weather_ru_2"]
|
||||
en = ["weather_en_1", "weather_en_2"]
|
||||
|
||||
[commands.slots.city]
|
||||
entity = "city name"
|
||||
context = ["in", "for", "at", "в", "для"]
|
||||
|
||||
|
||||
[[commands]]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue