Minor fixes
This commit is contained in:
parent
9ce776edfa
commit
3b7bdda990
1 changed files with 24 additions and 23 deletions
|
@ -803,6 +803,7 @@ def ai_assist(event: SpeechRecognizedEvent):
|
||||||
hooks = (
|
hooks = (
|
||||||
(re.compile(r"play (the)?music", re.IGNORECASE), play_music),
|
(re.compile(r"play (the)?music", re.IGNORECASE), play_music),
|
||||||
(re.compile(r"stop (the)?music", re.IGNORECASE), stop_music),
|
(re.compile(r"stop (the)?music", re.IGNORECASE), stop_music),
|
||||||
|
# ...
|
||||||
# Fallback to the AI assistant
|
# Fallback to the AI assistant
|
||||||
(re.compile(r".*"), ai_assist),
|
(re.compile(r".*"), ai_assist),
|
||||||
)
|
)
|
||||||
|
@ -1037,31 +1038,31 @@ This means two things:
|
||||||
initialize the assistant with some predefined knowledge in the form of
|
initialize the assistant with some predefined knowledge in the form of
|
||||||
hypothetical past conversations. Example:
|
hypothetical past conversations. Example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
openai:
|
openai:
|
||||||
...
|
...
|
||||||
|
|
||||||
context:
|
context:
|
||||||
# `system` can be used to initialize the context for the expected tone
|
# `system` can be used to initialize the context for the expected tone
|
||||||
# and language in the assistant responses
|
# and language in the assistant responses
|
||||||
- role: system
|
- role: system
|
||||||
content: >
|
content: >
|
||||||
You are a voice assistant that responds to user queries using
|
You are a voice assistant that responds to user queries using
|
||||||
references to Lovecraftian lore.
|
references to Lovecraftian lore.
|
||||||
|
|
||||||
# `user`/`assistant` interactions can be used to initialize the
|
# `user`/`assistant` interactions can be used to initialize the
|
||||||
# conversation context with previous knowledge. `user` is used to
|
# conversation context with previous knowledge. `user` is used to
|
||||||
# emulate previous user questions, and `assistant` models the
|
# emulate previous user questions, and `assistant` models the
|
||||||
# expected response.
|
# expected response.
|
||||||
- role: user
|
- role: user
|
||||||
content: What is a telephone?
|
content: What is a telephone?
|
||||||
- role: assistant
|
- role: assistant
|
||||||
content: >
|
content: >
|
||||||
A Cthulhuian device that allows you to communicate with
|
A Cthulhuian device that allows you to communicate with
|
||||||
otherworldly beings. It is said that the first telephone was
|
otherworldly beings. It is said that the first telephone was
|
||||||
created by the Great Old Ones themselves, and that it is a
|
created by the Great Old Ones themselves, and that it is a
|
||||||
gateway to the void beyond the stars.
|
gateway to the void beyond the stars.
|
||||||
```
|
```
|
||||||
|
|
||||||
If you now start Platypush and ask a question like "*how does it work?*",
|
If you now start Platypush and ask a question like "*how does it work?*",
|
||||||
the voice assistant may give a response along the lines of:
|
the voice assistant may give a response along the lines of:
|
||||||
|
|
Loading…
Reference in a new issue