---
sidebar:
  hidden: true
title: roboto.domain.files.lazy_lookup_file
---
## Module Contents

### LazyLookupFile

```python
class roboto.domain.files.lazy_lookup_file.LazyLookupFile(
    hydrate_fn: Callable[[], roboto.domain.files.file.File],
)
```

`from roboto.domain.files import LazyLookupFile`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/files/lazy_lookup_file.py#L12-L48)

Bases: [`roboto.domain.files.file.File`](/docs/reference/python-sdk/roboto/domain/files/file#roboto.domain.files.file.File)

A file handle that defers fetching the file until one of its attributes is first read or set.

[`upload_file()`](/docs/reference/python-sdk/roboto/domain/files/file_system#roboto.domain.files.file_system.FileSystem.upload_file) returns one, so a caller who never uses the uploaded file makes no request for it. The first attribute access calls `hydrate_fn`, the function the handle was built with, and forwards that access, and every later one, to the [`File`](/docs/reference/python-sdk/roboto/domain/files/file#roboto.domain.files.file.File) it returns. If `hydrate_fn` raises, the exception propagates from that attribute access, and the next access calls `hydrate_fn` again.

**Parameters**

- **hydrate_fn** (`Callable[[], roboto.domain.files.file.File]`)
