Skip to content

simularbrowser api documentation #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ description: "Simular API documentation."
permalink: /
---

# API documentation
# Simular API documentation

[Simular Browser Python API documentation](simularBrowser)


{:toc}

Expand Down
151 changes: 151 additions & 0 deletions simularBrowser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
---
title: Simular Browser
layout: home
nav_order: 1
description: "Simular Browser Python API documentation."
permalink: /simularBrowser
---

# Simular Browser Python API documentation

# Setup and configuration

## __init__()
```python
def __init__(self,
path: str,
anthropic_key: str = '',
planner_model: str = 'claude-3-5-sonnet',
planner_mode: str = 'system_1_2'):
```

## Parameters

### path
Absolute path to the Simular Browser executable.

### anthropic_key
Anthropic API key.

### planner_model
Model for the planner.
Selection: "claude-3-5-sonnet"

### planner_mode
Mode to use for the planner.
```
"system_1": runs a planner that produces one-shot instructions
"system_2": runs a planner that operates step-by-step exploration
"system_1_2": runs system 1, then system 2 if system 1 fails
"agent_s1": runs Agent S1: hierarchical planning with exploration
```


## Return Value
None

## Discussion
Examples:

- Instruction: Initialize Simular Browser for default configuration
```python
simular = SimularBrowser(path="path/to/simular")
```
- Instruction: Initialize Simular Browser with custom configuration
```python
simular = SimularBrowser(path="path/to/simular", anthropic_key="anthropic_key", planner_model="claude-3-5-sonnet", planner_mode="system_1_2")
```

# Simular Browser API

## is_app_running()
```python
def is_app_running(self) -> bool:
```

## Parameter
None

## Return Value
True if the app is running, False otherwise.

## Discussion
Examples:

- Instruction: Check if Simular Browser is running
```python
simular = SimularBrowser(path="path/to/simular")
is_running = simular.is_app_running() # True if running, False otherwise
```


## launch_app()
```python
def launch_app(self) -> None:
```

## Parameter
None

## Return Value
None

## Discussion
Examples:

- Instruction: Launch Simular Browser
```python
simular = SimularBrowser(path="path/to/simular")
simular.launch_app()
```

## run()
```python
def run(self, query, timeout=None, reset: bool = False) -> dict:
```

## Parameters

### query
Query to run in Simular Browser.

### timeout
Timeout for this query.

### reset
Reset the app before running the query.

## Return Value
Dictionary containing the response from Simular Browser:

```python
output = {
"responses": self.responses,
"images": self.images,
"info": self.info
}

- responses: List of text responses from Simular Browser.
- images: List of image responses from Simular Browser.
- info: Information about this run from Simular Browser.

```

## Discussion

Examples:

- Instruction: Run a query in Simular Browser
```python
simular = SimularBrowser(path="path/to/simular")
output = simular.run("What is the capital of France?")
```

- Instruction: Run a query in Simular Browser with a timeout
```python
simular = SimularBrowser(path="path/to/simular")
output = simular.run("What is the capital of France?", timeout=60)
```

##TODO:
- Multi-tab parallel execution
Loading