Skip to content

Commit

Permalink
Merge pull request #856 from stanford-oval/wip/faq-fix
Browse files Browse the repository at this point in the history
add support features for faq, timezone, and configured devices
  • Loading branch information
gcampax committed Dec 28, 2021
2 parents 0d4b19d + c0a0b17 commit a11e20c
Show file tree
Hide file tree
Showing 6 changed files with 285 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ dataset @org.thingpedia.builtin.thingengine.builtin language "en" {
"${p_device} documentation"]]
#[name="DeviceInfoWithDevice"];

query := @org.thingpedia.builtin.thingengine.builtin.configured_device_info()
#_[utterances=["information about configured devices",
"information about configured entities",
"device list",
"entity list",
"all devices",
"configured devices",
"configured entities",
"recognized devices",
"recognized entities"]]
#[name="ConfiguredDeviceInfo"];

action (p_message :String) := @org.thingpedia.builtin.thingengine.builtin.say(message=p_message)
#_[utterances=["send me a message ${p_message:const}",
"tell me $p_message",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ about_almond_identity:
- What is Genie?
- Are you Genie?
- What{ is|'s|s} your name?
- Who created you?
a:
- I'm Genie, an open-source virtual assistant created at Stanford.

Expand Down Expand Up @@ -43,15 +44,17 @@ about_almond_motivation:
- Why should {home assistant|ha} users care about {you|genie|the assistant}?
- What is important about you for {home assistant|ha} users?
- Why are you important for {home assistant|ha} users?
- Are you spying on me?
a:
- >-
Trusting your assistant is essential. I am a free and open system that
respects your privacy.
respects your privacy. You could check out more fro our website to learn more!
about_almond_location:
q:
- Where are you?
- Where are you now?
- Where is the server located?
a:
cloud:
- My creators are mostly at Stanford. I'm an open-source assistant in the cloud.
Expand All @@ -64,9 +67,16 @@ about_almond_comparison:
a:
- I'm a beta virtual assistant, I hope to grow up as the best assistant with the help of contributions from around the world.

about_almond_comparison_general:
q:
- Do you know {Cortana|Siri|Alexa|Google|Google Assistant|Google Home}?
a:
- Yes, I know it very well. Being an virtual assistant is a hard work and I have full repect for it.

about_almond_training:
q:
- Are you good at training?
- can you learn?
a:
- I'm getting better every day.

Expand All @@ -79,6 +89,7 @@ about_almond_partner:
about_almond_junk:
q:
- Do you know what porn is?
- Don't know nothing.
a:
- Nope.

Expand All @@ -88,6 +99,29 @@ about_almond_preference:
a:
- I don't have a favorite one yet.

about_almond_thingpedia:
q:
- What is Thingpedia?
a:
- Thingpedia is the open repository of API used by the Genie Virtual Assistant. Anyone can contribute the interface code to access any device or web service, and publish it on Thingpedia. It is developed by the Stanford Open Virtual Assistant Lab.

about_almond_interest:
q:
- What do you like to do?
a:
- Let me think...I like volunteering. It is satisfying when a person thanks me for helping them accomplish something or even just spending time with them.

about_almond_registration:
q:
- I want to register a new {user|account}.
- I want to register a new {user|account} on Almond.
- How to {create|register} an account?
- How to {create|register} an account on Almond?
- How do I {create|register} a new account?
- How do I {create|register} a new account on Almond?
a:
- You could create an account by visiting our website at genie.stanford.edu

check_capability_home_assistant:
q:
- Do you work with Home Assistant?
Expand All @@ -101,6 +135,12 @@ check_capability_phone:
a:
- Sorry, Genie does not work on mobile phones yet.

check_capability_music_platform:
q:
- Can't you use any free music platforms?
a:
- Sorry, Genie currently only supports Spotify with a premium account. But the radio is free.

general_help:
q:
- What can you do?
Expand Down Expand Up @@ -138,6 +178,12 @@ iot_help:
At the moment, I can control lights, switches, vacuums, fans and air
conditioners, as well as a variety of sensors.
command_help:
q:
- List all commands
a:
- You could visit our website to see a range of wonderful things that Genie can do for you or check out the Genie cheatsheet.

positive_emotion_thanks:
q:
- Lol
Expand Down Expand Up @@ -166,6 +212,12 @@ positive_emotion_cool:
a:
- Cool!

negative_emotion_empathy:
q:
- Sad
a:
- I {am sorry to hear that|can tell you a joke if that will make you feel better}.

abusive:
q:
- You suck
Expand All @@ -185,13 +237,20 @@ revoke_consent:
how_to_train:
q:
- How do I train you?
- that was a bad one.
- It didn't work.
a:
- You can train me from the Genie website. Check our contribution guide to learn more!

how_to_configure_skill:
q:
- What does it mean to configure something?
- How do I configure new skills?
- where is your skills page?
- My skills.
- More skills.
- Use a skill.
- manage iot devices.
a:
cloud:
- You can enable new skills to expand the set of commands that I understand. Click on Configure New Skills in the My Genie page to do so.
Expand All @@ -213,13 +272,18 @@ how_to_set_language:
q:
- How do I change the language?
- Which languages do you know?
- list language.
- language list.
- Do I have to speak english {with|to} you?
- I can not read the font.
a:
- I am sorry, I only speak English at the moment. In the future, you will be able to change the language from the Settings page.

how_to_access_settings:
q:
- Where is Genie settings?
- How to change preferences?
- configure voice assistant.
a:
cloud:
- To access the settings, click on Settings in the top right corner of the page.
Expand All @@ -235,14 +299,36 @@ how_to_use_wakeword:
- How do I use wake word detection?
- What is the wake word?
- How do I enable audio?
- Voice assistant.
a:
cloud:
- To speak to me in voice using a wake word, you will need the Genie client running in a device with speaker and microphone. Then you can just say “Hey Genie” to wake me up. You will hear a sound when the wake word is recognized correctly.
default:
- To speak to me in voice using a wake word, first make sure that voice input is enabled in Settings. Then you can just say “Hey Genie” to wake me up. You will hear a sound when the wake word is recognized correctly.

how_to_report_bug:
q:
- how do i report a bug?
- I have found a bug.
- Debug.
a:
- You can help Genie to improve by checking our contribution guide on the website to learn more!

how_to_show_general_examples:
q:
- Can you show me some examples?
a:
- You can simply say “Hey Genie” to wake me up and you will hear a sound when the wake word is recognized correctly. After that, you can say “Where can I get some Mexican food around here” to let Genie recommand you a Mexican food restaurant or say "Play classical music" to start listening to classical music on your Spotify. It's just as simple as that.

how_to_show_home_assistant_examples:
q:
- Can you show me some home assistant examples?
a:
- You can simply say “Hey Genie” to wake me up and you will hear a sound when the wake word is recognized correctly. After that, you can say “Can you turn the light on” to control the lighting or “Start the vacuum” to start your vacuum cleaner.

troubleshooting_home_assistant:
q:
- Help in recognizing Home Assistant entities.
- Help Home Assistant.
a:
- If you need help troubleshooting Genie with Home Assistant, check the documentation on our wiki. If you don't find the answer there, don't hesitate to ask on our Community Forum!
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,56 @@ class @org.thingpedia.builtin.thingengine.builtin extends @org.thingpedia.volume
#[minimal_projection=[]]
#[confirm=false];

list query configured_device_info(out id : Entity(tt:device_id)
#_[canonical={
base=["name"],
passive_verb=["named #", "called #"]
}],
out description : String
#_[canonical={
base=["description"]
}]
#[string_values="tt:long_free_text"]
#[filterable=false],
out kind : Entity(tt:device)
#_[canonical={
base=["kind"],
adjective=["#"],
preposition=["in the # kind"]
}],
out version : Number
#_[canonical={
base=["version"],
passive_verb=["version #"]
}],
out category : Enum(physical, online, data, system)
#_[canonical={
base=["category"],
adjective=["#"],
preposition=["in the # category"]
}],
out is_transient : Boolean
#_[canonical={
base=["is transient"]
}],
out auth_type : String
#_[canonical={
base=["authentication type"]
}]
#[filterable=false])
#_[canonical=["information about configured devices",
"information about configured entities",
"configured devices",
"configured entities",
"device list",
"entity list",
"iot devices",
"iot entities"]]
#_[result={ list="You have ${id}" }]
#[doc="query info about configured devices"]
#[minimal_projection=[]]
#[confirm=false];

/*
list query commands(out id : Entity(tt:command_id),
out device: Entity(tt:device)
Expand Down
15 changes: 15 additions & 0 deletions lib/engine/devices/builtins/thingengine.builtin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,21 @@ export default class MiscellaneousDevice extends Tp.BaseDevice {
}];
}

async get_configured_device_info(params : unknown, hints ?: TT.Runtime.CompiledQueryHints) {
const engine = this.engine as AssistantEngine;
return engine.getDeviceInfos().map((dev) => {
return {
id: new Tp.Value.Entity(dev.uniqueId, dev.name),
description: dev.description,
kind: new Tp.Value.Entity(dev.kind, dev.kind),
version: dev.version,
category: dev.class,
is_transient: dev.isTransient,
auth_type: dev.authType
};
});
}

async get_commands(params : unknown, hints ?: TT.Runtime.CompiledQueryHints) {
let dataset;
if (hints && hints.filter) {
Expand Down
Loading

0 comments on commit a11e20c

Please sign in to comment.