lib/aws-sdk-bedrockagentruntime/client.rb in aws-sdk-bedrockagentruntime-1.5.0 vs lib/aws-sdk-bedrockagentruntime/client.rb in aws-sdk-bedrockagentruntime-1.6.0
- old
+ new
@@ -397,11 +397,12 @@
super
end
# @!group API Operations
- # Sends a prompt for the agent to process and respond to.
+ # Sends a prompt for the agent to process and respond to. Use return
+ # control event type for function calling.
#
# <note markdown="1"> The CLI doesn't support `InvokeAgent`.
#
# </note>
#
@@ -414,13 +415,15 @@
# final result it yielded. For more information, see [Trace
# enablement][1].
#
# * End a conversation by setting `endSession` to `true`.
#
- # * Include attributes for the session or prompt in the `sessionState`
- # object.
+ # * In the `sessionState` object, you can include attributes for the
+ # session or prompt or parameters returned from the action group.
#
+ # * Use return control event type for function calling.
+ #
# The response is returned in the `bytes` field of the `chunk` object.
#
# * The `attribution` object contains citations for parts of the
# response.
#
@@ -448,11 +451,11 @@
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-events
#
# @option params [Boolean] :end_session
# Specifies whether to end the session with the agent or not.
#
- # @option params [required, String] :input_text
+ # @option params [String] :input_text
# The prompt text to send the agent.
#
# @option params [required, String] :session_id
# The unique identifier of the session. Use the same value across
# requests to continue the same conversation.
@@ -533,10 +536,13 @@
# event # => Aws::BedrockAgentRuntime::Types::internalServerException
# end
# handler.on_resource_not_found_exception_event do |event|
# event # => Aws::BedrockAgentRuntime::Types::resourceNotFoundException
# end
+ # handler.on_return_control_event do |event|
+ # event # => Aws::BedrockAgentRuntime::Types::returnControl
+ # end
# handler.on_service_quota_exceeded_exception_event do |event|
# event # => Aws::BedrockAgentRuntime::Types::serviceQuotaExceededException
# end
# handler.on_throttling_exception_event do |event|
# event # => Aws::BedrockAgentRuntime::Types::throttlingException
@@ -573,10 +579,13 @@
# event # => Aws::BedrockAgentRuntime::Types::internalServerException
# end
# stream.on_resource_not_found_exception_event do |event|
# event # => Aws::BedrockAgentRuntime::Types::resourceNotFoundException
# end
+ # stream.on_return_control_event do |event|
+ # event # => Aws::BedrockAgentRuntime::Types::returnControl
+ # end
# stream.on_service_quota_exceeded_exception_event do |event|
# event # => Aws::BedrockAgentRuntime::Types::serviceQuotaExceededException
# end
# stream.on_throttling_exception_event do |event|
# event # => Aws::BedrockAgentRuntime::Types::throttlingException
@@ -613,10 +622,13 @@
# event # => Aws::BedrockAgentRuntime::Types::internalServerException
# end
# handler.on_resource_not_found_exception_event do |event|
# event # => Aws::BedrockAgentRuntime::Types::resourceNotFoundException
# end
+ # handler.on_return_control_event do |event|
+ # event # => Aws::BedrockAgentRuntime::Types::returnControl
+ # end
# handler.on_service_quota_exceeded_exception_event do |event|
# event # => Aws::BedrockAgentRuntime::Types::serviceQuotaExceededException
# end
# handler.on_throttling_exception_event do |event|
# event # => Aws::BedrockAgentRuntime::Types::throttlingException
@@ -650,27 +662,54 @@
# resp = client.invoke_agent({
# agent_alias_id: "AgentAliasId", # required
# agent_id: "AgentId", # required
# enable_trace: false,
# end_session: false,
- # input_text: "InputText", # required
+ # input_text: "InputText",
# session_id: "SessionId", # required
# session_state: {
+ # invocation_id: "String",
# prompt_session_attributes: {
# "String" => "String",
# },
+ # return_control_invocation_results: [
+ # {
+ # api_result: {
+ # action_group: "String", # required
+ # api_path: "ApiPath",
+ # http_method: "String",
+ # http_status_code: 1,
+ # response_body: {
+ # "String" => {
+ # body: "String",
+ # },
+ # },
+ # response_state: "FAILURE", # accepts FAILURE, REPROMPT
+ # },
+ # function_result: {
+ # action_group: "String", # required
+ # function: "String",
+ # response_body: {
+ # "String" => {
+ # body: "String",
+ # },
+ # },
+ # response_state: "FAILURE", # accepts FAILURE, REPROMPT
+ # },
+ # },
+ # ],
# session_attributes: {
# "String" => "String",
# },
# },
# })
#
# @example Response structure
#
# All events are available at resp.completion:
# resp.completion #=> Enumerator
- # resp.completion.event_types #=> [:access_denied_exception, :bad_gateway_exception, :chunk, :conflict_exception, :dependency_failed_exception, :internal_server_exception, :resource_not_found_exception, :service_quota_exceeded_exception, :throttling_exception, :trace, :validation_exception]
+ # resp.completion.event_types #=> [:access_denied_exception, :bad_gateway_exception, :chunk, :conflict_exception, :dependency_failed_exception, :internal_server_exception, :resource_not_found_exception, :return_control, :service_quota_exceeded_exception, :throttling_exception, :trace, :validation_exception]
#
# For :access_denied_exception event available at #on_access_denied_exception_event callback and response eventstream enumerator:
# event.message #=> String
#
# For :bad_gateway_exception event available at #on_bad_gateway_exception_event callback and response eventstream enumerator:
@@ -700,24 +739,48 @@
# event.message #=> String
#
# For :resource_not_found_exception event available at #on_resource_not_found_exception_event callback and response eventstream enumerator:
# event.message #=> String
#
+ # For :return_control event available at #on_return_control_event callback and response eventstream enumerator:
+ # event.invocation_id #=> String
+ # event.invocation_inputs #=> Array
+ # event.invocation_inputs[0].api_invocation_input.action_group #=> String
+ # event.invocation_inputs[0].api_invocation_input.api_path #=> String
+ # event.invocation_inputs[0].api_invocation_input.http_method #=> String
+ # event.invocation_inputs[0].api_invocation_input.parameters #=> Array
+ # event.invocation_inputs[0].api_invocation_input.parameters[0].name #=> String
+ # event.invocation_inputs[0].api_invocation_input.parameters[0].type #=> String
+ # event.invocation_inputs[0].api_invocation_input.parameters[0].value #=> String
+ # event.invocation_inputs[0].api_invocation_input.request_body.content #=> Hash
+ # event.invocation_inputs[0].api_invocation_input.request_body.content["String"].properties #=> Array
+ # event.invocation_inputs[0].api_invocation_input.request_body.content["String"].properties[0].name #=> String
+ # event.invocation_inputs[0].api_invocation_input.request_body.content["String"].properties[0].type #=> String
+ # event.invocation_inputs[0].api_invocation_input.request_body.content["String"].properties[0].value #=> String
+ # event.invocation_inputs[0].function_invocation_input.action_group #=> String
+ # event.invocation_inputs[0].function_invocation_input.function #=> String
+ # event.invocation_inputs[0].function_invocation_input.parameters #=> Array
+ # event.invocation_inputs[0].function_invocation_input.parameters[0].name #=> String
+ # event.invocation_inputs[0].function_invocation_input.parameters[0].type #=> String
+ # event.invocation_inputs[0].function_invocation_input.parameters[0].value #=> String
+ #
# For :service_quota_exceeded_exception event available at #on_service_quota_exceeded_exception_event callback and response eventstream enumerator:
# event.message #=> String
#
# For :throttling_exception event available at #on_throttling_exception_event callback and response eventstream enumerator:
# event.message #=> String
#
# For :trace event available at #on_trace_event callback and response eventstream enumerator:
# event.agent_alias_id #=> String
# event.agent_id #=> String
+ # event.agent_version #=> String
# event.session_id #=> String
# event.trace.failure_trace.failure_reason #=> String
# event.trace.failure_trace.trace_id #=> String
# event.trace.orchestration_trace.invocation_input.action_group_invocation_input.action_group_name #=> String
# event.trace.orchestration_trace.invocation_input.action_group_invocation_input.api_path #=> String
+ # event.trace.orchestration_trace.invocation_input.action_group_invocation_input.function #=> String
# event.trace.orchestration_trace.invocation_input.action_group_invocation_input.parameters #=> Array
# event.trace.orchestration_trace.invocation_input.action_group_invocation_input.parameters[0].name #=> String
# event.trace.orchestration_trace.invocation_input.action_group_invocation_input.parameters[0].type #=> String
# event.trace.orchestration_trace.invocation_input.action_group_invocation_input.parameters[0].value #=> String
# event.trace.orchestration_trace.invocation_input.action_group_invocation_input.request_body.content #=> Hash
@@ -971,10 +1034,31 @@
# resp = client.retrieve_and_generate({
# input: { # required
# text: "RetrieveAndGenerateInputTextString", # required
# },
# retrieve_and_generate_configuration: {
+ # external_sources_configuration: {
+ # generation_configuration: {
+ # prompt_template: {
+ # text_prompt_template: "TextPromptTemplate",
+ # },
+ # },
+ # model_arn: "BedrockModelArn", # required
+ # sources: [ # required
+ # {
+ # byte_content: {
+ # content_type: "ContentType", # required
+ # data: "data", # required
+ # identifier: "Identifier", # required
+ # },
+ # s3_location: {
+ # uri: "S3Uri", # required
+ # },
+ # source_type: "S3", # required, accepts S3, BYTE_CONTENT
+ # },
+ # ],
+ # },
# knowledge_base_configuration: {
# generation_configuration: {
# prompt_template: {
# text_prompt_template: "TextPromptTemplate",
# },
@@ -1043,11 +1127,11 @@
# number_of_results: 1,
# override_search_type: "HYBRID", # accepts HYBRID, SEMANTIC
# },
# },
# },
- # type: "KNOWLEDGE_BASE", # required, accepts KNOWLEDGE_BASE
+ # type: "KNOWLEDGE_BASE", # required, accepts KNOWLEDGE_BASE, EXTERNAL_SOURCES
# },
# session_configuration: {
# kms_key_arn: "KmsKeyArn", # required
# },
# session_id: "SessionId",
@@ -1087,10 +1171,10 @@
operation: config.api.operation(operation_name),
client: self,
params: params,
config: config)
context[:gem_name] = 'aws-sdk-bedrockagentruntime'
- context[:gem_version] = '1.5.0'
+ context[:gem_version] = '1.6.0'
Seahorse::Client::Request.new(handlers, context)
end
# @api private
# @deprecated