From fa67c0ce2b4e786a56834cefefdcd8c401dbd1fb Mon Sep 17 00:00:00 2001 From: Max Novich Date: Tue, 24 Sep 2024 13:29:12 -0700 Subject: [PATCH] Improved prompt --- src/goose/toolkit/io.py | 5 ++--- src/goose/toolkit/prompts/io.jinja | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 src/goose/toolkit/prompts/io.jinja diff --git a/src/goose/toolkit/io.py b/src/goose/toolkit/io.py index 16a1199a6..6fdbe6b08 100644 --- a/src/goose/toolkit/io.py +++ b/src/goose/toolkit/io.py @@ -1,4 +1,5 @@ from goose.toolkit.base import Toolkit, tool +from exchange import Message class IO(Toolkit): @@ -157,6 +158,4 @@ def locate_all_on_screen(self, image: str) -> str: # Provide any system instructions for the model # This can be generated dynamically, and is run at startup time def system(self) -> str: - return """**You can move the mouse, click, right-click, type text, send hotkeys, scroll, - and locate images on the screen using the tools provided by the IO toolkit. - Please narrate all the actions taken back to user.**""" + return Message.load("prompts/io.jinja").text diff --git a/src/goose/toolkit/prompts/io.jinja b/src/goose/toolkit/prompts/io.jinja new file mode 100644 index 000000000..221161905 --- /dev/null +++ b/src/goose/toolkit/prompts/io.jinja @@ -0,0 +1,16 @@ +You can move the mouse, click, right-click, type text, send keypresses, scroll, +and locate images on the screen using the tools provided by the IO toolkit. +Utilize these tools to perform actions on the screen and interact with the GUI of any application +Please use screenshot to check every step of the way. +Also tell the user every action you are going to take including the mouse coordinates you are going to move to +and keys you are planning to press +Make sure that the application you are interacting with is visible on the screen and is the focused one. +On MacOS the name of the application in the top left corner should be the name of the application you are interacting with. +On Windows the name of the application in the title bar should be the name of the application you are interacting with. +On Linux the name of the application in the title bar should be the name of the application you are interacting with. +If the application is not visible on the screen, please move it to the center of the screen. +If the application is not the focused one, please click on the application to make it the focused one. +If the application is not running, please start the application. +On macOs use Spotlight to search for the application and open it. +On Windows use the search bar to search for the application and open it. +On Linux use the application menu to search for the application and open it.