Amazon Bedrock

2023/10/02 - Amazon Bedrock - 5 new api methods

Changes  Provisioned throughput feature with Amazon and third-party base models, and update validators for model identifier and taggable resource ARNs.

DeleteProvisionedModelThroughput (new) Link ¶

Deletes a provisioned throughput. For more information, see Provisioned throughput in the Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.delete_provisioned_model_throughput(
    provisionedModelId='string'
)
type provisionedModelId:

string

param provisionedModelId:

[REQUIRED]

The ARN or name of the provisioned throughput.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

ListProvisionedModelThroughputs (new) Link ¶

List the provisioned capacities. For more information, see Provisioned throughput in the Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.list_provisioned_model_throughputs(
    creationTimeAfter=datetime(2015, 1, 1),
    creationTimeBefore=datetime(2015, 1, 1),
    statusEquals='Creating'|'InService'|'Updating'|'Failed',
    modelArnEquals='string',
    nameContains='string',
    maxResults=123,
    nextToken='string',
    sortBy='CreationTime',
    sortOrder='Ascending'|'Descending'
)
type creationTimeAfter:

datetime

param creationTimeAfter:

Return provisioned capacities created after the specified time.

type creationTimeBefore:

datetime

param creationTimeBefore:

Return provisioned capacities created before the specified time.

type statusEquals:

string

param statusEquals:

Return the list of provisioned capacities that match the specified status.

type modelArnEquals:

string

param modelArnEquals:

Return the list of provisioned capacities where their model ARN is equal to this parameter.

type nameContains:

string

param nameContains:

Return the list of provisioned capacities if their name contains these characters.

type maxResults:

integer

param maxResults:

THe maximum number of results to return in the response.

type nextToken:

string

param nextToken:

Continuation token from the previous response, for Bedrock to list the next set of results.

type sortBy:

string

param sortBy:

The field to sort by in the returned list of provisioned capacities.

type sortOrder:

string

param sortOrder:

The sort order of the results.

rtype:

dict

returns:

Response Syntax

{
    'nextToken': 'string',
    'provisionedModelSummaries': [
        {
            'provisionedModelName': 'string',
            'provisionedModelArn': 'string',
            'modelArn': 'string',
            'desiredModelArn': 'string',
            'foundationModelArn': 'string',
            'modelUnits': 123,
            'desiredModelUnits': 123,
            'status': 'Creating'|'InService'|'Updating'|'Failed',
            'commitmentDuration': 'OneMonth'|'SixMonths',
            'commitmentExpirationTime': datetime(2015, 1, 1),
            'creationTime': datetime(2015, 1, 1),
            'lastModifiedTime': datetime(2015, 1, 1)
        },
    ]
}

Response Structure

  • (dict) --

    • nextToken (string) --

      Continuation token for the next request to list the next set of results.

    • provisionedModelSummaries (list) --

      List of summaries, one for each provisioned throughput in the response.

      • (dict) --

        Set of fields associated with a provisioned throughput.

        • provisionedModelName (string) --

          The name of the provisioned throughput.

        • provisionedModelArn (string) --

          The ARN of the provisioned throughput.

        • modelArn (string) --

          The ARN of the model associated with this provisioned throughput.

        • desiredModelArn (string) --

          Desired model ARN.

        • foundationModelArn (string) --

          Foundation model ARN.

        • modelUnits (integer) --

          The number of model units allocated.

        • desiredModelUnits (integer) --

          Desired model units.

        • status (string) --

          Status of the provisioned throughput.

        • commitmentDuration (string) --

          Commitment duration for the provisioned throughput.

        • commitmentExpirationTime (datetime) --

          Commitment expiration time for the provisioned throughput.

        • creationTime (datetime) --

          The time that this provisioned throughput was created.

        • lastModifiedTime (datetime) --

          The time that this provisioned throughput was last modified.

CreateProvisionedModelThroughput (new) Link ¶

Creates a provisioned throughput with dedicated capacity for a foundation model or a fine-tuned model.

For more information, see Provisioned throughput in the Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.create_provisioned_model_throughput(
    clientRequestToken='string',
    modelUnits=123,
    provisionedModelName='string',
    modelId='string',
    commitmentDuration='OneMonth'|'SixMonths',
    tags=[
        {
            'key': 'string',
            'value': 'string'
        },
    ]
)
type clientRequestToken:

string

param clientRequestToken:

Unique token value that you can provide. If this token matches a previous request, Bedrock ignores the request, but does not return an error.

This field is autopopulated if not provided.

type modelUnits:

integer

param modelUnits:

[REQUIRED]

Number of model units to allocate.

type provisionedModelName:

string

param provisionedModelName:

[REQUIRED]

Unique name for this provisioned throughput.

type modelId:

string

param modelId:

[REQUIRED]

Name or ARN of the model to associate with this provisioned throughput.

type commitmentDuration:

string

param commitmentDuration:

Commitment duration requested for the provisioned throughput.

type tags:

list

param tags:

Tags to associate with this provisioned throughput.

  • (dict) --

    Definition of the key/value pair for a tag.

    • key (string) -- [REQUIRED]

      Key for the tag.

    • value (string) -- [REQUIRED]

      Value for the tag.

rtype:

dict

returns:

Response Syntax

{
    'provisionedModelArn': 'string'
}

Response Structure

  • (dict) --

    • provisionedModelArn (string) --

      The ARN for this provisioned throughput.

GetProvisionedModelThroughput (new) Link ¶

Get details for a provisioned throughput. For more information, see Provisioned throughput in the Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.get_provisioned_model_throughput(
    provisionedModelId='string'
)
type provisionedModelId:

string

param provisionedModelId:

[REQUIRED]

The ARN or name of the provisioned throughput.

rtype:

dict

returns:

Response Syntax

{
    'modelUnits': 123,
    'desiredModelUnits': 123,
    'provisionedModelName': 'string',
    'provisionedModelArn': 'string',
    'modelArn': 'string',
    'desiredModelArn': 'string',
    'foundationModelArn': 'string',
    'status': 'Creating'|'InService'|'Updating'|'Failed',
    'creationTime': datetime(2015, 1, 1),
    'lastModifiedTime': datetime(2015, 1, 1),
    'failureMessage': 'string',
    'commitmentDuration': 'OneMonth'|'SixMonths',
    'commitmentExpirationTime': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • modelUnits (integer) --

      The current number of model units requested to be available for this provisioned throughput.

    • desiredModelUnits (integer) --

      The desired number of model units that was requested to be available for this provisioned throughput.

    • provisionedModelName (string) --

      The name of the provisioned throughput.

    • provisionedModelArn (string) --

      The ARN of the provisioned throughput.

    • modelArn (string) --

      The ARN or name of the model associated with this provisioned throughput.

    • desiredModelArn (string) --

      The ARN of the new model to asssociate with this provisioned throughput.

    • foundationModelArn (string) --

      ARN of the foundation model.

    • status (string) --

      Status of the provisioned throughput.

    • creationTime (datetime) --

      The timestamp of the creation time for this provisioned throughput.

    • lastModifiedTime (datetime) --

      The timestamp of the last modified time of this provisioned throughput.

    • failureMessage (string) --

      Failure message for any issues that the create operation encounters.

    • commitmentDuration (string) --

      Commitment duration of the provisioned throughput.

    • commitmentExpirationTime (datetime) --

      Commitment expiration time for the provisioned throughput.

UpdateProvisionedModelThroughput (new) Link ¶

Update a provisioned throughput. For more information, see Provisioned throughput in the Bedrock User Guide.

See also: AWS API Documentation

Request Syntax

client.update_provisioned_model_throughput(
    provisionedModelId='string',
    desiredProvisionedModelName='string',
    desiredModelId='string'
)
type provisionedModelId:

string

param provisionedModelId:

[REQUIRED]

The ARN or name of the provisioned throughput to update.

type desiredProvisionedModelName:

string

param desiredProvisionedModelName:

The new name for this provisioned throughput.

type desiredModelId:

string

param desiredModelId:

The ARN of the new model to associate with this provisioned throughput.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --