No project description provided
Project description
Eggscript
Eggscript is a markup language that can be "compiled" into a valid OVOS Skill
EXPERIMENTAL This is an experimental feature
It is intended as an easy way for user to create simple skills, while offering an easy transition to regular skills
It also helps getting a lot of the boilerplate done for you when getting started
Crash Course
Example files written in eggscript
hello.eggscript
// this is a comment
// all comments and blank lines are ignored
// special interperter variables can be set with @var syntax
// - @name -> skill name
// - @author -> skill author
// - @email -> author contact
// - @license -> skill license
// - @interpreter -> supported interperter, eg, cli
// - @compiler -> supported compiler, eg, mycroft skill
@author jarbasai
@email jarbasai@mailfence.com
@license MIT
@name hello world
@url https://github.com/author/repo
@version 0.1.0
// this script can be used standalone in the cli
@interpreter cli
// a standalone python file can be generated
@compiler cli
// a mycroft skill can be generated
@compiler mycroft
// intent definition
# hello world
+ hello world
- hello world
// you can define python code
```
hello = "world"
if hello == "world":
print("python code!")
```
dialogs.eggscript
// this is a comment
// all comments and blank lines are ignored
// text after # is the intent name
# hello world
// text after + is the user utterance
+ hello world
// text after - is mycroft's response
- hello world
# weather in location
// you can capture variables and use them using {var} syntax
+ how is the weather in {location}
- how am i supposed to know the weather in {location}
# weather
// this will create a intent file with the 3 + utterances
+ what is the weather like
+ how is the weather
+ how does it look outside
// this will create a dialog file with the 2 - utterances
- i do not know how to check the weather
- stick your head ouf of the window and check for yourself
# count to 10
+ count to 10
// if ident level matches its an alternate dialog
- i will only count to 5
- i only know how to count to 5
// use tab for identation
// each ident level defines a new utterance to be spoken
- 1
- 2
- 3
- 4
- 5
layers.eggscript
// this is a comment
// all comments and blank lines are ignored
// this sample scripts show intent layers usage
// the number of # in intent definition determines an intent layer
# tell me about
+ tell me about {thing}
- {thing} exists
// N times + will enable layer N
// to enable layer 2
++
// use N times # for layer N
// this intent is in layer 2, enabled by previous intent
## tell me more
+ tell me more
+ continue
- i do not know more
// N times - will disable layer N
// to disable layer 2
--
Interpreters
Can run a subset of eggscript directly, enough to test simple skills in the terminal
from eggscript import CliInterpreter
from os.path import dirname
c = CliInterpreter()
c.load_eggscript_file(f"{dirname(__file__)}/dialogs.eggscript")
c.run()
Compilers
from eggscript import OVOSSkillCompiler
from os.path import dirname
c = OVOSSkillCompiler()
c.load_eggscript_file(f"{dirname(__file__)}/layers.eggscript")
c.export("myskill")
You can now continue extending your exported skill to add more advanced functionality
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file ovos_eggscript-0.0.0-py3-none-any.whl
.
File metadata
- Download URL: ovos_eggscript-0.0.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cba3b7f2fdbeb1b9b6e93927a8241525b0250c1cce2aa6ea7447d7f5aad1ae90 |
|
MD5 | ce688c44d100799372bbf81ded91cd42 |
|
BLAKE2b-256 | e1f6005065face9a3a141acdbdf0ab2c72ca79abf72ad74d3aeb7342824b11be |