# NotebookLM Report Template Customization: How to Use Custom Prompts

> Unlock NotebookLM report template customization using custom prompts. Override default formatting and control output with your specific instructions for tailored reports.

- Repository: [Teng Lin/notebooklm-py](https://github.com/teng-lin/notebooklm-py)
- Tags: how-to-guide
- Published: 2026-03-09

---

**NotebookLM report template customization allows you to override default formatting by setting `report_format=ReportFormat.CUSTOM` and supplying a `custom_prompt` containing your specific instructions, while the `extra_instructions` parameter is ignored.**

The `teng-lin/notebooklm-py` library provides programmatic access to NotebookLM's report generation capabilities. By leveraging **NotebookLM report template customization**, you can direct the AI to produce outputs in specific styles, tones, and structures that standard templates like `BRIEFING_DOC` or `BLOG_POST` cannot accommodate.

## Understanding the Custom Report Format Architecture

The system implements report customization through a specific enum value and dedicated prompt handling logic.

### The ReportFormat Enum

In [`src/notebooklm/rpc/types.py`](https://github.com/teng-lin/notebooklm-py/blob/main/src/notebooklm/rpc/types.py), the `ReportFormat` enum defines four supported formats at line 237:

- `BRIEFING_DOC`
- `STUDY_GUIDE`
- `BLOG_POST`
- `CUSTOM`

Selecting `ReportFormat.CUSTOM` triggers specialized prompt handling that bypasses the default template configurations.

### API Implementation Details

The `generate_report` coroutine in [`src/notebooklm/_artifacts.py`](https://github.com/teng-lin/notebooklm-py/blob/main/src/notebooklm/_artifacts.py) (lines 468-506) serves as the primary entry point. When processing a custom report request, the method constructs a configuration payload where the `"prompt"` field accepts your `custom_prompt` input. According to the source code at lines 525-530, if you do not provide a `custom_prompt`, the system falls back to a generic instruction: `"Create a report based on the provided sources."`

**Critical constraint:** As implemented at lines 86-88 in the same file, the `extra_instructions` argument has no effect when using the CUSTOM format. Any additional guidance must be embedded directly within your `custom_prompt` string.

## How to Implement Custom Prompts

You can utilize custom prompts through either the Python API or the CLI interface, depending on your integration needs.

### Python API Approach

When calling `client.artifacts.generate_report`, explicitly set `report_format=ReportFormat.CUSTOM` and provide your complete instructions via the `custom_prompt` parameter.

```python
import asyncio
from notebooklm import NotebookLMClient, ReportFormat

async def create_custom_report():
    async with await NotebookLMClient.from_storage() as client:
        nb_id = "notebook_12345"
        
        # Embed all structural and stylistic instructions here

        prompt = (
            "Write a concise technical briefing for senior engineers. "
            "Include a high‑level summary, three key take‑aways, and a short "
            "actionable checklist. Use bullet points and keep each section under "
            "100 words."
        )
        
        status = await client.artifacts.generate_report(
            notebook_id=nb_id,
            report_format=ReportFormat.CUSTOM,
            custom_prompt=prompt,
            language="en",
        )
        print("Report generation started, task ID:", status.task_id)

asyncio.run(create_custom_report())

```

**Key implementation details:**
- **Do not** pass `extra_instructions`—it will be discarded by the logic at lines 86-88.
- The `custom_prompt` must contain all formatting, tone, and structural requirements.

### CLI Approach

The command-line interface in [`src/notebooklm/cli/generate.py`](https://github.com/teng-lin/notebooklm-py/blob/main/src/notebooklm/cli/generate.py) (lines 49-64) provides two paths to custom reports:

1. **Automatic detection:** Provide a description as a positional argument without specifying a format flag. The CLI automatically switches to CUSTOM format.
2. **Explicit declaration:** Use `--format custom` alongside your description.

```bash

# Auto-detects CUSTOM format

notebooklm generate report "Create a 2‑page executive summary with visual data highlights."

# Explicit format declaration

notebooklm generate report --format custom "Produce a markdown guide for onboarding new hires."

```

**CLI constraint:** As coded at lines 59-64, the `--append` flag triggers a warning and is discarded when using the custom format, reinforcing that all instructions must reside in the main description.

## Practical Implementation Examples

### Combining Custom Prompts with Source Filtering

You can restrict which sources the AI considers while applying your custom template:

```bash
notebooklm generate report \
    --format custom \
    --language fr \
    -s src_001 -s src_007 \
    "Rédigez un rapport détaillé en français sur les tendances du marché, incluant une section FAQ."

```

This invocation sends:
- `language="fr"`
- `source_ids=["src_001", "src_007"]`
- `custom_prompt` containing the full French instruction set

### Advanced Python Customization

For workflows requiring dynamic prompt construction:

```python
async def generate_structured_analysis(client, notebook_id, topic):
    custom_template = f"""
    Generate a structured analysis report on {topic} with the following requirements:
    1. Executive Summary (maximum 150 words)
    2. Technical Deep Dive with code examples
    3. Risk Assessment matrix
    4. Conclusion with next steps
    
    Tone: Professional but accessible to non-technical stakeholders.
    Format: Markdown with clear H2 headers for each section.
    """
    
    return await client.artifacts.generate_report(
        notebook_id=notebook_id,
        report_format=ReportFormat.CUSTOM,
        custom_prompt=custom_template,
        language="en"
    )

```

## Summary

- **Use `ReportFormat.CUSTOM`** from [`src/notebooklm/rpc/types.py`](https://github.com/teng-lin/notebooklm-py/blob/main/src/notebooklm/rpc/types.py) to enable template customization.
- **Provide all instructions via `custom_prompt`** in the `generate_report` method (lines 468-506 in [`src/notebooklm/_artifacts.py`](https://github.com/teng-lin/notebooklm-py/blob/main/src/notebooklm/_artifacts.py)).
- **Omit `extra_instructions`** when using custom format, as it is explicitly ignored (lines 86-88).
- **CLI users** can pass descriptions as positional arguments for automatic custom format detection, but cannot use `--append` with custom reports (lines 49-64 in [`src/notebooklm/cli/generate.py`](https://github.com/teng-lin/notebooklm-py/blob/main/src/notebooklm/cli/generate.py)).
- **Fallback behavior:** Empty custom prompts default to `"Create a report based on the provided sources."`

## Frequently Asked Questions

### Can I use extra_instructions with custom prompts?

No. According to the implementation in [`src/notebooklm/_artifacts.py`](https://github.com/teng-lin/notebooklm-py/blob/main/src/notebooklm/_artifacts.py) at lines 86-88, the `extra_instructions` parameter is explicitly ignored when `report_format` is set to CUSTOM. You must embed all additional guidance directly within your `custom_prompt` string.

### What happens if I don't provide a custom_prompt with CUSTOM format?

The system uses a generic fallback. As defined at lines 525-530 in [`src/notebooklm/_artifacts.py`](https://github.com/teng-lin/notebooklm-py/blob/main/src/notebooklm/_artifacts.py), when `custom_prompt` is None or empty, the API receives the default instruction: `"Create a report based on the provided sources."`

### Can I combine custom prompts with specific source selection?

Yes. The `custom_prompt` parameter functions independently of source filtering. You can pass `source_ids` (Python API) or `-s` flags (CLI) alongside your custom prompt to limit which notebook sources the AI analyzes when generating your customized report.

### Is there a difference between CLI positional arguments and --format custom?

Functionally, no. The CLI logic at lines 49-58 in [`src/notebooklm/cli/generate.py`](https://github.com/teng-lin/notebooklm-py/blob/main/src/notebooklm/cli/generate.py) automatically converts a positional description argument to `report_format=ReportFormat.CUSTOM`. Explicitly using `--format custom` produces identical API calls but is required when you need to combine custom formatting with other flags like `--language` or `-s`.