# Service Buttons

Service buttons allow you to create additional tabs in your application's interface by writing specially formatted messages to stderr. These tabs can either link to external URLs or embed content directly.

### Basic Usage

To display a service button, print a message to stderr in the following format:

```
::show-service-button::{options}
```

#### Required Options

* `url` (string): The URL the button should link to or embed
* `name` (string): The display name for the button

#### Optional Options

* `embed` (boolean): When set to `true`, embeds the URL content inline instead of showing a button. Default: `false`
* `style` (string): Alternative way to set embed mode using `style: "embed"`

### Examples

#### Basic Button Tab

Create a tab that links to an external URL:

```python
import sys
print('::show-service-button::{"url":"http://example.com/","name":"Example"}', file=sys.stderr)
```

<figure><img src="/files/zIXqJPxrPOh0NVr2kNQy" alt=""><figcaption></figcaption></figure>

#### Embedded Content Tab

Create a tab with embedded content displayed directly:

```python
import sys
print('::show-service-button::{"url":"https://dashboard.example.com/","name":"Dashboard",embed:true}', file=sys.stderr)
```

Or using the `style` parameter:

```python
import sys
print('::show-service-button::{"url":"https://dashboard.example.com/","name":"Dashboard",style:"embed"}', file=sys.stderr)
```

<figure><img src="/files/Sddmjs8mozSeN0ouQWYy" alt=""><figcaption></figcaption></figure>

### Important Notes

* Service button commands **must** be written to **stderr**, not stdout
* Each service button creates a new **tab** in the interface
* The JSON options should be valid JSON format (use double quotes for strings)
* Tabs with `embed: true` will display the content inline, while regular tabs will link to external URLs


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.valohai.com/executions/advanced-features/service-buttons.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
