Member must satisfy regular expression pattern: DRAFT; Value 'Version 3' at 'agentVersion' failed

0

I get this error when calling from laravel. where can I find the versions in the Agent. I do have two different version Request: $result = $this->bedrockAgentClient->associateAgentKnowledgeBase([ 'agentId' => '4EG1ETD7H4', // REQUIRED 'agentVersion' => 'Version 3', // REQUIRED 'description' => 'Query knowledgebase if enabled', // REQUIRED 'knowledgeBaseId' => 'FG0TYJOWZ5', // REQUIRED 'knowledgeBaseState' => 'ENABLED' ]);

Error Response: { "error": "Error executing "AssociateAgentKnowledgeBase" on "https://bedrock-agent.us-east-1.amazonaws.com/agents/4EG1ETD7H4/agentversions/Version%203/knowledgebases/"; AWS HTTP error: Client error: PUT https://bedrock-agent.us-east-1.amazonaws.com/agents/4EG1ETD7H4/agentversions/Version%203/knowledgebases/ resulted in a 400 Bad Request response:\n{"message":"2 validation errors detected: Value 'Version 3' at 'agentVersion' failed to satisfy constraint: Member must (truncated...)\n ValidationException (client): 2 validation errors detected: Value 'Version 3' at 'agentVersion' failed to satisfy constraint: Member must satisfy regular expression pattern: DRAFT; Value 'Version 3' at 'agentVersion' failed to satisfy constraint: Member must have length less than or equal to 5 - {"message":"2 validation errors detected: Value 'Version 3' at 'agentVersion' failed to satisfy constraint: Member must satisfy regular expression pattern: DRAFT; Value 'Version 3' at 'agentVersion' failed to satisfy constraint: Member must have length less than or equal to 5"}" }

Guru
已提問 1 個月前檢視次數 57 次
1 個回答
0
已接受的答案

Hello Guru,

I've reviewed the requirements for the agentVersion parameter. It appears that it must be a fixed length of 5 characters and match the pattern ^DRAFT$. This means the only acceptable value for agentVersion is "DRAFT". Using any other value, such as "v1", will not meet the validation requirements and will result in a Validation Exception.

💡 Please ensure that you are passing the correct value "DRAFT" for the agentVersion parameter, as this is the only value allowed based on the constraints provided.

Key Source:
profile picture
專家
已回答 1 個月前
  • Thanks very much Osvaldo. I'll try that out. Appreciate your response!!

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南