updated win func
This commit is contained in:
		@@ -86,9 +86,11 @@ def wait(duration: float) -> None:
 | 
				
			|||||||
    """Waits for the specified duration in seconds."""
 | 
					    """Waits for the specified duration in seconds."""
 | 
				
			||||||
    time.sleep(duration)
 | 
					    time.sleep(duration)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def windows_key() -> None:
 | 
					def search_pc(query: str) -> None:
 | 
				
			||||||
    """Presses the Windows key."""
 | 
					    """Presses the Windows key."""
 | 
				
			||||||
    pyautogui.hotkey('win')
 | 
					    pyautogui.hotkey('win')
 | 
				
			||||||
 | 
					    wait(2)
 | 
				
			||||||
 | 
					    press_keyboard(KeyboardInput(text=query))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def reprompt(nextsteps: str, processor) -> None:
 | 
					def reprompt(nextsteps: str, processor) -> None:
 | 
				
			||||||
    """Re-execute GPT and take a new screenshot."""
 | 
					    """Re-execute GPT and take a new screenshot."""
 | 
				
			||||||
@@ -102,7 +104,7 @@ def _execute(name, args=[], processor=None):
 | 
				
			|||||||
        press_keyboard(KeyboardInput(**args))
 | 
					        press_keyboard(KeyboardInput(**args))
 | 
				
			||||||
    elif name == "wait":
 | 
					    elif name == "wait":
 | 
				
			||||||
        wait(**args)
 | 
					        wait(**args)
 | 
				
			||||||
    elif name == "windows_key":
 | 
					    elif name == "search_pc":
 | 
				
			||||||
        windows_key()
 | 
					        search_pc(**args)
 | 
				
			||||||
    elif name == "reprompt":
 | 
					    elif name == "reprompt":
 | 
				
			||||||
        reprompt(**args, processor=processor)
 | 
					        reprompt(**args, processor=processor)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -114,12 +114,16 @@ FUNCTIONS = [
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
        "type": "function",
 | 
					        "type": "function",
 | 
				
			||||||
        "function": {
 | 
					        "function": {
 | 
				
			||||||
            "name": "windows_key",
 | 
					            "name": "search_pc",
 | 
				
			||||||
            "description": "Open the Start menu. Best to perform web searches, search apps, search settings, run Windows internal softwares, etc.",
 | 
					            "description": "Open the start menu, then searches for content. Use to open apps, open files/folders, or search the web.",
 | 
				
			||||||
            "parameters": {
 | 
					            "parameters": {
 | 
				
			||||||
                "type": "object",
 | 
					                "type": "object",
 | 
				
			||||||
                "properties": {},
 | 
					                "properties": {
 | 
				
			||||||
                "required": [],
 | 
					                    "query": {
 | 
				
			||||||
 | 
					                        "type": "string",
 | 
				
			||||||
 | 
					                        "description": "The search query to perform."
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                "required": ["query"],
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user