| CaptureRenderer | R Documentation |
A Renderer that records every agent-output event into an in-memory log instead of displaying it – useful for testing, replay, and reusing agent-output logic in non-terminal UIs.
aisdk::Renderer -> CaptureRenderer
logA list of recorded events, each a list with a type field.
new()Create a capturing renderer with an empty log.
CaptureRenderer$new()
process_chunk()Record a streamed text chunk.
CaptureRenderer$process_chunk(text, done = FALSE)
textA character chunk, or NULL.
doneTRUE when the text segment is complete.
start_thinking()Record the start of a thinking stream.
CaptureRenderer$start_thinking()
stop_thinking()Record the end of a thinking stream.
CaptureRenderer$stop_thinking()
render_tool_start()Record the start of a tool call.
CaptureRenderer$render_tool_start(name, arguments)
nameTool name.
argumentsTool arguments.
render_tool_result()Record a tool result.
CaptureRenderer$render_tool_result( name, result, success = TRUE, raw_result = NULL )
nameTool name.
resultThe display result.
successWhether the tool call succeeded.
raw_resultThe raw result.
reset_for_new_step()Record a ReAct step boundary.
CaptureRenderer$reset_for_new_step()
events()Return the recorded events.
CaptureRenderer$events()
A list of recorded events.
clone()The objects of this class are cloneable with this method.
CaptureRenderer$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.