選取您的 Cookie 偏好設定

我們使用提供自身網站和服務所需的基本 Cookie 和類似工具。我們使用效能 Cookie 收集匿名統計資料,以便了解客戶如何使用我們的網站並進行改進。基本 Cookie 無法停用,但可以按一下「自訂」或「拒絕」以拒絕效能 Cookie。

如果您同意,AWS 與經核准的第三方也會使用 Cookie 提供實用的網站功能、記住您的偏好設定,並顯示相關內容,包括相關廣告。若要接受或拒絕所有非必要 Cookie,請按一下「接受」或「拒絕」。若要進行更詳細的選擇,請按一下「自訂」。

UpdateAgent - Amazon Bedrock
此頁面尚未翻譯為您的語言。 請求翻譯

UpdateAgent

Updates the configuration of an agent.

Request Syntax

PUT /agents/agentId/ HTTP/1.1 Content-type: application/json { "agentCollaboration": "string", "agentName": "string", "agentResourceRoleArn": "string", "customerEncryptionKeyArn": "string", "customOrchestration": { "executor": { ... } }, "description": "string", "foundationModel": "string", "guardrailConfiguration": { "guardrailIdentifier": "string", "guardrailVersion": "string" }, "idleSessionTTLInSeconds": number, "instruction": "string", "memoryConfiguration": { "enabledMemoryTypes": [ "string" ], "sessionSummaryConfiguration": { "maxRecentSessions": number }, "storageDays": number }, "orchestrationType": "string", "promptOverrideConfiguration": { "overrideLambda": "string", "promptConfigurations": [ { "additionalModelRequestFields": JSON value, "basePromptTemplate": "string", "foundationModel": "string", "inferenceConfiguration": { "maximumLength": number, "stopSequences": [ "string" ], "temperature": number, "topK": number, "topP": number }, "parserMode": "string", "promptCreationMode": "string", "promptState": "string", "promptType": "string" } ] } }

URI Request Parameters

The request uses the following URI parameters.

agentId

The unique identifier of the agent.

Pattern: ^[0-9a-zA-Z]{10}$

Required: Yes

Request Body

The request accepts the following data in JSON format.

agentCollaboration

The agent's collaboration role.

Type: String

Valid Values: SUPERVISOR | SUPERVISOR_ROUTER | DISABLED

Required: No

agentName

Specifies a new name for the agent.

Type: String

Pattern: ^([0-9a-zA-Z][_-]?){1,100}$

Required: Yes

agentResourceRoleArn

The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 2048.

Pattern: ^arn:aws(-[^:]+)?:iam::([0-9]{12})?:role/.+$

Required: Yes

customerEncryptionKeyArn

The Amazon Resource Name (ARN) of the AWS KMS key with which to encrypt the agent.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: ^arn:aws(|-cn|-us-gov):kms:[a-zA-Z0-9-]*:[0-9]{12}:key/[a-zA-Z0-9-]{36}$

Required: No

customOrchestration

Contains details of the custom orchestration configured for the agent.

Type: CustomOrchestration object

Required: No

description

Specifies a new description of the agent.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 200.

Required: No

foundationModel

The identifier for the model that you want to be used for orchestration by the agent you create.

The modelId to provide depends on the type of model or throughput that you use:

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: ^(arn:aws(-[^:]{1,12})?:(bedrock|sagemaker):[a-z0-9-]{1,20}:([0-9]{12})?:([a-z-]+/)?)?([a-zA-Z0-9.-]{1,63}){0,2}(([:][a-z0-9-]{1,63}){0,2})?(/[a-z0-9]{1,12})?$

Required: Yes

guardrailConfiguration

The unique Guardrail configuration assigned to the agent when it is updated.

Type: GuardrailConfiguration object

Required: No

idleSessionTTLInSeconds

The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.

A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout.

Type: Integer

Valid Range: Minimum value of 60. Maximum value of 3600.

Required: No

instruction

Specifies new instructions that tell the agent what it should do and how it should interact with users.

Type: String

Length Constraints: Minimum length of 40. Maximum length of 4000.

Required: No

memoryConfiguration

Specifies the new memory configuration for the agent.

Type: MemoryConfiguration object

Required: No

orchestrationType

Specifies the type of orchestration strategy for the agent. This is set to DEFAULT orchestration type, by default.

Type: String

Valid Values: DEFAULT | CUSTOM_ORCHESTRATION

Required: No

promptOverrideConfiguration

Contains configurations to override prompts in different parts of an agent sequence. For more information, see Advanced prompts.

Type: PromptOverrideConfiguration object

Required: No

Response Syntax

HTTP/1.1 202 Content-type: application/json { "agent": { "agentArn": "string", "agentCollaboration": "string", "agentId": "string", "agentName": "string", "agentResourceRoleArn": "string", "agentStatus": "string", "agentVersion": "string", "clientToken": "string", "createdAt": "string", "customerEncryptionKeyArn": "string", "customOrchestration": { "executor": { ... } }, "description": "string", "failureReasons": [ "string" ], "foundationModel": "string", "guardrailConfiguration": { "guardrailIdentifier": "string", "guardrailVersion": "string" }, "idleSessionTTLInSeconds": number, "instruction": "string", "memoryConfiguration": { "enabledMemoryTypes": [ "string" ], "sessionSummaryConfiguration": { "maxRecentSessions": number }, "storageDays": number }, "orchestrationType": "string", "preparedAt": "string", "promptOverrideConfiguration": { "overrideLambda": "string", "promptConfigurations": [ { "additionalModelRequestFields": JSON value, "basePromptTemplate": "string", "foundationModel": "string", "inferenceConfiguration": { "maximumLength": number, "stopSequences": [ "string" ], "temperature": number, "topK": number, "topP": number }, "parserMode": "string", "promptCreationMode": "string", "promptState": "string", "promptType": "string" } ] }, "recommendedActions": [ "string" ], "updatedAt": "string" } }

Response Elements

If the action is successful, the service sends back an HTTP 202 response.

The following data is returned in JSON format by the service.

agent

Contains details about the agent that was updated.

Type: Agent object

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

The request is denied because of missing access permissions.

HTTP Status Code: 403

ConflictException

There was a conflict performing an operation.

HTTP Status Code: 409

InternalServerException

An internal server error occurred. Retry your request.

HTTP Status Code: 500

ResourceNotFoundException

The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.

HTTP Status Code: 404

ServiceQuotaExceededException

The number of requests exceeds the service quota. Resubmit your request later.

HTTP Status Code: 402

ThrottlingException

The number of requests exceeds the limit. Resubmit your request later.

HTTP Status Code: 429

ValidationException

Input validation failed. Check your request parameters and retry the request.

HTTP Status Code: 400

Examples

Example request

This example illustrates one usage of UpdateAgent.

PUT /agents/ABCDEFGHIJ/ HTTP/1.1 Content-type: application/json { "agentName": "TestName", "agentResourceRoleArn": "arn:aws:iam::123456789012:role/AmazonBedrockExecutionRoleForAgents_user", "instruction": "You are an IT agent who solves customer's problems", "description": "Description is here", "idleSessionTTLInSeconds": 900, "foundationModel": "anthropic.claude-v2" }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

隱私權網站條款Cookie 偏好設定
© 2025, Amazon Web Services, Inc.或其附屬公司。保留所有權利。