From f5faa2ef095f035110f83e17da0b35d3a34d6b97 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Sat, 17 Feb 2024 19:52:53 -0700 Subject: bump --- docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html') diff --git a/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html b/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html index a450b55..8df15ef 100644 --- a/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html +++ b/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html @@ -26,7 +26,7 @@ - + @@ -35,6 +35,7 @@ home | about/links | posts | +3D designs | RSS Feed | -- cgit v1.2.3 From f6d2141a480dd6b5b8ee0e48d43bb64773232791 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Tue, 26 Mar 2024 23:38:14 -0600 Subject: add header ids --- ...02-08-Interact-with-siri-from-the-terminal.html | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html') diff --git a/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html b/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html index 8df15ef..0c23964 100644 --- a/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html +++ b/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html @@ -6,13 +6,13 @@ - Interacting with Siri using the command line + id="interacting-with-siri-using-the-command-line">Interacting with Siri using the command line - - + Interacting with Siri using the command line" /> + Interacting with Siri using the command line" /> @@ -44,11 +44,11 @@
-

Interacting with Siri using the command line

+

Interacting with Siri using the command line

My main objective was to see if I could issue multi-intent commands in one go. Obviously, Siri cannot do that (neither can Alexa, Cortana, or Google Assistant). The script here can issue either a single command, or use the help of OpenAI's DaVinci model to extract multiple commands and pass them onto siri.

-

Prerequisites

+

Prerequisites

  • Run macOS
  • @@ -56,7 +56,7 @@
  • Enable the Terminal to control System Events (The first time you run the script, it will prompt you to enable it)
-

Show me ze code

+

Show me ze code

If you are here just for the code:

@@ -136,11 +136,11 @@ python3 main.py & -

ELI5

+

ELI5

I am not actually going to explain it as if I am explaining to a five-year old kid.

-

AppleScript

+

AppleScript

In the age of Siri Shortcuts, AppleScript can still do more. It is a scripting language created by Apple that can help you automate pretty much anything you see on your screen.

@@ -191,11 +191,11 @@ python3 main.py & -

Multi-Intent Commands

+

Multi-Intent Commands

We can call OpenAI's API to autocomplete our prompt and extract multiple commands. We don't need to use OpenAI's API, and can also simply use Google's Flan-T5 model using HuggingFace's transformers library.

-

Ze Prompt

+

Ze Prompt

You are provided with multiple commands as a single command. Break down all the commands and return them in a list of strings. If you are provided with a single command, return a list with a single string, trying your best to understand the command.
@@ -217,7 +217,7 @@ python3 main.py &
 
 

This prompt gives the model a few examples to increase the generation accuracy, along with instructing it to return a Python list.

-

Ze Code

+

Ze Code

import openai
@@ -251,7 +251,7 @@ python3 main.py &
 
-

Gluing together code

+

Gluing together code

To finish it all off, we can use argparse to only send the input command to OpenAI when asked to do so.

@@ -271,7 +271,7 @@ python3 main.py &
-

Conclusion

+

Conclusion

Siri is still dumb. When I ask it to Switch off the lights, it default to the home thousands of miles away. But, this code snippet definitely does work!

-- cgit v1.2.3 From 9e620084e57378952c1a7f8e0a772ebebd18932b Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Wed, 27 Mar 2024 20:35:09 -0600 Subject: quick fix --- docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html') diff --git a/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html b/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html index 0c23964..29322a1 100644 --- a/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html +++ b/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html @@ -6,13 +6,13 @@ - id="interacting-with-siri-using-the-command-line">Interacting with Siri using the command line + Interacting with Siri using the command line - Interacting with Siri using the command line" /> - Interacting with Siri using the command line" /> + + -- cgit v1.2.3 From 01ff93c9c16867216f2d249664803860e1d6d5eb Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Wed, 27 Mar 2024 22:49:40 -0600 Subject: generate new theme --- ...02-08-Interact-with-siri-from-the-terminal.html | 55 +++++++++++++++------- 1 file changed, 37 insertions(+), 18 deletions(-) (limited to 'docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html') diff --git a/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html b/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html index 29322a1..e31fb80 100644 --- a/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html +++ b/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html @@ -2,14 +2,26 @@ - + + + + + Interacting with Siri using the command line + + + + + + + - Interacting with Siri using the command line - @@ -29,21 +41,27 @@ - -
-
+ + +
-
- +

Interacting with Siri using the command line

My main objective was to see if I could issue multi-intent commands in one go. Obviously, Siri cannot do that (neither can Alexa, Cortana, or Google Assistant). The script here can issue either a single command, or use the help of OpenAI's DaVinci model to extract multiple commands and pass them onto siri.

@@ -275,14 +293,15 @@ python3 main.py &

Siri is still dumb. When I ask it to Switch off the lights, it default to the home thousands of miles away. But, this code snippet definitely does work!

+
If you have scrolled this far, consider subscribing to my mailing list here. You can subscribe to either a specific type of post you are interested in, or subscribe to everything with the "Everything" list.
-
+
-- cgit v1.2.3 From de19543d7fb44d343b052dc9b34ede78620c4a46 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Wed, 27 Mar 2024 23:36:55 -0600 Subject: Generate --- .../2023-02-08-Interact-with-siri-from-the-terminal.html | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html') diff --git a/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html b/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html index e31fb80..86c017a 100644 --- a/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html +++ b/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html @@ -46,7 +46,7 @@ + +
-- cgit v1.2.3 From a982ceab0b45609991179b3020a00260eed6f798 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Wed, 27 Mar 2024 23:45:59 -0600 Subject: css --- docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html') diff --git a/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html b/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html index 86c017a..7f99f0d 100644 --- a/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html +++ b/docs/posts/2023-02-08-Interact-with-siri-from-the-terminal.html @@ -5,6 +5,7 @@ + Interacting with Siri using the command line -- cgit v1.2.3