Imperative handle exposed via ref for programmatic widget control.
Provides methods to interact with the widget after operation completion.
Use this handle when your operation generates artifacts (files) that you need to
download and process in your application. Agent operations like prompt_gemini_agent
can produce reports, CSVs, images, or other file outputs that are made available
via the artifacts array in the result.
// Download artifacts if available if (result.artifacts && result.artifacts.length > 0) { for (constartifactofresult.artifacts) { try { // Download artifact using the ref handle constblob = awaitwidgetRef.current?.downloadArtifact({ operationId:result.operationId, artifactPath:artifact.path });
// Process the downloaded artifact if (blob) { // Option 1: Trigger browser download consturl = URL.createObjectURL(blob); consta = document.createElement('a'); a.href = url; a.download = artifact.name; a.click(); URL.revokeObjectURL(url);
Imperative handle exposed via ref for programmatic widget control. Provides methods to interact with the widget after operation completion.
Use this handle when your operation generates artifacts (files) that you need to download and process in your application. Agent operations like
prompt_gemini_agentcan produce reports, CSVs, images, or other file outputs that are made available via the artifacts array in the result.Example
Complete example using ref to download artifacts: