Streaming-related type definitions for the SDK.

These types are modeled after the Bedrock API.

-   Bedrock docs: [https://docs.aws.amazon.com/bedrock/latest/APIReference/API\_Types\_Amazon\_Bedrock\_Runtime.html](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_Types_Amazon_Bedrock_Runtime.html)

## MessageStartEvent

```python
class MessageStartEvent(TypedDict)
```

Defined in: [src/strands/types/streaming.py:16](https://github.com/strands-agents/harness-sdk/blob/main/strands-py/src/strands/types/streaming.py#L16)

Event signaling the start of a message in a streaming response.

**Attributes**:

-   `role` - The role of the message sender (e.g., “assistant”, “user”).

## ContentBlockStartEvent

```python
class ContentBlockStartEvent(TypedDict)
```

Defined in: [src/strands/types/streaming.py:26](https://github.com/strands-agents/harness-sdk/blob/main/strands-py/src/strands/types/streaming.py#L26)

Event signaling the start of a content block in a streaming response.

**Attributes**:

-   `contentBlockIndex` - Index of the content block within the message. This is optional to accommodate different model providers.
-   `start` - Information about the content block being started.

## ContentBlockDeltaText

```python
class ContentBlockDeltaText(TypedDict)
```

Defined in: [src/strands/types/streaming.py:39](https://github.com/strands-agents/harness-sdk/blob/main/strands-py/src/strands/types/streaming.py#L39)

Text content delta in a streaming response.

**Attributes**:

-   `text` - The text fragment being streamed.

## ContentBlockDeltaToolUse

```python
class ContentBlockDeltaToolUse(TypedDict)
```

Defined in: [src/strands/types/streaming.py:49](https://github.com/strands-agents/harness-sdk/blob/main/strands-py/src/strands/types/streaming.py#L49)

Tool use input delta in a streaming response.

**Attributes**:

-   `input` - The tool input fragment being streamed.
-   `toolUseId` - Optional tool use identifier. Some providers emit this in the delta instead of contentBlockStart.
-   `name` - Optional tool name. Some providers emit this in the delta instead of contentBlockStart.

## CitationSourceContentDelta

```python
class CitationSourceContentDelta(TypedDict)
```

Defined in: [src/strands/types/streaming.py:65](https://github.com/strands-agents/harness-sdk/blob/main/strands-py/src/strands/types/streaming.py#L65)

Contains incremental updates to source content text during streaming.

Allows clients to build up the cited content progressively during streaming responses.

**Attributes**:

-   `text` - An incremental update to the text content from the source document that is being cited.

## CitationsDelta

```python
class CitationsDelta(TypedDict)
```

Defined in: [src/strands/types/streaming.py:79](https://github.com/strands-agents/harness-sdk/blob/main/strands-py/src/strands/types/streaming.py#L79)

Contains incremental updates to citation information during streaming.

This allows clients to build up citation data progressively as the response is generated.

**Attributes**:

-   `location` - Specifies the precise location within a source document where cited content can be found. This can include character-level positions, page numbers, or document chunks depending on the document type and indexing method.
-   `sourceContent` - The specific content from the source document that was referenced or cited in the generated response.
-   `title` - The title or identifier of the source document being cited.

## ReasoningContentBlockDelta

```python
class ReasoningContentBlockDelta(TypedDict)
```

Defined in: [src/strands/types/streaming.py:100](https://github.com/strands-agents/harness-sdk/blob/main/strands-py/src/strands/types/streaming.py#L100)

Delta for reasoning content block in a streaming response.

**Attributes**:

-   `redactedContent` - The content in the reasoning that was encrypted by the model provider for safety reasons.
-   `signature` - A token that verifies that the reasoning text was generated by the model.
-   `text` - The reasoning that the model used to return the output.

## ContentBlockDelta

```python
class ContentBlockDelta(TypedDict)
```

Defined in: [src/strands/types/streaming.py:114](https://github.com/strands-agents/harness-sdk/blob/main/strands-py/src/strands/types/streaming.py#L114)

A block of content in a streaming response.

**Attributes**:

-   `reasoningContent` - Contains content regarding the reasoning that is carried out by the model.
-   `text` - Text fragment being streamed.
-   `toolUse` - Tool use input fragment being streamed.

## ContentBlockDeltaEvent

```python
class ContentBlockDeltaEvent(TypedDict)
```

Defined in: [src/strands/types/streaming.py:129](https://github.com/strands-agents/harness-sdk/blob/main/strands-py/src/strands/types/streaming.py#L129)

Event containing a delta update for a content block in a streaming response.

**Attributes**:

-   `contentBlockIndex` - Index of the content block within the message. This is optional to accommodate different model providers.
-   `delta` - The incremental content update for the content block.

## ContentBlockStopEvent

```python
class ContentBlockStopEvent(TypedDict)
```

Defined in: [src/strands/types/streaming.py:142](https://github.com/strands-agents/harness-sdk/blob/main/strands-py/src/strands/types/streaming.py#L142)

Event signaling the end of a content block in a streaming response.

**Attributes**:

-   `contentBlockIndex` - Index of the content block within the message. This is optional to accommodate different model providers.

## MessageStopEvent

```python
class MessageStopEvent(TypedDict)
```

Defined in: [src/strands/types/streaming.py:153](https://github.com/strands-agents/harness-sdk/blob/main/strands-py/src/strands/types/streaming.py#L153)

Event signaling the end of a message in a streaming response.

**Attributes**:

-   `additionalModelResponseFields` - Additional fields to include in model response.
-   `stopReason` - The reason why the model stopped generating content.

## MetadataEvent

```python
class MetadataEvent(TypedDict)
```

Defined in: [src/strands/types/streaming.py:165](https://github.com/strands-agents/harness-sdk/blob/main/strands-py/src/strands/types/streaming.py#L165)

Event containing metadata about the streaming response.

**Attributes**:

-   `metrics` - Performance metrics related to the model invocation.
-   `trace` - Trace information for debugging and monitoring.
-   `usage` - Resource usage information for the model invocation.

## ExceptionEvent

```python
class ExceptionEvent(TypedDict)
```

Defined in: [src/strands/types/streaming.py:179](https://github.com/strands-agents/harness-sdk/blob/main/strands-py/src/strands/types/streaming.py#L179)

Base event for exceptions in a streaming response.

**Attributes**:

-   `message` - The error message describing what went wrong.

## ModelStreamErrorEvent

```python
class ModelStreamErrorEvent(ExceptionEvent)
```

Defined in: [src/strands/types/streaming.py:189](https://github.com/strands-agents/harness-sdk/blob/main/strands-py/src/strands/types/streaming.py#L189)

Event for model streaming errors.

**Attributes**:

-   `originalMessage` - The original error message from the model provider.
-   `originalStatusCode` - The HTTP status code returned by the model provider.

## RedactContentEvent

```python
class RedactContentEvent(TypedDict)
```

Defined in: [src/strands/types/streaming.py:201](https://github.com/strands-agents/harness-sdk/blob/main/strands-py/src/strands/types/streaming.py#L201)

Event for redacting content.

**Attributes**:

-   `redactUserContentMessage` - The string to overwrite the users input with.
-   `redactAssistantContentMessage` - The string to overwrite the assistants output with.

## StreamEvent

```python
class StreamEvent(TypedDict)
```

Defined in: [src/strands/types/streaming.py:214](https://github.com/strands-agents/harness-sdk/blob/main/strands-py/src/strands/types/streaming.py#L214)

The messages output stream.

**Attributes**:

-   `contentBlockDelta` - Delta content for a content block.
-   `contentBlockStart` - Start of a content block.
-   `contentBlockStop` - End of a content block.
-   `internalServerException` - Internal server error information.
-   `messageStart` - Start of a message.
-   `messageStop` - End of a message.
-   `metadata` - Metadata about the streaming response.
-   `modelStreamErrorException` - Model streaming error information.
-   `serviceUnavailableException` - Service unavailable error information.
-   `throttlingException` - Throttling error information.
-   `validationException` - Validation error information.