Bedrock Agent Runtime

This page documents function available when using the Bedrock_Agent_Runtime module, created with @service Bedrock_Agent_Runtime.

Index

Documentation

Main.Bedrock_Agent_Runtime.invoke_agentMethod
invoke_agent(agent_alias_id, agent_id, session_id)
invoke_agent(agent_alias_id, agent_id, session_id, params::Dict{String,<:Any})

The CLI doesn't support InvokeAgent. Sends a prompt for the agent to process and respond to. Note the following fields for the request: To continue the same conversation with an agent, use the same sessionId value in the request. To activate trace enablement, turn enableTrace to true. Trace enablement helps you follow the agent's reasoning process that led it to the information it processed, the actions it took, and the final result it yielded. For more information, see Trace enablement. End a conversation by setting endSession to true. In the sessionState object, you can include attributes for the session or prompt or, if you configured an action group to return control, results from invocation of the action group. The response is returned in the bytes field of the chunk object. The attribution object contains citations for parts of the response. If you set enableTrace to true in the request, you can trace the agent's steps and reasoning process that led it to the response. If the action predicted was configured to return control, the response returns parameters for the action, elicited from the user, in the returnControl field. Errors are also surfaced in the response.

Arguments

  • agent_alias_id: The alias of the agent to use.
  • agent_id: The unique identifier of the agent to use.
  • session_id: The unique identifier of the session. Use the same value across requests to continue the same conversation.

Optional Parameters

Optional parameters can be passed as a params::Dict{String,<:Any}. Valid keys are:

  • "enableTrace": Specifies whether to turn on the trace or not to track the agent's reasoning process. For more information, see Trace enablement.
  • "endSession": Specifies whether to end the session with the agent or not.
  • "inputText": The prompt text to send the agent. If you include returnControlInvocationResults in the sessionState field, the inputText field will be ignored.
  • "sessionState": Contains parameters that specify various attributes of the session. For more information, see Control session context. If you include returnControlInvocationResults in the sessionState field, the inputText field will be ignored.
source
Main.Bedrock_Agent_Runtime.retrieveMethod
retrieve(knowledge_base_id, retrieval_query)
retrieve(knowledge_base_id, retrieval_query, params::Dict{String,<:Any})

Queries a knowledge base and retrieves information from it.

Arguments

  • knowledge_base_id: The unique identifier of the knowledge base to query.
  • retrieval_query: Contains the query to send the knowledge base.

Optional Parameters

Optional parameters can be passed as a params::Dict{String,<:Any}. Valid keys are:

  • "nextToken": If there are more results than can fit in the response, the response returns a nextToken. Use this token in the nextToken field of another request to retrieve the next batch of results.
  • "retrievalConfiguration": Contains configurations for the knowledge base query and retrieval process. For more information, see Query configurations.
source
Main.Bedrock_Agent_Runtime.retrieve_and_generateMethod
retrieve_and_generate(input)
retrieve_and_generate(input, params::Dict{String,<:Any})

Queries a knowledge base and generates responses based on the retrieved results. The response only cites sources that are relevant to the query.

Arguments

  • input: Contains the query to be made to the knowledge base.

Optional Parameters

Optional parameters can be passed as a params::Dict{String,<:Any}. Valid keys are:

  • "retrieveAndGenerateConfiguration": Contains configurations for the knowledge base query and retrieval process. For more information, see Query configurations.
  • "sessionConfiguration": Contains details about the session with the knowledge base.
  • "sessionId": The unique identifier of the session. Reuse the same value to continue the same session with the knowledge base.
source