Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

CreateAgentCommand not saving the bedrock agent !! #7296

Unanswered
rr-jino-jose asked this question in Q&A
Discussion options

hello I was trying out this code

/**
 * Create a Bedrock Agent
 */
export async function createBedrockAgent({
 name,
 description = "",
 instruction,
 model,
 resourceRoleArn,
 userId = "anonymous",
 userName = "Anonymous User",
 }: CreateAgentParams): Promise<AgentResponse> {
 try {
 const command = new CreateAgentCommand({
 agentName: name,
 description,
 idleSessionTTLInSeconds: 3600, // 1 hour idle timeout
 instruction,
 agentResourceRoleArn: resourceRoleArn,
 foundationModel: model,
 tags: {
 "owner": userName,
 "owner_id": userId,
 "created_at": new Date().toISOString()
 },
 memoryConfiguration: {
 enabledMemoryTypes: ["SESSION_SUMMARY"],
 storageDays: 10,
 sessionSummaryConfiguration: {
 maxRecentSessions: 20
 }
 }
 });
 
 const response = await client.send(command);
 
 if (!response.agent?.agentId) {
 throw new Error("Failed to create agent: No agentId in response");
 }
 
 const agentId = response.agent.agentId;
 
 return {
 agentId,
 agentName: response.agent.agentName || "",
 description: response.agent.description || "",
 status: "online",
 agentAliasId: "", // new agents don't have aliases yet
 };
 } catch (error) {
 logger.errorLog(`Error creating Bedrock agent: ${error}`);
 throw error;
 }
 }

It does creates the agent but doesn't save the configuration, similar to the one in console button "save". I am not providing any resourceRoleARN and let aws create it. But to prepare I need to save the agent !! ... Am i missing something ?? Any help is appreciated. Thanks.

You must be logged in to vote

Replies: 1 comment

Comment options

Hello! Reopening this discussion to make it searchable.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /