Skip to main content
The Lyzr ADK provides several response types for different execution modes. This reference covers all response objects and their properties.

Quick Start


AgentResponse

The main response object returned by agent.run().

Properties

Methods

has_files()

Check if the response contains generated files.

files (property)

Get the list of generated files.

to_dict()

Convert response to dictionary.

Example


AgentStream

A single chunk from a streaming response. Yielded when using stream=True.

Properties

Methods

has_files()

Check if the chunk contains generated files.

files (property)

Get generated files from the chunk.

to_dict()

Convert chunk to dictionary.

Example

Streaming with Progress


Artifact

Represents a generated file when file_output=True.

Properties

Methods

download()

Download the artifact to a local file.

Example


TaskResponse

Response from creating a long-running task.

Properties


TaskStatus

Status of a long-running task.

Methods

is_complete()

Check if task has finished (completed or failed).

is_successful()

Check if task completed successfully.

Structured Responses

When using response_model, responses are parsed into Pydantic models:

With Streaming


Common Patterns

Save All Files

Stream to File

Handle All Response Types