notebooklm
VerifiedInstall, authenticate, troubleshoot, and operate Gemini Notebook through the notebooklm-py CLI or typed async Python API. Use for notebook and source management, grounded chat and research, and artifact generation or download when the user mentions Gemini Notebook, notebooklm-py, the notebooklm CLI, or its Python API. Do not use for the generic Gemini API or unrelated content creation.
scripts/_live_auth_scenarios/_contract.py
View on GitHub"""The result/failure contract shared by every live-auth scenario module.
The orchestrator (``scripts/live_auth_matrix.py``) treats a scenario child
process as: *exit 0 with one JSON object on stdout* or *non-zero with a
value-free diagnostic on stderr*. This module is the only place that shape is
implemented, so the cells cannot drift apart from each other.
"""
from __future__ import annotations
import asyncio
import json
from collections.abc import Callable, Coroutine
from typing import Any
#: The JSON object a scenario prints on success. Keys are per-scenario and are
#: read by the matrix report, so they may not be renamed casually.
ScenarioResult = dict[str, Any]
class ScenarioError(RuntimeError):
"""A live-auth scenario invariant did not hold.
Subclasses :class:`RuntimeError` because that is what the embedded
``python -c`` cells raised before #2180 moved them into real modules; the
orchestrator only ever sees the non-zero exit code and the stderr tail.
"""
def require(condition: object, message: str) -> None:
"""Fail the scenario unless ``condition`` is truthy.
Deliberately not ``assert``: these programs may run under ``python -O``,
where ``assert`` is stripped and the scenario would silently "pass".
``message`` must name the broken invariant, never quote a credential.
"""
if not condition:
raise ScenarioError(message)
def emit(payload: ScenarioResult) -> None:
"""Print the scenario's single-line JSON result on stdout."""
print(json.dumps(payload))
def run_scenario(scenario: Callable[[], Coroutine[Any, Any, ScenarioResult]]) -> None:
"""Run one async scenario to completion and emit its JSON result.
The result is printed *after* the scenario's async context managers have
unwound, so a client that fails to close cannot be masked by a success
payload that was already flushed.
"""
emit(asyncio.run(scenario()))
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |