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

# Reporters

> This page covers **AskUI Reporters**, a package for tracking automation steps. It explains **installation, available reporters, combining multiple reporters**, and how to create custom reporters using the AskUI **Reporter interface**.

## Getting Started

AskUI provides a comprehensive reporting system that allows you to track and document your automation steps. Reporters capture execution details, screenshots, and results to help you analyze and debug your automation workflows.

## Available Reporters

AskUI offers several built-in reporters to suit different needs:

* **SimpleHtmlReporter** - Generates HTML reports with screenshots and step details
* **AllureReporter** - Integrates with Allure reporting framework
* **Custom Reporter** - Create your own reporter by implementing the Reporter interface

## SimpleHtmlReporter

The SimpleHtmlReporter generates HTML reports with screenshots and execution details.

### Basic Usage

```python theme={null}
from askui import VisionAgent
from askui.reporting import SimpleHtmlReporter

with VisionAgent(reporters=[SimpleHtmlReporter()]) as agent:
    agent.click("text")
```

The reports are saved in the `reports/` directory and include step-by-step execution details with screenshots.

## Enable Multiple Reporters

You can combine multiple reporters:

```python theme={null}
from askui import VisionAgent
from askui.reporting import AllureReporter, SimpleHtmlReporter

with VisionAgent(reporters=[SimpleHtmlReporter(), AllureReporter()]) as agent:
    agent.click("text")
```

## Allure Reporter

You can use this reporter in combination with [Allure Reporter](https://allurereport.org/). If you use it in combination with your test framework like [behave](https://allurereport.org/docs/behave/), [pytest](https://allurereport.org/docs/pytest/) or others, we assume you've already set up Allure with your test framework.

```python theme={null}
from askui import VisionAgent
from askui.reporting import AllureReporter

with VisionAgent(reporters=[AllureReporter()]) as agent:
    agent.click("button")
    # Your automation steps here
```

## Implement Your Own Reporter

To write your own reporter, you need to implement AskUI's `Reporter` interface. It offers methods you can override to adapt to your specific reporting framework:

```python theme={null}
import io
from PIL import Image
from typing import Any, Optional, Union, override
from askui import VisionAgent
from askui.reporting import Reporter

class MyOwnPrintReporter(Reporter):

    @override
    def add_message(
        self,
        role: str,
        content: Union[str, dict[str, Any], list[Any]],
        image: Optional[Image.Image | list[Image.Image]] = None,
    ) -> None:
        print(f"{role}: {str(content)}")
        if image:
            images = image if isinstance(image, list) else [image]
            print(f"Images captured: {len(images)}")

    @override
    def generate(self) -> None:
        print("Report generation completed")

# Use your custom reporter
with VisionAgent(reporters=[MyOwnPrintReporter()]) as agent:
    agent.click("text")
    # Your automation steps here
```

### Reporter Interface Methods

The `Reporter` interface provides the following methods:

* **`add_message()`** - Called for each automation step to log the action, content, and optional screenshots
* **`generate()`** - Called at the end of the session to finalize the report

Both methods are optional and can be overridden based on your reporting needs.
