nbinlineai.browser_capture_tools

Camera, microphone, recording, and display tools for the originating notebook.

Direct Python calls return mutable receipts before capture or saving finishes. Inspect status, result, media, or error in a later cell. Model tools receive only a bounded initial status; permission and display sharing need user action.

normalize_capture_action

source

normalize_capture_action(name: str, arguments: dict[str, Any]) -> dict[str, Any] | None

Validate only this family; None means another tool owns the action.

Parameter Type Default Description
name str required Capture tool name to recognize.
arguments dict[str, Any] required Arguments supplied to the named capture tool.
returns dict[str, Any] | None Normalized arguments, or None for a tool outside this family.

list_media_sources

source

list_media_sources(kind: str = 'all', cursor: str = '', limit: int = 10) -> BrowserReceipt

List camera and microphone devices without asking for permission.

Parameter Type Default Description
kind str 'all' Filter: all, camera, or microphone.
cursor str '' Page cursor, or empty for the first page.
limit int 10 Maximum devices to list, from 1 through 50.
returns BrowserReceipt Mutable browser receipt; inspect its later status and result.

start_camera

source

start_camera(audio: bool = False, device_id: str = '', facing: str = 'user') -> BrowserReceipt

Request a notebook camera preview, optionally with microphone audio.

Parameter Type Default Description
audio bool False Whether to request a microphone track with video.
device_id str '' Device ID from discovery, or empty for the browser default.
facing str 'user' Preferred camera: user or environment.
returns BrowserReceipt Mutable browser receipt; inspect its later status and result.

start_microphone

source

start_microphone(device_id: str = '') -> BrowserReceipt

Request a microphone source and local level meter.

Parameter Type Default Description
device_id str '' Device ID from discovery, or empty for the browser default.
returns BrowserReceipt Mutable browser receipt; inspect its later status and result.

capture_camera

source

capture_camera(source_id: str = '', save_to: str | None = None, max_size: int = 1280) -> BrowserReceipt

Capture a still from an owned camera, optionally saving it locally.

Parameter Type Default Description
source_id str '' Owned camera ID, or empty when exactly one camera is active.
save_to str | None None None keeps media in memory; auto or a server-root-relative path saves a new file.
max_size int 1280 Maximum longest image edge in pixels, from 1 through 4096.
returns BrowserReceipt Mutable browser receipt; inspect its later status and result.

stop_source

source

stop_source(source_id: str) -> BrowserReceipt

Stop an owned source and finalize its recording, if any.

Parameter Type Default Description
source_id str required ID of an owned live browser source.
returns BrowserReceipt Mutable browser receipt; inspect its later status and result.

start_recording

source

start_recording(source_id: str, save_to: str | None = 'auto', duration: int = 30) -> BrowserReceipt

Request one bounded recording from the source’s declared tracks.

Parameter Type Default Description
source_id str required ID of an owned live browser source.
save_to str | None 'auto' None keeps media in memory; auto or a server-root-relative path saves a new file.
duration int 30 Wall-clock limit in seconds: up to 60 in memory or 300 when saved.
returns BrowserReceipt Mutable browser receipt; inspect its later status and result.

pause_recording

source

pause_recording(operation_id: str) -> BrowserReceipt

Pause an active recording without resetting its wall-clock bound.

Parameter Type Default Description
operation_id str required ID of the recording operation.
returns BrowserReceipt Mutable browser receipt; inspect its later status and result.

resume_recording

source

resume_recording(operation_id: str) -> BrowserReceipt

Resume a paused recording.

Parameter Type Default Description
operation_id str required ID of the recording operation.
returns BrowserReceipt Mutable browser receipt; inspect its later status and result.

stop_recording

source

stop_recording(operation_id: str) -> BrowserReceipt

Flush and finish a recording at its selected destination.

Parameter Type Default Description
operation_id str required ID of the recording operation.
returns BrowserReceipt Mutable browser receipt; inspect its later status and result.

record_camera

source

record_camera(save_to: str | None = 'auto', duration: int = 30, audio: bool = False, facing: str = 'user') -> BrowserReceipt

Request a bounded camera recording with its own temporary source.

The operation closes its source when it finishes or fails.

Parameter Type Default Description
save_to str | None 'auto' None keeps media in memory; auto or a server-root-relative path saves a new file.
duration int 30 Wall-clock limit in seconds: up to 60 in memory or 300 when saved.
audio bool False Whether to include microphone audio.
facing str 'user' Preferred camera: user or environment.
returns BrowserReceipt Mutable browser receipt; inspect its later status and result.

record_microphone

source

record_microphone(save_to: str | None = 'auto', duration: int = 30, device_id: str = '') -> BrowserReceipt

Request a bounded microphone recording with its own temporary source.

The operation closes its source when it finishes or fails.

Parameter Type Default Description
save_to str | None 'auto' None keeps media in memory; auto or a server-root-relative path saves a new file.
duration int 30 Wall-clock limit in seconds: up to 60 in memory or 300 when saved.
device_id str '' Microphone ID, or empty for the browser default.
returns BrowserReceipt Mutable browser receipt; inspect its later status and result.

read_audio_levels

source

read_audio_levels(source_id: str, window_ms: int = 250) -> BrowserReceipt

Observe short RMS and peak levels without raw audio or transcription.

Parameter Type Default Description
source_id str required ID of an owned live browser source.
window_ms int 250 Measurement window in milliseconds, from 1 through 1000.
returns BrowserReceipt Mutable browser receipt; inspect its later status and result.

setup_share

source

setup_share() -> BrowserReceipt

Show this notebook’s local Share and Stop controls without capturing.

Parameter Type Default Description
returns BrowserReceipt Mutable browser receipt; inspect its later status and result.

start_share

source

start_share(audio: bool = False) -> BrowserReceipt

Offer a user-clicked display chooser for this notebook.

Parameter Type Default Description
audio bool False Whether to request display audio, if the browser supports it.
returns BrowserReceipt Mutable browser receipt; inspect its later status and result.

capture_screen

source

capture_screen(timeout: int = 15, source_id: str = '', save_to: str | None = None, max_size: int = 1280) -> BrowserReceipt

Capture one frame from an already shared display source.

Parameter Type Default Description
timeout int 15 Seconds to wait for a frame, from 1 through 60.
source_id str '' Owned display ID, or empty when exactly one share is active.
save_to str | None None None keeps media in memory; auto or a server-root-relative path saves a new file.
max_size int 1280 Maximum longest image edge in pixels, from 1 through 4096.
returns BrowserReceipt Mutable browser receipt; inspect its later status and result.

capture_tool

source

capture_tool(timeout: int = 15, source_id: str = '', save_to: str | None = None, max_size: int = 1280) -> BrowserReceipt

Capture-screen alias; model text receives a descriptor, not image pixels.

Parameter Type Default Description
timeout int 15 Seconds to wait for a frame, from 1 through 60.
source_id str '' Owned display ID, or empty when exactly one share is active.
save_to str | None None None keeps media in memory; auto or a server-root-relative path saves a new file.
max_size int 1280 Maximum longest image edge in pixels, from 1 through 4096.
returns BrowserReceipt Mutable browser receipt; inspect its later status and result.

stop_share

source

stop_share(source_id: str = '') -> BrowserReceipt

Stop a selected or unique shared display source.

Parameter Type Default Description
source_id str '' Owned display ID, or empty when exactly one share is active.
returns BrowserReceipt Mutable browser receipt; inspect its later status and result.