nbinlineai.browser_capture_tools
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
normalize_capture_action(name: str, arguments: dict[str, Any]) -> dict[str, Any] | NoneValidate 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
list_media_sources(kind: str = 'all', cursor: str = '', limit: int = 10) -> BrowserReceiptList 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
start_camera(audio: bool = False, device_id: str = '', facing: str = 'user') -> BrowserReceiptRequest 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
start_microphone(device_id: str = '') -> BrowserReceiptRequest 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
capture_camera(source_id: str = '', save_to: str | None = None, max_size: int = 1280) -> BrowserReceiptCapture 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
stop_source(source_id: str) -> BrowserReceiptStop 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
start_recording(source_id: str, save_to: str | None = 'auto', duration: int = 30) -> BrowserReceiptRequest 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
pause_recording(operation_id: str) -> BrowserReceiptPause 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
resume_recording(operation_id: str) -> BrowserReceiptResume 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
stop_recording(operation_id: str) -> BrowserReceiptFlush 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
record_camera(save_to: str | None = 'auto', duration: int = 30, audio: bool = False, facing: str = 'user') -> BrowserReceiptRequest 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
record_microphone(save_to: str | None = 'auto', duration: int = 30, device_id: str = '') -> BrowserReceiptRequest 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
read_audio_levels(source_id: str, window_ms: int = 250) -> BrowserReceiptObserve 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. |
capture_screen
capture_screen(timeout: int = 15, source_id: str = '', save_to: str | None = None, max_size: int = 1280) -> BrowserReceiptCapture 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
capture_tool(timeout: int = 15, source_id: str = '', save_to: str | None = None, max_size: int = 1280) -> BrowserReceiptCapture-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. |