### Initialize Perplexica Submodule Source: https://github.com/simular-ai/agent-s/blob/main/README.md Navigates into the Perplexica directory and initializes/updates its Git submodules. This step is necessary to fetch the required files for the Perplexica component. ```bash cd Perplexica git submodule update --init ``` -------------------------------- ### Initializing Grounding Agent and Agent S2 (Python) Source: https://github.com/simular-ai/agent-s/blob/main/README.md Creates instances of `OSWorldACI` for grounding and `AgentS2` for the main agent, passing the previously defined engine parameters, platform, action space, observation type, and search engine. ```Python grounding_agent = OSWorldACI( platform=current_platform, engine_params_for_generation=engine_params, engine_params_for_grounding=engine_params_for_grounding ) agent = AgentS2( engine_params, grounding_agent, platform=current_platform, action_space="pyautogui", observation_type="mixed", search_engine="Perplexica" # Assuming you have set up Perplexica. ) ``` -------------------------------- ### Start Perplexica Docker Containers Source: https://github.com/simular-ai/agent-s/blob/main/README.md Starts the Docker containers defined in the `docker-compose.yaml` file for Perplexica in detached mode (`-d`). This runs the Perplexica services in the background. ```bash docker compose up -d ``` -------------------------------- ### Install Agent S Package via Pip Source: https://github.com/simular-ai/agent-s/blob/main/README.md Installs the Agent S package using the Python package manager, pip. This is the standard method for adding the library to your Python environment. ```bash pip install gui-agents ``` -------------------------------- ### Defining Engine Parameters for Agent S2 (Python) Source: https://github.com/simular-ai/agent-s/blob/main/README.md Sets up configuration dictionaries (`engine_params` and `engine_params_for_grounding`) for the main agent and the grounding agent, supporting different model providers like OpenAI, Hugging Face, Claude, and GPT. ```Python engine_type_for_grounding = "huggingface" engine_params = { "engine_type": "openai", "model": "gpt-4o", } if engine_type_for_grounding == "huggingface": engine_params_for_grounding = { "engine_type": "huggingface", "endpoint_url": "/v1/", } elif engine_type_for_grounding == "claude": engine_params_for_grounding = { "engine_type": "claude", "model": "claude-3-7-sonnet-20250219", } elif engine_type_for_grounding == "gpt": engine_params_for_grounding = { "engine_type": "gpt", "model": "gpt-4o", } else: raise ValueError("Invalid engine type for grounding") ``` -------------------------------- ### Citing Agent S using BibTeX Source: https://github.com/simular-ai/agent-s/blob/main/README.md Provides the BibTeX entry for citing the original Agent S paper, including authors, title, conference, year, and URL. ```BibTeX @inproceedings{Agent-S, title={{Agent S: An Open Agentic Framework that Uses Computers Like a Human}}, author={Saaket Agashe and Jiuzhou Han and Shuyu Gan and Jiachen Yang and Ang Li and Xin Eric Wang}, booktitle={International Conference on Learning Representations (ICLR)}, year={2025}, url={https://arxiv.org/abs/2410.08164} } ``` -------------------------------- ### Starting OCR Server (Shell) Source: https://github.com/simular-ai/agent-s/blob/main/gui_agents/s1/WindowsAgentArena.md Adds a command to the `start_client.sh` script to run the `ocr_server.py` script in the background (`&`) before the main agent execution begins. This ensures the OCR server is running when the agent needs it. ```Shell python ocr_server.py & ``` -------------------------------- ### Importing Modules and Loading Environment Variables (Python) Source: https://github.com/simular-ai/agent-s/blob/main/README.md Imports required libraries such as `pyautogui`, `io`, `AgentS2`, and `OSWorldACI`. It also loads API keys from a `.env` file using `dotenv` and sets the current platform. ```Python import pyautogui import io from gui_agents.s2.agents.agent_s import AgentS2 from gui_agents.s2.agents.grounding import OSWorldACI # Load in your API keys. from dotenv import load_dotenv load_dotenv() current_platform = "linux" # "darwin", "windows" ``` -------------------------------- ### Downloading Agent S2 Knowledge Base Programmatically (Python) Source: https://github.com/simular-ai/agent-s/blob/main/README.md Uses the `download_kb_data` function to fetch the knowledge base assets for Agent S2 version 's2', release tag 'v0.2.2', saving them to the 'kb_data' directory for the 'linux' platform. ```Python download_kb_data( version="s2", release_tag="v0.2.2", download_dir="kb_data", platform="linux" # "darwin", "windows" ) ``` -------------------------------- ### Querying Agent S2 with Screenshot Observation (Python) Source: https://github.com/simular-ai/agent-s/blob/main/README.md Captures the current screen using `pyautogui`, formats it into bytes, creates an observation dictionary, provides an instruction, calls the agent's `predict` method, and executes the resulting action. ```Python # Get screenshot. screenshot = pyautogui.screenshot() buffered = io.BytesIO() screenshot.save(buffered, format="PNG") screenshot_bytes = buffered.getvalue() obs = { "screenshot": screenshot_bytes, } instruction = "Close VS Code" info, action = agent.predict(instruction=instruction, observation=obs) exec(action[0]) ``` -------------------------------- ### Instantiating OSWorld DesktopEnv with Explicit VM Path (Python) Source: https://github.com/simular-ai/agent-s/blob/main/osworld_setup/s2/OSWorld.md This snippet provides an alternative way to instantiate the `DesktopEnv` class, explicitly setting parameters like `action_space`, `headless`, `require_terminal`, and crucially, `path_to_vm`. This is suggested as a fix when the default setup fails, requiring the absolute path to the VM's `.vmx` file. ```Python env = DesktopEnv(action_space="pyautogui", headless=False, require_terminal=True, path_to_vm=) ``` -------------------------------- ### Run Agent S2 with Specific Models (CLI) Source: https://github.com/simular-ai/agent-s/blob/main/README.md Executes the Agent S2 command-line interface, specifying the main language model and the grounding model using `--provider` and `--model` arguments. This allows running the agent with preferred models. ```sh agent_s2 \\ --provider "anthropic" \\ --model "claude-3-7-sonnet-20250219" \\ --grounding_model_provider "anthropic" \\ --grounding_model "claude-3-7-sonnet-20250219" \\ ``` -------------------------------- ### Citing Agent S2 using BibTeX Source: https://github.com/simular-ai/agent-s/blob/main/README.md Provides the BibTeX entry for citing the Agent S2 paper, including authors, title, year, and arXiv identifier. ```BibTeX @misc{Agent-S2, title={Agent S2: A Compositional Generalist-Specialist Framework for Computer Use Agents}, author={Saaket Agashe and Kyle Wong and Vincent Tu and Jiachen Yang and Ang Li and Xin Eric Wang}, year={2025}, eprint={2504.00906}, archivePrefix={arXiv}, primaryClass={cs.AI}, url={https://arxiv.org/abs/2504.00906}, } ``` -------------------------------- ### Installing the gui-agents Package (Shell) Source: https://github.com/simular-ai/agent-s/blob/main/gui_agents/s1/README.md Installs the gui-agents Python package using pip. This package is required to use the Agent S framework. ```Shell pip install gui-agents ``` -------------------------------- ### Run Agent S2 with Custom Endpoint (CLI) Source: https://github.com/simular-ai/agent-s/blob/main/README.md Executes the Agent S2 CLI, specifying the main language model and a custom endpoint for inference using `--endpoint_provider` and `--endpoint_url`. This is useful for using self-hosted or specific inference services. ```bash agent_s2 \\ --provider "anthropic" \\ --model "claude-3-7-sonnet-20250219" \\ --endpoint_provider "huggingface" \\ --endpoint_url "/v1/" ``` -------------------------------- ### Export Perplexica API URL Source: https://github.com/simular-ai/agent-s/blob/main/README.md Sets the `PERPLEXICA_URL` environment variable to the address of the running Perplexica API backend. This variable is used by Agent S to interact with Perplexica for web search. ```bash export PERPLEXICA_URL=http://localhost:{port}/api/search ``` -------------------------------- ### Set API Keys via Environment Variables (Shell) Source: https://github.com/simular-ai/agent-s/blob/main/README.md Sets required API keys (OpenAI, Anthropic, Hugging Face) as environment variables in your shell profile (e.g., .bashrc, .zshrc). This makes the keys available to applications run from that shell. ```bash export OPENAI_API_KEY= export ANTHROPIC_API_KEY= export HF_TOKEN= ``` -------------------------------- ### Set API Keys via Environment Variables (Python) Source: https://github.com/simular-ai/agent-s/blob/main/README.md Sets an API key as an environment variable directly within a Python script using the `os` module. This method is an alternative to setting variables in the shell profile. ```python import os os.environ["OPENAI_API_KEY"] = "" ``` -------------------------------- ### Start Perplexica Services with Docker Compose (Bash) Source: https://github.com/simular-ai/agent-s/blob/main/gui_agents/s1/README.md Execute the docker compose command to build and start the Perplexica services defined in the docker-compose.yaml file. The '-d' flag runs the containers in detached mode. ```bash docker compose up -d ``` -------------------------------- ### Run OCR Server Script (Bash) Source: https://github.com/simular-ai/agent-s/blob/main/gui_agents/s1/README.md Navigate to the Agent-S directory and execute the Python script that starts the OCR server. This server provides OCR capabilities used by Agent S. ```bash cd Agent-S python gui_agents/utils/ocr_server.py ``` -------------------------------- ### Initializing OSWorld DesktopEnv with Task Config (Python) Source: https://github.com/simular-ai/agent-s/blob/main/osworld_setup/s2/OSWorld.md This snippet demonstrates the basic usage of the `DesktopEnv` class from `desktop_env`. It shows how to define a task configuration dictionary and use it to initialize the environment with `env.reset()`, followed by performing a step with `env.step()`. The text notes this code is primarily for illustrating the instantiation process within OSWorld. ```Python from desktop_env.desktop_env import DesktopEnv example = { "id": "94d95f96-9699-4208-98ba-3c3119edf9c2", "instruction": "I want to install Spotify on my current system. Could you please help me?", "config": [ { "type": "execute", "parameters": { "command": [ "python", "-c", "import pyautogui; import time; pyautogui.click(960, 540); time.sleep(0.5);" ] } } ], "evaluator": { "func": "check_include_exclude", "result": { "type": "vm_command_line", "command": "which spotify" }, "expected": { "type": "rule", "rules": { "include": ["spotify"], "exclude": ["not found"] } } } } env = DesktopEnv(action_space="pyautogui") obs = env.reset(task_config=example) obs, reward, done, info = env.step("pyautogui.rightClick()") ``` -------------------------------- ### Initializing DesktopEnv with Task Config (Python) Source: https://github.com/simular-ai/agent-s/blob/main/osworld_setup/s1/OSWorld.md Demonstrates how to initialize the DesktopEnv environment with a specific task configuration dictionary. It resets the environment with the task and performs a basic step. This code is used to boot up and potentially restart the VM. ```Python from desktop_env.desktop_env import DesktopEnv example = { "id": "94d95f96-9699-4208-98ba-3c3119edf9c2", "instruction": "I want to install Spotify on my current system. Could you please help me?", "config": [ { "type": "execute", "parameters": { "command": [ "python", "-c", "import pyautogui; import time; pyautogui.click(960, 540); time.sleep(0.5);" ] } } ], "evaluator": { "func": "check_include_exclude", "result": { "type": "vm_command_line", "command": "which spotify" }, "expected": { "type": "rule", "rules": { "include": ["spotify"], "exclude": ["not found"] } } } } env = DesktopEnv(action_space="pyautogui") obs = env.reset(task_config=example) obs, reward, done, info = env.step("pyautogui.rightClick()") ``` -------------------------------- ### Initialize and Use Agent S SDK (Python) Source: https://github.com/simular-ai/agent-s/blob/main/gui_agents/s1/README.md Demonstrates how to use the gui_agents Python SDK to initialize Agent S, configure it based on the operating system, capture the screen and accessibility tree, and make a prediction based on an instruction. ```python import pyautogui import io from gui_agents.core.AgentS import GraphSearchAgent import platform if platform.system() == "Darwin": from gui_agents.aci.MacOSACI import MacOSACI, UIElement grounding_agent = MacOSACI() elif platform.system() == "Windows": from gui_agents.aci.WindowsOSACI import WindowsACI, UIElement grounding_agent = WindowsACI() elif platform.system() == "Linux": from gui_agents.aci.LinuxOSACI import LinuxACI, UIElement grounding_agent = LinuxACI() else: raise ValueError("Unsupported platform") engine_params = { "engine_type": "openai", "model": "gpt-4o", } agent = GraphSearchAgent( engine_params, grounding_agent, platform="ubuntu", # "macos", "windows" action_space="pyautogui", observation_type="mixed", search_engine="Perplexica" ) # Get screenshot. screenshot = pyautogui.screenshot() buffered = io.BytesIO() screenshot.save(buffered, format="PNG") screenshot_bytes = buffered.getvalue() # Get accessibility tree. acc_tree = UIElement.systemWideElement() obs = { "screenshot": screenshot_bytes, "accessibility_tree": acc_tree, } instruction = "Close VS Code" info, action = agent.predict(instruction=instruction, observation=obs) exec(action[0]) ``` -------------------------------- ### Cloning the Agent S Repository (Shell) Source: https://github.com/simular-ai/agent-s/blob/main/gui_agents/s1/README.md Clones the Agent S GitHub repository to your local machine. This is the first step in setting up the project environment. ```Shell git clone https://github.com/simular-ai/Agent-S.git ``` -------------------------------- ### Instantiating LMMAgent - Python Source: https://github.com/simular-ai/agent-s/blob/main/models.md Shows how to create an instance of the core LMMAgent class, which wraps MLLMs with message handling. It requires specifying the engine_params dictionary containing the engine_type and model. Requires importing LMMAgent. ```Python from gui_agents.core.mllm import LMMAgent engine_params = { "engine_type": 'anthropic', # Allowed Values: 'openai', 'anthropic', 'gemini', 'azure_openai', 'vllm', 'open_router' "model": 'claude-3-5-sonnet-20240620', # Allowed Values: Any Vision and Language Model from the supported APIs } agent = LMMAgent( engine_params=engine_params, ) ``` -------------------------------- ### Instantiating Agent S (Python) Source: https://github.com/simular-ai/agent-s/blob/main/gui_agents/s1/WindowsAgentArena.md Adds an `elif` block to instantiate the `GraphSearchAgent` when the agent name is "agent_s". It configures the SOM (Screen Object Model) based on the origin and sets up engine parameters based on the specified model (Claude, GPT, or vllm). ```Python elif cfg_args["agent_name"] == "agent_s": if cfg_args["som_origin"] in ["a11y"]: som_config = None elif cfg_args["som_origin"] in ["oss", "mixed-oss"]: som_config = { "pipeline": ["webparse", "groundingdino", "ocr"], "groundingdino": { "prompts": ["icon", "image"] }, "ocr": { "class_name": "TesseractOCR" }, "webparse": { "cdp_url": f"http://{args.emulator_ip}:9222" } } if args.model.startswith("claude"): engine_type = "anthropic" elif args.model.startswith("gpt"): engine_type = "openai" else: engine_type = "vllm" engine_params = { "engine_type": engine_type, "model": args.model, } agent = GraphSearchAgent( engine_params=engine_params, experiment_type='windowsAgentArena', temperature=args.temperature ) ``` -------------------------------- ### Instantiating AgentS2 - Python Source: https://github.com/simular-ai/agent-s/blob/main/models.md Demonstrates how to create an instance of the AgentS2 class, configuring its MLLM engine type, model, and other operational parameters like grounding agent, platform, action space, observation type, and search engine. Requires importing AgentS2 and having grounding_agent and current_platform defined. ```Python from gui_agents.s2.agents.agent_s import AgentS2 engine_params = { "engine_type": 'anthropic', # Allowed Values: 'openai', 'anthropic', 'gemini', 'azure_openai', 'vllm', 'open_router' "model": 'claude-3-5-sonnet-20240620', # Allowed Values: Any Vision and Language Model from the supported APIs } agent = AgentS2( engine_params, grounding_agent, platform=current_platform, action_space="pyautogui", observation_type="mixed", search_engine="LLM" ) ``` -------------------------------- ### Downloading Agent S Knowledge Base using Python Source: https://github.com/simular-ai/agent-s/blob/main/gui_agents/s1/README.md This Python code snippet demonstrates how to programmatically download the Agent S knowledge base using the `download_kb_data` function. It allows specifying the agent version, release tag, download directory, and target platform (linux, darwin, or windows). ```Python download_kb_data( version="s2", release_tag="v0.2.2", download_dir="kb_data", platform="linux" # "darwin", "windows" ) ``` -------------------------------- ### Initializing DesktopEnv with Explicit VM Path (Python) Source: https://github.com/simular-ai/agent-s/blob/main/osworld_setup/s1/OSWorld.md Provides an alternative method to initialize DesktopEnv, allowing explicit specification of the absolute path to the VM's .vmx file, headless mode, and terminal requirement. This is useful for troubleshooting VM connection issues, especially when default initialization fails. ```Python env = DesktopEnv(action_space="pyautogui", headless=False, require_terminal=True, path_to_vm=) ``` -------------------------------- ### Configuring Agent and Model (Shell) Source: https://github.com/simular-ai/agent-s/blob/main/gui_agents/s1/WindowsAgentArena.md Modifies parameters in the `scripts/run-local.sh` file to specify "agent_s" as the agent to run and "gpt-4o" as the language model to be used by the agent. ```Shell agent="agent_s" model="gpt-4o" ``` -------------------------------- ### Core Python Dependencies Source: https://github.com/simular-ai/agent-s/blob/main/requirements.txt Lists the main Python packages required for the project, regardless of the operating system. ```Python numpy backoff pandas openai anthropic fastapi uvicorn paddleocr paddlepaddle together scikit-learn websockets tiktoken pyautogui toml black pytesseract ``` -------------------------------- ### BibTeX Citation for Agent S Source: https://github.com/simular-ai/agent-s/blob/main/gui_agents/s1/README.md This BibTeX entry provides the recommended format for citing the Agent S project in academic papers or other publications. ```BibTeX @misc{agashe2024agentsopenagentic, title={Agent S: An Open Agentic Framework that Uses Computers Like a Human}, author={Saaket Agashe and Jiuzhou Han and Shuyu Gan and Jiachen Yang and Ang Li and Xin Eric Wang}, year={2024}, eprint={2410.08164}, archivePrefix={arXiv}, primaryClass={cs.AI}, url={https://arxiv.org/abs/2410.08164}, } ``` -------------------------------- ### Copying OCR Server File (Shell) Source: https://github.com/simular-ai/agent-s/blob/main/gui_agents/s1/WindowsAgentArena.md Copies the `ocr_server.py` file from the agent's directory to the client directory within the WindowsAgentArena structure. This makes the OCR server accessible to the client container. ```Shell cd WindowsAgentArena/src/win-arena-container/client cp mm_agents/agent_s/ocr_server.py . ``` -------------------------------- ### Configuring OpenAI API Key - Shell Source: https://github.com/simular-ai/agent-s/blob/main/models.md Sets the OPENAI_API_KEY environment variable required for authenticating with the OpenAI API for MLLM inference. Replace with your actual OpenAI API key. ```Shell export OPENAI_API_KEY= ``` -------------------------------- ### Navigate and Update Perplexica Submodule (Bash) Source: https://github.com/simular-ai/agent-s/blob/main/gui_agents/s1/README.md Navigate into the Perplexica directory and initialize/update its Git submodules. This is a necessary step after cloning the main repository to fetch the Perplexica code. ```bash cd Perplexica git submodule update --init ``` -------------------------------- ### Configuring Gemini API - Shell Source: https://github.com/simular-ai/agent-s/blob/main/models.md Sets the GEMINI_API_KEY and GEMINI_ENDPOINT_URL environment variables required for authenticating and specifying the endpoint for the Gemini API. Replace with your actual Gemini API key. ```Shell export GEMINI_API_KEY= export GEMINI_ENDPOINT_URL="https://generativelanguage.googleapis.com/v1beta/openai/" ``` -------------------------------- ### Configuring Open Router API - Shell Source: https://github.com/simular-ai/agent-s/blob/main/models.md Sets the OPENROUTER_API_KEY and OPEN_ROUTER_ENDPOINT_URL environment variables for authenticating and specifying the endpoint for the Open Router API. Replace with your actual Open Router API key. ```Shell export OPENROUTER_API_KEY= export OPEN_ROUTER_ENDPOINT_URL="https://openrouter.ai/api/v1" ``` -------------------------------- ### Configuring Azure OpenAI API - Shell Source: https://github.com/simular-ai/agent-s/blob/main/models.md Sets the AZURE_OPENAI_API_BASE and AZURE_OPENAI_API_KEY environment variables for connecting to an Azure OpenAI deployment. Replace and with your specific Azure details. ```Shell export AZURE_OPENAI_API_BASE= export AZURE_OPENAI_API_KEY= ``` -------------------------------- ### Importing Agent S (Python) Source: https://github.com/simular-ai/agent-s/blob/main/gui_agents/s1/WindowsAgentArena.md Imports the `GraphSearchAgent` class from the `agent` module within the `mm_agents.agent_s` package. This makes the Agent S class available for instantiation in the `run.py` script. ```Python from mm_agents.agent_s.agent import GraphSearchAgent ``` -------------------------------- ### Export Perplexica API URL Environment Variable (Bash) Source: https://github.com/simular-ai/agent-s/blob/main/gui_agents/s1/README.md Set the PERPLEXICA_URL environment variable to the address where the Perplexica API is accessible. Replace '{port}' with the actual port configured in Perplexica's config.toml. ```bash export PERPLEXICA_URL=http://localhost:{port}/api/search ``` -------------------------------- ### Setting OpenAI API Key Environment Variable (Shell) Source: https://github.com/simular-ai/agent-s/blob/main/gui_agents/s1/README.md Sets the OPENAI_API_KEY environment variable in a shell configuration file (like .bashrc or .zshrc). This provides the necessary API key for accessing OpenAI models used by Agent S. Replace with your actual key. ```Shell export OPENAI_API_KEY= ``` -------------------------------- ### Configuring Anthropic API Key - Shell Source: https://github.com/simular-ai/agent-s/blob/main/models.md Sets the ANTHROPIC_API_KEY environment variable required for authenticating with the Anthropic API for MLLM inference. Replace with your actual Anthropic API key. ```Shell export ANTHROPIC_API_KEY= ``` -------------------------------- ### Configuring vLLM Endpoint - Shell Source: https://github.com/simular-ai/agent-s/blob/main/models.md Sets the vLLM_ENDPOINT_URL environment variable to specify the endpoint for a local vLLM instance used for MLLM inference. Replace with the URL of your vLLM server. ```Shell export vLLM_ENDPOINT_URL= ``` -------------------------------- ### Run Agent S via CLI (Bash) Source: https://github.com/simular-ai/agent-s/blob/main/gui_agents/s1/README.md Execute the Agent S command-line interface with a specified model, such as 'gpt-4o'. This command launches the interactive prompt for interacting with Agent S. ```bash agent_s1 --model gpt-4o ``` -------------------------------- ### Platform-Specific Python Dependencies Source: https://github.com/simular-ai/agent-s/blob/main/requirements.txt Lists Python packages that are conditionally required based on the operating system (macOS or Windows). ```Python # Platform-specific dependencies pyobjc; platform_system == "Darwin" pywinauto; platform_system == "Windows" pywin32; platform_system == "Windows" ``` -------------------------------- ### Modifying PyAutoGUI isShiftCharacter Function (Python) Source: https://github.com/simular-ai/agent-s/blob/main/osworld_setup/s1/OSWorld.md Shows the `isShiftCharacter` function from the `pyautogui` library. Highlights a known issue in the 'os' domain where removing the '<' character from the `set` can act as a workaround for certain `pyautogui` problems. ```Python def isShiftCharacter(character): """ Returns True if the ``character`` is a keyboard key that would require the shift key to be held down, such as uppercase letters or the symbols on the keyboard's number row. """ # NOTE TODO - This will be different for non-qwerty keyboards. return character.isupper() or character in set('~!@#$%^&*()_+{}|:"<>?') ``` -------------------------------- ### Export OCR Server Address Environment Variable (Bash) Source: https://github.com/simular-ai/agent-s/blob/main/gui_agents/s1/README.md Set the OCR_SERVER_ADDRESS environment variable to the URL of the running OCR server. This variable is used by Agent S to communicate with the OCR service. ```bash export OCR_SERVER_ADDRESS=http://localhost:8000/ocr/ ``` -------------------------------- ### Setting OpenAI API Key in Python (Python) Source: https://github.com/simular-ai/agent-s/blob/main/gui_agents/s1/README.md Sets the OPENAI_API_KEY environment variable programmatically within a Python script using the os module. This is an alternative method to setting the key in shell configuration files. Replace with your actual key. ```Python import os os.environ["OPENAI_API_KEY"] = "" ``` -------------------------------- ### Modifying PyAutoGUI isShiftCharacter Function (Python) Source: https://github.com/simular-ai/agent-s/blob/main/osworld_setup/s2/OSWorld.md This snippet shows the `isShiftCharacter` function from the `pyautogui` library. The accompanying text describes a workaround for an issue on the `os` domain, suggesting that users modify this function directly in the `pyautogui` source code within the VM by removing the "<" character from the `set` of shift characters. ```Python def isShiftCharacter(character): """ Returns True if the ``character`` is a keyboard key that would require the shift key to be held down, such as uppercase letters or the symbols on the keyboard's number row. """ # NOTE TODO - This will be different for non-qwerty keyboards. return character.isupper() or character in set('~!@#$%^&*()_+{}|:"<>?') ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.