```
#### Options
- `--platform`: Specifies the platform to use, either `android` or `osx`. Default is `android`.
```sh
python main.py run "example task" --platform=osx
```
- `--planner-model`: Specifies the planner model to use, either `openai`, `gemini`, or `ollama`. Default is `openai`.
```sh
python main.py run "example task" --planner-model=gemini
```
- `--finder-model`: Specifies the finder model to use, either `openai`, `gemini`, or `ollama`. Default is `gemini`.
```sh
python main.py run "example task" --finder-model=ollama
```
- `--image-quality`: Image quality percentage (1-100). Lower values reduce image size for faster processing. Default is `100`.
```sh
python main.py run "example task" --image-quality=45
```
### Example
```sh
python main.py run "Open Google news" --platform=android --planner-model=openai --finder-model=gemini
```
With local ollama model and reduced image quality:
```sh
python main.py run "Open Reddit" --platform=android --planner-model=ollama --finder-model=gemini --image-quality=45
```
## Use as an API
### POST /execute
#### Description:
This endpoint executes a task based on the provided task prompt, platform, planner model, and finder model.
#### Request Body:
- `task_prompt` (string): The prompt for the task that needs to be executed.
- `platform` (string, optional): The platform on which the task is to be executed. Default is "android". Supported platforms: "android", "osx".
- `planner_model` (string, optional): The planner model to be used for planning the task. Default is "openai". Supported models: "openai", "gemini", "ollama".
- `finder_model` (string, optional): The finder model to be used for finding elements to interact with. Default is "gemini". Supported models: "gemini", "openai", "ollama".
- `image_quality` (integer, optional): Image quality percentage (1-100). Lower values reduce processing time. Default is 100.
#### Response:
- `200 OK`:
- `result` (object): The result of the task execution.
- `400 Bad Request`:
- `detail` (string): Description of why the request is invalid (e.g., unsupported platform, unsupported planner model, unsupported finder model).
- `500 Internal Server Error`:
- `detail` (string): Description of the error that occurred during task execution.
#### Example Request:
```bash
curl -X POST "http://localhost:8000/execute" -H "Content-Type: application/json" -d '{
"task_prompt": "Open uber app",
"platform": "android",
"planner_model": "gemini",
"finder_model": "openai"
}'
```
#### Example Response:
```json
{
"result": {
"status": "success",
"data": {
// actual task execution result
}
}
}
```
#### Prerequisites
This project needs adb to be installed on your local machine where the code is being executed.
#### Project structure
#### How to contribute
Contributions are welcome! Please open an issue or submit a pull request.
#### Things to do
Three components-
1. Planner
2. Finder
3. Executor
pip install -r requirements.txt
uvicorn api:app --reload
curl -X POST "http://127.0.0.1:8000/execute" -H "Content-Type: application/json" -d '{
"task_prompt": "Open Safari"
}'
Pre-commit -
pre-commit install
pre-commit autoupdate
pre-commit run --all-files
## License
This project is licensed under the MIT License. See the LICENSE file for details.
Made with ❤️ by InstaVM | Follow us for updates!