From 3b7bdda990a735561b83199d6be970c78d035e89 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 3 Jun 2024 16:43:36 +0200 Subject: [PATCH] Minor fixes --- ...of-voice-assistant-integrations-in-2024.md | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/markdown/The-state-of-voice-assistant-integrations-in-2024.md b/markdown/The-state-of-voice-assistant-integrations-in-2024.md index d1a4c40..3170262 100644 --- a/markdown/The-state-of-voice-assistant-integrations-in-2024.md +++ b/markdown/The-state-of-voice-assistant-integrations-in-2024.md @@ -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: