Skip to content

Tool module-attribute

Information about a tool that you can use with the Converse API. For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide.

Union Members

ToolToolSpec dataclass

The specfication for the tool.

Source code in src/aws_sdk_bedrock_runtime/models.py
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
@dataclass
class ToolToolSpec:
    """The specfication for the tool."""

    value: ToolSpecification

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

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

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

ToolSystemTool dataclass

Specifies the system-defined tool that you want use.

Source code in src/aws_sdk_bedrock_runtime/models.py
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
@dataclass
class ToolSystemTool:
    """Specifies the system-defined tool that you want use."""

    value: SystemTool

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

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

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

ToolCachePoint dataclass

CachePoint to include in the tool configuration.

Source code in src/aws_sdk_bedrock_runtime/models.py
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
@dataclass
class ToolCachePoint:
    """CachePoint to include in the tool configuration."""

    value: CachePointBlock

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

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

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

ToolUnknown 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
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
@dataclass
class ToolUnknown:
    """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()