# @config

## Overview

The `config` decorator is used to decorate a property in a Book class that defines default configuration values.

## Syntax

```python
@config(*args, **kwargs)
```

## Keyword Arguments

<table><thead><tr><th width="167.75">Argument</th><th width="95.546875">Type</th><th width="116.05859375">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>str</code></td><td>Optional</td><td>Specifies the name of the configuration. If not provided, the function name or value from <code>*args</code> is used.</td></tr><tr><td><code>default_value</code></td><td><code>Any</code></td><td>Optional</td><td>Specifies the default value for the configuration. If not provided, the default is <code>None</code>.</td></tr></tbody></table>

## Example

```python
DEFAULT_TIMEOUT = 30

@property
@config(default_value=DEFAULT_TIMEOUT)
def timeout(self) -> float:
 """
 Timeout in seconds when making API calls.
 """
 return self._timeout

@timeout.setter
def timeout(self, timeout: float):
 """
 Sets the timeout value in seconds.
 """
 if timeout <= 0:
  raise ValueError("timeout must be positive")
 self._timeout = timeout
```


---

# 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.kognitos.com/legacy/legacy-experience/books/custom-books/api-reference/decorators/config-decorator.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.
