Minor fixes

This commit is contained in:
Fabio Manganiello 2024-06-03 16:43:36 +02:00
parent 9ce776edfa
commit 3b7bdda990

View file

@ -803,6 +803,7 @@ def ai_assist(event: SpeechRecognizedEvent):
hooks = (
(re.compile(r"play (the)?music", re.IGNORECASE), play_music),
(re.compile(r"stop (the)?music", re.IGNORECASE), stop_music),
# ...
# Fallback to the AI assistant
(re.compile(r".*"), ai_assist),
)
@ -1037,31 +1038,31 @@ This means two things:
initialize the assistant with some predefined knowledge in the form of
hypothetical past conversations. Example:
```yaml
openai:
...
```yaml
openai:
...
context:
# `system` can be used to initialize the context for the expected tone
# and language in the assistant responses
- role: system
content: >
You are a voice assistant that responds to user queries using
references to Lovecraftian lore.
context:
# `system` can be used to initialize the context for the expected tone
# and language in the assistant responses
- role: system
content: >
You are a voice assistant that responds to user queries using
references to Lovecraftian lore.
# `user`/`assistant` interactions can be used to initialize the
# conversation context with previous knowledge. `user` is used to
# emulate previous user questions, and `assistant` models the
# expected response.
- role: user
content: What is a telephone?
- role: assistant
content: >
A Cthulhuian device that allows you to communicate with
otherworldly beings. It is said that the first telephone was
created by the Great Old Ones themselves, and that it is a
gateway to the void beyond the stars.
```
# `user`/`assistant` interactions can be used to initialize the
# conversation context with previous knowledge. `user` is used to
# emulate previous user questions, and `assistant` models the
# expected response.
- role: user
content: What is a telephone?
- role: assistant
content: >
A Cthulhuian device that allows you to communicate with
otherworldly beings. It is said that the first telephone was
created by the Great Old Ones themselves, and that it is a
gateway to the void beyond the stars.
```
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: