View a markdown version of this page

InvokeInlineAgent - Amazon Bedrock

InvokeInlineAgent

Invokes an inline Amazon Bedrock agent using the configurations you provide with the request.

  • Specify the following fields for security purposes.

    • (Optional) customerEncryptionKeyArn – The Amazon Resource Name (ARN) of a AWS KMS key to encrypt the creation of the agent.

    • (Optional) idleSessionTTLinSeconds – Specify the number of seconds for which the agent should maintain session information. After this time expires, the subsequent InvokeInlineAgent request begins a new session.

  • To override the default prompt behavior for agent orchestration and to use advanced prompts, include a promptOverrideConfiguration object. For more information, see Advanced prompts.

  • The agent instructions will not be honored if your agent has only one knowledge base, uses default prompts, has no action group, and user input is disabled.

Note

The AWS CLI doesn't support streaming operations in Amazon Bedrock, including InvokeInlineAgent.

Request Syntax

POST /agents/sessionId HTTP/1.1 Content-type: application/json { "actionGroups": [ { "actionGroupExecutor": { ... }, "actionGroupName": "string", "apiSchema": { ... }, "description": "string", "functionSchema": { ... }, "parentActionGroupSignature": "string", "parentActionGroupSignatureParams": { "string" : "string" } } ], "agentCollaboration": "string", "agentName": "string", "bedrockModelConfigurations": { "performanceConfig": { "latency": "string" } }, "collaboratorConfigurations": [ { "agentAliasArn": "string", "collaboratorInstruction": "string", "collaboratorName": "string", "relayConversationHistory": "string" } ], "collaborators": [ { "actionGroups": [ { "actionGroupExecutor": { ... }, "actionGroupName": "string", "apiSchema": { ... }, "description": "string", "functionSchema": { ... }, "parentActionGroupSignature": "string", "parentActionGroupSignatureParams": { "string" : "string" } } ], "agentCollaboration": "string", "agentName": "string", "collaboratorConfigurations": [ { "agentAliasArn": "string", "collaboratorInstruction": "string", "collaboratorName": "string", "relayConversationHistory": "string" } ], "customerEncryptionKeyArn": "string", "foundationModel": "string", "guardrailConfiguration": { "guardrailIdentifier": "string", "guardrailVersion": "string" }, "idleSessionTTLInSeconds": number, "instruction": "string", "knowledgeBases": [ { "description": "string", "knowledgeBaseId": "string", "retrievalConfiguration": { "managedSearchConfiguration": { "filter": { ... }, "numberOfResults": number, "rerankingConfiguration": { "bedrockRerankingConfiguration": { "metadataConfiguration": { "selectionMode": "string", "selectiveModeConfiguration": { ... } }, "modelConfiguration": { "additionalModelRequestFields": { "string" : JSON value }, "modelArn": "string" }, "numberOfRerankedResults": number }, "type": "string" }, "rerankingModelType": "string" }, "vectorSearchConfiguration": { "filter": { ... }, "implicitFilterConfiguration": { "metadataAttributes": [ { "description": "string", "key": "string", "type": "string" } ], "modelArn": "string" }, "numberOfResults": number, "overrideSearchType": "string", "rerankingConfiguration": { "bedrockRerankingConfiguration": { "metadataConfiguration": { "selectionMode": "string", "selectiveModeConfiguration": { ... } }, "modelConfiguration": { "additionalModelRequestFields": { "string" : JSON value }, "modelArn": "string" }, "numberOfRerankedResults": number }, "type": "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" } ] } } ], "customerEncryptionKeyArn": "string", "customOrchestration": { "executor": { ... } }, "enableTrace": boolean, "endSession": boolean, "foundationModel": "string", "guardrailConfiguration": { "guardrailIdentifier": "string", "guardrailVersion": "string" }, "idleSessionTTLInSeconds": number, "inlineSessionState": { "conversationHistory": { "messages": [ { "content": [ { ... } ], "role": "string" } ] }, "files": [ { "name": "string", "source": { "byteContent": { "data": blob, "mediaType": "string" }, "s3Location": { "uri": "string" }, "sourceType": "string" }, "useCase": "string" } ], "invocationId": "string", "promptSessionAttributes": { "string" : "string" }, "returnControlInvocationResults": [ { ... } ], "sessionAttributes": { "string" : "string" } }, "inputText": "string", "instruction": "string", "knowledgeBases": [ { "description": "string", "knowledgeBaseId": "string", "retrievalConfiguration": { "managedSearchConfiguration": { "filter": { ... }, "numberOfResults": number, "rerankingConfiguration": { "bedrockRerankingConfiguration": { "metadataConfiguration": { "selectionMode": "string", "selectiveModeConfiguration": { ... } }, "modelConfiguration": { "additionalModelRequestFields": { "string" : JSON value }, "modelArn": "string" }, "numberOfRerankedResults": number }, "type": "string" }, "rerankingModelType": "string" }, "vectorSearchConfiguration": { "filter": { ... }, "implicitFilterConfiguration": { "metadataAttributes": [ { "description": "string", "key": "string", "type": "string" } ], "modelArn": "string" }, "numberOfResults": number, "overrideSearchType": "string", "rerankingConfiguration": { "bedrockRerankingConfiguration": { "metadataConfiguration": { "selectionMode": "string", "selectiveModeConfiguration": { ... } }, "modelConfiguration": { "