The Simplex client is the main entry point for the SDK. It combines AI capabilities with browser automation through its integrated BrowserActor.

Constructor

client = Simplex(
    api_key: str,
    timeout: Optional[float] = None,
    max_retries: int = 3,
    record_video: bool = False
)

Parameters

api_key
string
required

Your API key for authentication

timeout
float

Timeout in seconds for API requests

max_retries
integer
default: "3"

Maximum number of retries for failed requests

Properties

browser_actor

@property
def browser_actor(self) -> BrowserActor

The integrated BrowserActor instance for browser automation. See Browser Actor for details.

Functions

find_element

def find_element(
    self,
    element_description: str,
    screenshot: Image.Image,
) -> List[int]

Finds an element in a screenshot based on a natural language description.

Parameters

element_description
string
required

Natural language description of the element to find

screenshot
Image.Image
required

Screenshot of the current screen

Returns

List of 4 integers representing the bounding box [x1, y1, x2, y2]

get_next_step

def get_next_step(
    self,
    task_description: str,
    screenshot: Image.Image,
    history: Optional[list] = None,
) -> Dict[str, Any]

Gets the next step to complete a task based on current screenshot and history.

Parameters

task_description
string
required

Natural language description of the task to complete

screenshot
Image.Image
required

Screenshot of the current screen

history
list

List of previous steps taken to complete the task

is_step_complete

def is_step_complete(
    self,
    step_description: str,
    screenshot: Image.Image,
) -> bool

Checks if a step is complete based on a natural language description.

Parameters

step_description
string
required

Natural language description of the step to check

screenshot
Image.Image
required

Screenshot of the current screen

step_to_action

def step_to_action(
    self,
    step_description: str,
    screenshot: Image.Image,
) -> List[BrowserInteraction]

Converts a step description to a list of Simplex BrowserInteractions.

Parameters

step_description
string
required

Natural language description of the step to convert

screenshot
Image.Image
required

Screenshot of the current screen

Returns

List of BrowserInteractions to complete the step

is_task_complete

def is_task_complete(
    self,
    task_description: str,
    screenshot: Image.Image,
) -> bool

Checks if a task is complete based on a natural language description.

Parameters

task_description
string
required

Natural language description of the task to check

screenshot
Image.Image
required

Screenshot of the current screen