> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobileboost.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Reference

> API reference for the MobileBoost Python Appium SDK

## Constructor

```python theme={null}
from gptdriver_client import GptDriver

gptd = GptDriver(
    api_key="YOUR_API_KEY",
    platform="android",
    device_name="Pixel 7",
    platform_version="15.0",
)
```

| Parameter             | Type      | Description                                                              |
| --------------------- | --------- | ------------------------------------------------------------------------ |
| `api_key`             | str       | Your GPT Driver API key                                                  |
| `platform`            | str       | `"android"` or `"ios"` (when the SDK starts its own session)             |
| `device_name`         | str       | Device name (when the SDK starts its own session)                        |
| `platform_version`    | str       | Platform version (when the SDK starts its own session)                   |
| `driver`              | WebDriver | An existing Appium driver to attach to instead of starting a new session |
| `enable_self_healing` | bool      | Enable/disable self healing globally (default: `True`)                   |

## Self healing

By default, all `find_element` calls are wrapped with self-healing. When an element can't be found, the SDK attempts to resolve it automatically.

```python theme={null}
# Self healing is automatic for all find_element calls
el = gptd.find_element(By.ID, "login-button")
```

Disable it globally via the constructor when you need strict assertions:

```python theme={null}
gptd = GptDriver(api_key="...", enable_self_healing=False)
```

See [self healing](/engineer-tooling/self-healing) for details.

## AI commands

### execute

Execute a natural language instruction on the current screen.

```python theme={null}
gptd.execute("Tap the login button and wait for the home screen")
```

### assert\_condition

Verify a condition without taking any action. Raises an error if the condition fails.

```python theme={null}
gptd.assert_condition("The home screen is displayed with a welcome message")
```

## Session status

Report the outcome of a session so it is recorded on the dashboard.

```python theme={null}
gptd.set_session_status("success")  # or "failed"
```

## Caching

The SDK supports caching to reduce AI calls for repetitive executions:

| Mode                 | Description                                                                          |
| -------------------- | ------------------------------------------------------------------------------------ |
| `NONE`               | No caching                                                                           |
| `FULL_SCREEN`        | Cache hit only if the full screen matches a previous successful execution            |
| `INTERACTION_REGION` | Cache hit if the interaction region matches (e.g., the area around a tapped element) |
