Skip to content

Response

datapizza.core.clients.ClientResponse

A class for storing the response from a client. Contains a list of blocks that can be text, function calls, or structured data, maintaining the order in which they were generated.

Parameters:

Name Type Description Default
content List[Block]

A list of blocks.

required
delta str

The delta of the response. Used for streaming responses.

None

first_text property

first_text

Returns the content of the first TextBlock or None

function_calls property

function_calls

Returns all function calls in order

structured_data property

structured_data

Returns all structured data in order

text property

text

Returns concatenated text from all TextBlocks in order

thoughts property

thoughts

Returns all thoughts in order

is_pure_function_call

is_pure_function_call()

Returns True if response contains only FunctionCallBlocks

is_pure_text

is_pure_text()

Returns True if response contains only TextBlocks