Skip to content

ContentBlockDelta module-attribute

A block of content in a streaming response.

Union Members

ContentBlockDeltaText dataclass

The content text.

Source code in src/aws_sdk_bedrock_runtime/models.py
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
@dataclass
class ContentBlockDeltaText:
    """The content text."""

    value: str

    def serialize(self, serializer: ShapeSerializer):
        serializer.write_struct(_SCHEMA_CONTENT_BLOCK_DELTA, self)

    def serialize_members(self, serializer: ShapeSerializer):
        serializer.write_string(_SCHEMA_CONTENT_BLOCK_DELTA.members["text"], self.value)

    @classmethod
    def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
        return cls(
            value=deserializer.read_string(_SCHEMA_CONTENT_BLOCK_DELTA.members["text"])
        )

ContentBlockDeltaToolUse dataclass

Information about a tool that the model is requesting to use.

Source code in src/aws_sdk_bedrock_runtime/models.py
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
@dataclass
class ContentBlockDeltaToolUse:
    """Information about a tool that the model is requesting to use."""

    value: ToolUseBlockDelta

    def serialize(self, serializer: ShapeSerializer):
        serializer.write_struct(_SCHEMA_CONTENT_BLOCK_DELTA, self)

    def serialize_members(self, serializer: ShapeSerializer):
        serializer.write_struct(
            _SCHEMA_CONTENT_BLOCK_DELTA.members["toolUse"], self.value
        )

    @classmethod
    def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
        return cls(value=ToolUseBlockDelta.deserialize(deserializer))

ContentBlockDeltaToolResult dataclass

An incremental update that contains the results from a tool call.

Source code in src/aws_sdk_bedrock_runtime/models.py
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
@dataclass
class ContentBlockDeltaToolResult:
    """An incremental update that contains the results from a tool call."""

    value: list[ToolResultBlockDelta]

    def serialize(self, serializer: ShapeSerializer):
        serializer.write_struct(_SCHEMA_CONTENT_BLOCK_DELTA, self)

    def serialize_members(self, serializer: ShapeSerializer):
        _serialize_tool_result_blocks_delta(
            serializer, _SCHEMA_CONTENT_BLOCK_DELTA.members["toolResult"], self.value
        )

    @classmethod
    def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
        return cls(
            value=_deserialize_tool_result_blocks_delta(
                deserializer, _SCHEMA_CONTENT_BLOCK_DELTA.members["toolResult"]
            )
        )

ContentBlockDeltaReasoningContent dataclass

Contains content regarding the reasoning that is carried out by the model. Reasoning refers to a Chain of Thought (CoT) that the model generates to enhance the accuracy of its final response.

Source code in src/aws_sdk_bedrock_runtime/models.py
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
@dataclass
class ContentBlockDeltaReasoningContent:
    """Contains content regarding the reasoning that is carried out by the
    model. Reasoning refers to a Chain of Thought (CoT) that the model
    generates to enhance the accuracy of its final response.
    """

    value: ReasoningContentBlockDelta

    def serialize(self, serializer: ShapeSerializer):
        serializer.write_struct(_SCHEMA_CONTENT_BLOCK_DELTA, self)

    def serialize_members(self, serializer: ShapeSerializer):
        serializer.write_struct(
            _SCHEMA_CONTENT_BLOCK_DELTA.members["reasoningContent"], self.value
        )

    @classmethod
    def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
        return cls(
            value=_ReasoningContentBlockDeltaDeserializer().deserialize(deserializer)
        )

ContentBlockDeltaCitation dataclass

Incremental citation information that is streamed as part of the response generation process.

Source code in src/aws_sdk_bedrock_runtime/models.py
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
@dataclass
class ContentBlockDeltaCitation:
    """Incremental citation information that is streamed as part of the
    response generation process.
    """

    value: CitationsDelta

    def serialize(self, serializer: ShapeSerializer):
        serializer.write_struct(_SCHEMA_CONTENT_BLOCK_DELTA, self)

    def serialize_members(self, serializer: ShapeSerializer):
        serializer.write_struct(
            _SCHEMA_CONTENT_BLOCK_DELTA.members["citation"], self.value
        )

    @classmethod
    def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
        return cls(value=CitationsDelta.deserialize(deserializer))

ContentBlockDeltaUnknown dataclass

Represents an unknown variant.

If you receive this value, you will need to update your library to receive the parsed value.

This value may not be deliberately sent.

Source code in src/aws_sdk_bedrock_runtime/models.py
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
@dataclass
class ContentBlockDeltaUnknown:
    """Represents an unknown variant.

    If you receive this value, you will need to update your library to receive the
    parsed value.

    This value may not be deliberately sent.
    """

    tag: str

    def serialize(self, serializer: ShapeSerializer):
        raise SerializationError("Unknown union variants may not be serialized.")

    def serialize_members(self, serializer: ShapeSerializer):
        raise SerializationError("Unknown union variants may not be serialized.")

    @classmethod
    def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
        raise NotImplementedError()