Skip to content

ToolInputSchema module-attribute

ToolInputSchema = Union[ToolInputSchemaJson | ToolInputSchemaUnknown]

The schema for the tool. The top level schema type must be object. For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide.

Union Members

ToolInputSchemaJson dataclass

The JSON schema for the tool. For more information, see JSON Schema Reference.

Source code in src/aws_sdk_bedrock_runtime/models.py
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
@dataclass
class ToolInputSchemaJson:
    """The JSON schema for the tool. For more information, see [JSON Schema
    Reference](https://json-schema.org/understanding-json-schema/reference).
    """

    value: Document

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

    def serialize_members(self, serializer: ShapeSerializer):
        serializer.write_document(_SCHEMA_TOOL_INPUT_SCHEMA.members["json"], self.value)

    @classmethod
    def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
        return cls(
            value=deserializer.read_document(_SCHEMA_TOOL_INPUT_SCHEMA.members["json"])
        )

ToolInputSchemaUnknown 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
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
@dataclass
class ToolInputSchemaUnknown:
    """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()