ResponseStream

sealed class ResponseStream

The response from invoking the agent and associated citations and trace information.

Inheritors

Types

Link copied to clipboard
data class Chunk(val value: PayloadPart) : ResponseStream

Contains a part of an agent response and citations for it.

Link copied to clipboard
data class Files(val value: FilePart) : ResponseStream

Contains intermediate response for code interpreter if any files have been generated.

Link copied to clipboard

Contains the parameters and information that the agent elicited from the customer to carry out an action. This information is returned to the system and can be used in your own setup for fulfilling the action.

Link copied to clipboard
Link copied to clipboard
data class Trace(val value: TracePart) : ResponseStream

Contains information about the agent and session, alongside the agent's reasoning process and results from calling actions and querying knowledge bases and metadata about the trace. You can use the trace to understand how the agent arrived at the response it provided the customer. For more information, see Trace events.

Functions

Link copied to clipboard

Casts this ResponseStream as a Chunk and retrieves its aws.sdk.kotlin.services.bedrockagentruntime.model.PayloadPart value. Throws an exception if the ResponseStream is not a Chunk.

Link copied to clipboard

Casts this ResponseStream as a Chunk and retrieves its aws.sdk.kotlin.services.bedrockagentruntime.model.PayloadPart value. Returns null if the ResponseStream is not a Chunk.

Link copied to clipboard

Casts this ResponseStream as a Files and retrieves its aws.sdk.kotlin.services.bedrockagentruntime.model.FilePart value. Throws an exception if the ResponseStream is not a Files.

Link copied to clipboard

Casts this ResponseStream as a Files and retrieves its aws.sdk.kotlin.services.bedrockagentruntime.model.FilePart value. Returns null if the ResponseStream is not a Files.

Link copied to clipboard
Link copied to clipboard

Casts this ResponseStream as a Trace and retrieves its aws.sdk.kotlin.services.bedrockagentruntime.model.TracePart value. Throws an exception if the ResponseStream is not a Trace.

Link copied to clipboard

Casts this ResponseStream as a Trace and retrieves its aws.sdk.kotlin.services.bedrockagentruntime.model.TracePart value. Returns null if the ResponseStream is not a Trace.