diff --git a/Python_server/a5browseruse.spec b/Python_server/a5browseruse.spec index 27cfcad..0ea8f27 100644 --- a/Python_server/a5browseruse.spec +++ b/Python_server/a5browseruse.spec @@ -5,8 +5,8 @@ a = Analysis( ['main.py'], pathex=[], binaries=[], - datas=[], - hiddenimports=[], + datas=[('requirements.txt', '.')], + hiddenimports=['pydantic.deprecated.decorator'], hookspath=[], hooksconfig={}, runtime_hooks=[], diff --git a/Python_server/main.py b/Python_server/main.py index 25c5244..8f93998 100644 --- a/Python_server/main.py +++ b/Python_server/main.py @@ -8,10 +8,12 @@ # uvicorn main:app --host 127.0.0.1 --port 8888 --reload --workers 1 # make sure you set OPENAI_API_KEY=yourOpenAIKeyHere to .env file +import os +os.environ["PYDANTIC_V1_COMPAT_MODE"] = "true" + from langchain_openai import ChatOpenAI from browser_use import Agent from dotenv import load_dotenv -import os import platform import asyncio from fastapi import FastAPI, HTTPException, Query, BackgroundTasks @@ -25,6 +27,7 @@ from fastapi.middleware.cors import CORSMiddleware + # ---------------------------- # 1. Configure Logging # ---------------------------- @@ -291,7 +294,7 @@ def read_root(): # ---------------------------- # 12. Entry Point # ---------------------------- -#if __name__ == "__main__": -# import uvicorn +if __name__ == "__main__": + import uvicorn -# uvicorn.run("main:app", host="127.0.0.1", port=8888, reload=True, workers=1) \ No newline at end of file + uvicorn.run("main:app", host="127.0.0.1", port=8888, reload=True, workers=1) \ No newline at end of file diff --git a/README.md b/README.md index 24dfbd5..a58b02a 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,14 @@ Your commands control the browser - made easy. ## Important (Experimental) Notice -This project is **experimental**. +This project is **experimental**. You can run it easily on macOS by using the executable generated in the `Python_server/dist` folder (e.g., `./a5browseruse` on macOS). For other platforms like **Linux** and **Windows**, you can build or run the server similarly (see the [Installation](#installation) steps for more details). ### Quick Start (macOS) +Note: Mac Users *should* be able to run the executable located in the `Python_server/dist` folder by navigating to the Python_server/dist folder and running `./a5browseruse` + +However, if this does not work, you can follow these steps to set it up manually: + 1. **Close all Chrome windows completely.** 2. **Start Chrome with Remote Debugging Enabled** (required by Browser Use): ```bash