some fixes + gliner first implementation

This commit is contained in:
Priler 2026-02-11 07:21:50 +05:00
parent b9d5f41bbd
commit a8ff3442ff
36 changed files with 1079 additions and 73 deletions

View file

@ -1,14 +0,0 @@
[[commands]]
id = "hello"
type = "lua"
script = "script.lua"
sandbox = "minimal"
timeout = 5000
phrases.ru = [
"привет",
"здравствуй",
]
phrases.en = [
"hello",
"hi",
]

View file

@ -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 }

View 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"

View file

@ -0,0 +1,2 @@
local name = jarvis.context.slots.name or "[UNKNOWN]"
print("Hello, " .. name .. "!")

View file

@ -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]]