aws-sdk-bedrockagentruntime 1.30.0 → 1.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ddd19c39eedacc41d2bef21c75ff2669e9badf69d4b784b9b828ef5c9482d225
4
- data.tar.gz: b3b78d61228b5a8db3fbe3efa336e94f11b1f83b453c7aa1f726d7ffab940ef5
3
+ metadata.gz: 0456f26043768c8a899bebf3fe9e02f7f5ee664c2543ad1ab5ae243d97d00040
4
+ data.tar.gz: 8e3b743740e6dba682763df127ede599c8a13d1c298984daeee302c59a9935b0
5
5
  SHA512:
6
- metadata.gz: 3ce22f6888e86e1c8303524cbd67791e688f760182d326fb88f856c98aabefe428310b52b954d243f0d7a8e8a46e79c2e3eae70e8f0acde4d47e24d9b7ef1543
7
- data.tar.gz: 9fae515be407940cd0821112ef9248f5f714e139d332da4f3d6a222ca589332c59cf161729493ae69a309ac894fd614664d7fba3e9bb967f7630aa4ae35402d2
6
+ metadata.gz: c01cf4655c0cbb656e2245f6253c761a656feec75ed4872ea78bd66c8f9b363c34ced4d77d28202b238b0f459c584cc29078de74cdc76ad31868bec447c884ba
7
+ data.tar.gz: 1a6a16f958c93536a30eb437c21d5b590d92c7f129edcc31c0d1fd6d74ef6c37e606c5816213ac64446e7cec62ff759f00b239f2eee87a89bd867fd0017cf275
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.31.0 (2024-11-08)
5
+ ------------------
6
+
7
+ * Feature - This release adds trace functionality to Bedrock Prompt Flows
8
+
4
9
  1.30.0 (2024-11-06)
5
10
  ------------------
6
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.30.0
1
+ 1.31.0
@@ -1259,6 +1259,16 @@ module Aws::BedrockAgentRuntime
1259
1259
  #
1260
1260
  # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-test.html
1261
1261
  #
1262
+ # @option params [Boolean] :enable_trace
1263
+ # Specifies whether to return the trace for the flow or not. Traces
1264
+ # track inputs and outputs for nodes in the flow. For more information,
1265
+ # see [Track each step in your prompt flow by viewing its trace in
1266
+ # Amazon Bedrock][1].
1267
+ #
1268
+ #
1269
+ #
1270
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html
1271
+ #
1262
1272
  # @option params [required, String] :flow_alias_identifier
1263
1273
  # The unique identifier of the flow alias.
1264
1274
  #
@@ -1334,6 +1344,9 @@ module Aws::BedrockAgentRuntime
1334
1344
  # handler.on_flow_output_event_event do |event|
1335
1345
  # event # => Aws::BedrockAgentRuntime::Types::flowOutputEvent
1336
1346
  # end
1347
+ # handler.on_flow_trace_event_event do |event|
1348
+ # event # => Aws::BedrockAgentRuntime::Types::flowTraceEvent
1349
+ # end
1337
1350
  # handler.on_internal_server_exception_event do |event|
1338
1351
  # event # => Aws::BedrockAgentRuntime::Types::internalServerException
1339
1352
  # end
@@ -1374,6 +1387,9 @@ module Aws::BedrockAgentRuntime
1374
1387
  # stream.on_flow_output_event_event do |event|
1375
1388
  # event # => Aws::BedrockAgentRuntime::Types::flowOutputEvent
1376
1389
  # end
1390
+ # stream.on_flow_trace_event_event do |event|
1391
+ # event # => Aws::BedrockAgentRuntime::Types::flowTraceEvent
1392
+ # end
1377
1393
  # stream.on_internal_server_exception_event do |event|
1378
1394
  # event # => Aws::BedrockAgentRuntime::Types::internalServerException
1379
1395
  # end
@@ -1414,6 +1430,9 @@ module Aws::BedrockAgentRuntime
1414
1430
  # handler.on_flow_output_event_event do |event|
1415
1431
  # event # => Aws::BedrockAgentRuntime::Types::flowOutputEvent
1416
1432
  # end
1433
+ # handler.on_flow_trace_event_event do |event|
1434
+ # event # => Aws::BedrockAgentRuntime::Types::flowTraceEvent
1435
+ # end
1417
1436
  # handler.on_internal_server_exception_event do |event|
1418
1437
  # event # => Aws::BedrockAgentRuntime::Types::internalServerException
1419
1438
  # end
@@ -1449,6 +1468,7 @@ module Aws::BedrockAgentRuntime
1449
1468
  # @example Request syntax with placeholder values
1450
1469
  #
1451
1470
  # resp = client.invoke_flow({
1471
+ # enable_trace: false,
1452
1472
  # flow_alias_identifier: "FlowAliasIdentifier", # required
1453
1473
  # flow_identifier: "FlowIdentifier", # required
1454
1474
  # inputs: [ # required
@@ -1467,7 +1487,7 @@ module Aws::BedrockAgentRuntime
1467
1487
  #
1468
1488
  # All events are available at resp.response_stream:
1469
1489
  # resp.response_stream #=> Enumerator
1470
- # resp.response_stream.event_types #=> [:access_denied_exception, :bad_gateway_exception, :conflict_exception, :dependency_failed_exception, :flow_completion_event, :flow_output_event, :internal_server_exception, :resource_not_found_exception, :service_quota_exceeded_exception, :throttling_exception, :validation_exception]
1490
+ # resp.response_stream.event_types #=> [:access_denied_exception, :bad_gateway_exception, :conflict_exception, :dependency_failed_exception, :flow_completion_event, :flow_output_event, :flow_trace_event, :internal_server_exception, :resource_not_found_exception, :service_quota_exceeded_exception, :throttling_exception, :validation_exception]
1471
1491
  #
1472
1492
  # For :access_denied_exception event available at #on_access_denied_exception_event callback and response eventstream enumerator:
1473
1493
  # event.message #=> String
@@ -1490,6 +1510,20 @@ module Aws::BedrockAgentRuntime
1490
1510
  # event.node_name #=> String
1491
1511
  # event.node_type #=> String, one of "FlowInputNode", "FlowOutputNode", "LambdaFunctionNode", "KnowledgeBaseNode", "PromptNode", "ConditionNode", "LexNode"
1492
1512
  #
1513
+ # For :flow_trace_event event available at #on_flow_trace_event_event callback and response eventstream enumerator:
1514
+ # event.trace.condition_node_result_trace.node_name #=> String
1515
+ # event.trace.condition_node_result_trace.satisfied_conditions #=> Array
1516
+ # event.trace.condition_node_result_trace.satisfied_conditions[0].condition_name #=> String
1517
+ # event.trace.condition_node_result_trace.timestamp #=> Time
1518
+ # event.trace.node_input_trace.fields #=> Array
1519
+ # event.trace.node_input_trace.fields[0].node_input_name #=> String
1520
+ # event.trace.node_input_trace.node_name #=> String
1521
+ # event.trace.node_input_trace.timestamp #=> Time
1522
+ # event.trace.node_output_trace.fields #=> Array
1523
+ # event.trace.node_output_trace.fields[0].node_output_name #=> String
1524
+ # event.trace.node_output_trace.node_name #=> String
1525
+ # event.trace.node_output_trace.timestamp #=> Time
1526
+ #
1493
1527
  # For :internal_server_exception event available at #on_internal_server_exception_event callback and response eventstream enumerator:
1494
1528
  # event.message #=> String
1495
1529
  #
@@ -1920,7 +1954,7 @@ module Aws::BedrockAgentRuntime
1920
1954
  tracer: tracer
1921
1955
  )
1922
1956
  context[:gem_name] = 'aws-sdk-bedrockagentruntime'
1923
- context[:gem_version] = '1.30.0'
1957
+ context[:gem_version] = '1.31.0'
1924
1958
  Seahorse::Client::Request.new(handlers, context)
1925
1959
  end
1926
1960
 
@@ -85,6 +85,19 @@ module Aws::BedrockAgentRuntime
85
85
  FlowOutputContent = Shapes::UnionShape.new(name: 'FlowOutputContent')
86
86
  FlowOutputEvent = Shapes::StructureShape.new(name: 'FlowOutputEvent')
87
87
  FlowResponseStream = Shapes::StructureShape.new(name: 'FlowResponseStream')
88
+ FlowTrace = Shapes::UnionShape.new(name: 'FlowTrace')
89
+ FlowTraceCondition = Shapes::StructureShape.new(name: 'FlowTraceCondition')
90
+ FlowTraceConditionNodeResultEvent = Shapes::StructureShape.new(name: 'FlowTraceConditionNodeResultEvent')
91
+ FlowTraceConditions = Shapes::ListShape.new(name: 'FlowTraceConditions')
92
+ FlowTraceEvent = Shapes::StructureShape.new(name: 'FlowTraceEvent')
93
+ FlowTraceNodeInputContent = Shapes::UnionShape.new(name: 'FlowTraceNodeInputContent')
94
+ FlowTraceNodeInputEvent = Shapes::StructureShape.new(name: 'FlowTraceNodeInputEvent')
95
+ FlowTraceNodeInputField = Shapes::StructureShape.new(name: 'FlowTraceNodeInputField')
96
+ FlowTraceNodeInputFields = Shapes::ListShape.new(name: 'FlowTraceNodeInputFields')
97
+ FlowTraceNodeOutputContent = Shapes::UnionShape.new(name: 'FlowTraceNodeOutputContent')
98
+ FlowTraceNodeOutputEvent = Shapes::StructureShape.new(name: 'FlowTraceNodeOutputEvent')
99
+ FlowTraceNodeOutputField = Shapes::StructureShape.new(name: 'FlowTraceNodeOutputField')
100
+ FlowTraceNodeOutputFields = Shapes::ListShape.new(name: 'FlowTraceNodeOutputFields')
88
101
  Function = Shapes::StringShape.new(name: 'Function')
89
102
  FunctionInvocationInput = Shapes::StructureShape.new(name: 'FunctionInvocationInput')
90
103
  FunctionParameter = Shapes::StructureShape.new(name: 'FunctionParameter')
@@ -172,6 +185,7 @@ module Aws::BedrockAgentRuntime
172
185
  MimeType = Shapes::StringShape.new(name: 'MimeType')
173
186
  ModelInvocationInput = Shapes::StructureShape.new(name: 'ModelInvocationInput')
174
187
  NextToken = Shapes::StringShape.new(name: 'NextToken')
188
+ NodeInputName = Shapes::StringShape.new(name: 'NodeInputName')
175
189
  NodeName = Shapes::StringShape.new(name: 'NodeName')
176
190
  NodeOutputName = Shapes::StringShape.new(name: 'NodeOutputName')
177
191
  NodeType = Shapes::StringShape.new(name: 'NodeType')
@@ -443,6 +457,7 @@ module Aws::BedrockAgentRuntime
443
457
  FlowResponseStream.add_member(:dependency_failed_exception, Shapes::ShapeRef.new(shape: DependencyFailedException, location_name: "dependencyFailedException"))
444
458
  FlowResponseStream.add_member(:flow_completion_event, Shapes::ShapeRef.new(shape: FlowCompletionEvent, event: true, location_name: "flowCompletionEvent"))
445
459
  FlowResponseStream.add_member(:flow_output_event, Shapes::ShapeRef.new(shape: FlowOutputEvent, event: true, location_name: "flowOutputEvent"))
460
+ FlowResponseStream.add_member(:flow_trace_event, Shapes::ShapeRef.new(shape: FlowTraceEvent, event: true, location_name: "flowTraceEvent"))
446
461
  FlowResponseStream.add_member(:internal_server_exception, Shapes::ShapeRef.new(shape: InternalServerException, location_name: "internalServerException"))
447
462
  FlowResponseStream.add_member(:resource_not_found_exception, Shapes::ShapeRef.new(shape: ResourceNotFoundException, location_name: "resourceNotFoundException"))
448
463
  FlowResponseStream.add_member(:service_quota_exceeded_exception, Shapes::ShapeRef.new(shape: ServiceQuotaExceededException, location_name: "serviceQuotaExceededException"))
@@ -450,6 +465,63 @@ module Aws::BedrockAgentRuntime
450
465
  FlowResponseStream.add_member(:validation_exception, Shapes::ShapeRef.new(shape: ValidationException, location_name: "validationException"))
451
466
  FlowResponseStream.struct_class = Types::FlowResponseStream
452
467
 
468
+ FlowTrace.add_member(:condition_node_result_trace, Shapes::ShapeRef.new(shape: FlowTraceConditionNodeResultEvent, location_name: "conditionNodeResultTrace"))
469
+ FlowTrace.add_member(:node_input_trace, Shapes::ShapeRef.new(shape: FlowTraceNodeInputEvent, location_name: "nodeInputTrace"))
470
+ FlowTrace.add_member(:node_output_trace, Shapes::ShapeRef.new(shape: FlowTraceNodeOutputEvent, location_name: "nodeOutputTrace"))
471
+ FlowTrace.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
472
+ FlowTrace.add_member_subclass(:condition_node_result_trace, Types::FlowTrace::ConditionNodeResultTrace)
473
+ FlowTrace.add_member_subclass(:node_input_trace, Types::FlowTrace::NodeInputTrace)
474
+ FlowTrace.add_member_subclass(:node_output_trace, Types::FlowTrace::NodeOutputTrace)
475
+ FlowTrace.add_member_subclass(:unknown, Types::FlowTrace::Unknown)
476
+ FlowTrace.struct_class = Types::FlowTrace
477
+
478
+ FlowTraceCondition.add_member(:condition_name, Shapes::ShapeRef.new(shape: String, required: true, location_name: "conditionName"))
479
+ FlowTraceCondition.struct_class = Types::FlowTraceCondition
480
+
481
+ FlowTraceConditionNodeResultEvent.add_member(:node_name, Shapes::ShapeRef.new(shape: NodeName, required: true, location_name: "nodeName"))
482
+ FlowTraceConditionNodeResultEvent.add_member(:satisfied_conditions, Shapes::ShapeRef.new(shape: FlowTraceConditions, required: true, location_name: "satisfiedConditions"))
483
+ FlowTraceConditionNodeResultEvent.add_member(:timestamp, Shapes::ShapeRef.new(shape: DateTimestamp, required: true, location_name: "timestamp"))
484
+ FlowTraceConditionNodeResultEvent.struct_class = Types::FlowTraceConditionNodeResultEvent
485
+
486
+ FlowTraceConditions.member = Shapes::ShapeRef.new(shape: FlowTraceCondition)
487
+
488
+ FlowTraceEvent.add_member(:trace, Shapes::ShapeRef.new(shape: FlowTrace, required: true, location_name: "trace"))
489
+ FlowTraceEvent.struct_class = Types::FlowTraceEvent
490
+
491
+ FlowTraceNodeInputContent.add_member(:document, Shapes::ShapeRef.new(shape: Document, location_name: "document"))
492
+ FlowTraceNodeInputContent.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
493
+ FlowTraceNodeInputContent.add_member_subclass(:document, Types::FlowTraceNodeInputContent::Document)
494
+ FlowTraceNodeInputContent.add_member_subclass(:unknown, Types::FlowTraceNodeInputContent::Unknown)
495
+ FlowTraceNodeInputContent.struct_class = Types::FlowTraceNodeInputContent
496
+
497
+ FlowTraceNodeInputEvent.add_member(:fields, Shapes::ShapeRef.new(shape: FlowTraceNodeInputFields, required: true, location_name: "fields"))
498
+ FlowTraceNodeInputEvent.add_member(:node_name, Shapes::ShapeRef.new(shape: NodeName, required: true, location_name: "nodeName"))
499
+ FlowTraceNodeInputEvent.add_member(:timestamp, Shapes::ShapeRef.new(shape: DateTimestamp, required: true, location_name: "timestamp"))
500
+ FlowTraceNodeInputEvent.struct_class = Types::FlowTraceNodeInputEvent
501
+
502
+ FlowTraceNodeInputField.add_member(:content, Shapes::ShapeRef.new(shape: FlowTraceNodeInputContent, required: true, location_name: "content"))
503
+ FlowTraceNodeInputField.add_member(:node_input_name, Shapes::ShapeRef.new(shape: NodeInputName, required: true, location_name: "nodeInputName"))
504
+ FlowTraceNodeInputField.struct_class = Types::FlowTraceNodeInputField
505
+
506
+ FlowTraceNodeInputFields.member = Shapes::ShapeRef.new(shape: FlowTraceNodeInputField)
507
+
508
+ FlowTraceNodeOutputContent.add_member(:document, Shapes::ShapeRef.new(shape: Document, location_name: "document"))
509
+ FlowTraceNodeOutputContent.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
510
+ FlowTraceNodeOutputContent.add_member_subclass(:document, Types::FlowTraceNodeOutputContent::Document)
511
+ FlowTraceNodeOutputContent.add_member_subclass(:unknown, Types::FlowTraceNodeOutputContent::Unknown)
512
+ FlowTraceNodeOutputContent.struct_class = Types::FlowTraceNodeOutputContent
513
+
514
+ FlowTraceNodeOutputEvent.add_member(:fields, Shapes::ShapeRef.new(shape: FlowTraceNodeOutputFields, required: true, location_name: "fields"))
515
+ FlowTraceNodeOutputEvent.add_member(:node_name, Shapes::ShapeRef.new(shape: NodeName, required: true, location_name: "nodeName"))
516
+ FlowTraceNodeOutputEvent.add_member(:timestamp, Shapes::ShapeRef.new(shape: DateTimestamp, required: true, location_name: "timestamp"))
517
+ FlowTraceNodeOutputEvent.struct_class = Types::FlowTraceNodeOutputEvent
518
+
519
+ FlowTraceNodeOutputField.add_member(:content, Shapes::ShapeRef.new(shape: FlowTraceNodeOutputContent, required: true, location_name: "content"))
520
+ FlowTraceNodeOutputField.add_member(:node_output_name, Shapes::ShapeRef.new(shape: NodeOutputName, required: true, location_name: "nodeOutputName"))
521
+ FlowTraceNodeOutputField.struct_class = Types::FlowTraceNodeOutputField
522
+
523
+ FlowTraceNodeOutputFields.member = Shapes::ShapeRef.new(shape: FlowTraceNodeOutputField)
524
+
453
525
  FunctionInvocationInput.add_member(:action_group, Shapes::ShapeRef.new(shape: String, required: true, location_name: "actionGroup"))
454
526
  FunctionInvocationInput.add_member(:action_invocation_type, Shapes::ShapeRef.new(shape: ActionInvocationType, location_name: "actionInvocationType"))
455
527
  FunctionInvocationInput.add_member(:function, Shapes::ShapeRef.new(shape: String, location_name: "function"))
@@ -628,6 +700,7 @@ module Aws::BedrockAgentRuntime
628
700
  InvokeAgentResponse[:payload] = :completion
629
701
  InvokeAgentResponse[:payload_member] = InvokeAgentResponse.member(:completion)
630
702
 
703
+ InvokeFlowRequest.add_member(:enable_trace, Shapes::ShapeRef.new(shape: Boolean, location_name: "enableTrace"))
631
704
  InvokeFlowRequest.add_member(:flow_alias_identifier, Shapes::ShapeRef.new(shape: FlowAliasIdentifier, required: true, location: "uri", location_name: "flowAliasIdentifier"))
632
705
  InvokeFlowRequest.add_member(:flow_identifier, Shapes::ShapeRef.new(shape: FlowIdentifier, required: true, location: "uri", location_name: "flowIdentifier"))
633
706
  InvokeFlowRequest.add_member(:inputs, Shapes::ShapeRef.new(shape: FlowInputs, required: true, location_name: "inputs"))
@@ -133,6 +133,10 @@ module Aws::BedrockAgentRuntime
133
133
  @event_emitter.on(:flow_output_event, block) if block_given?
134
134
  end
135
135
 
136
+ def on_flow_trace_event_event(&block)
137
+ @event_emitter.on(:flow_trace_event, block) if block_given?
138
+ end
139
+
136
140
  def on_internal_server_exception_event(&block)
137
141
  @event_emitter.on(:internal_server_exception, block) if block_given?
138
142
  end
@@ -172,6 +176,7 @@ module Aws::BedrockAgentRuntime
172
176
  on_dependency_failed_exception_event(&block)
173
177
  on_flow_completion_event_event(&block)
174
178
  on_flow_output_event_event(&block)
179
+ on_flow_trace_event_event(&block)
175
180
  on_internal_server_exception_event(&block)
176
181
  on_resource_not_found_exception_event(&block)
177
182
  on_service_quota_exceeded_exception_event(&block)
@@ -725,16 +725,6 @@ module Aws::BedrockAgentRuntime
725
725
 
726
726
  # Contains information about why a flow completed.
727
727
  #
728
- # This data type is used in the following API operations:
729
- #
730
- # * [InvokeFlow response][1]
731
- #
732
- # ^
733
- #
734
- #
735
- #
736
- # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeFlow.html#API_agent_InvokeFlow_ResponseSyntax
737
- #
738
728
  # @!attribute [rw] completion_reason
739
729
  # The reason that the flow completed.
740
730
  # @return [String]
@@ -751,16 +741,6 @@ module Aws::BedrockAgentRuntime
751
741
  # Contains information about an input into the prompt flow and where to
752
742
  # send it.
753
743
  #
754
- # This data type is used in the following API operations:
755
- #
756
- # * [InvokeFlow request][1]
757
- #
758
- # ^
759
- #
760
- #
761
- #
762
- # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeFlow.html#API_agent_InvokeFlow_RequestSyntax
763
- #
764
744
  # @!attribute [rw] content
765
745
  # Contains information about an input into the prompt flow.
766
746
  # @return [Types::FlowInputContent]
@@ -786,16 +766,6 @@ module Aws::BedrockAgentRuntime
786
766
 
787
767
  # Contains information about an input into the flow.
788
768
  #
789
- # This data type is used in the following API operations:
790
- #
791
- # * [InvokeFlow request][1]
792
- #
793
- # ^
794
- #
795
- #
796
- #
797
- # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeFlow.html#API_agent_InvokeFlow_RequestSyntax
798
- #
799
769
  # @note FlowInputContent is a union - when making an API calls you must set exactly one of the members.
800
770
  #
801
771
  # @!attribute [rw] document
@@ -818,16 +788,6 @@ module Aws::BedrockAgentRuntime
818
788
  # Contains information about the content in an output from prompt flow
819
789
  # invocation.
820
790
  #
821
- # This data type is used in the following API operations:
822
- #
823
- # * [InvokeFlow request][1]
824
- #
825
- # ^
826
- #
827
- #
828
- #
829
- # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeFlow.html#API_agent_InvokeFlow_RequestSyntax
830
- #
831
791
  # @note FlowOutputContent is a union - when returned from an API call exactly one value will be set and the returned type will be a subclass of FlowOutputContent corresponding to the set member.
832
792
  #
833
793
  # @!attribute [rw] document
@@ -849,16 +809,6 @@ module Aws::BedrockAgentRuntime
849
809
 
850
810
  # Contains information about an output from prompt flow invoction.
851
811
  #
852
- # This data type is used in the following API operations:
853
- #
854
- # * [InvokeFlow response][1]
855
- #
856
- # ^
857
- #
858
- #
859
- #
860
- # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeFlow.html#API_agent_InvokeFlow_ResponseSyntax
861
- #
862
812
  # @!attribute [rw] content
863
813
  # The content in the output.
864
814
  # @return [Types::FlowOutputContent]
@@ -882,6 +832,284 @@ module Aws::BedrockAgentRuntime
882
832
  include Aws::Structure
883
833
  end
884
834
 
835
+ # Contains information about an input or output for a node in the flow.
836
+ # For more information, see [Track each step in your prompt flow by
837
+ # viewing its trace in Amazon Bedrock][1].
838
+ #
839
+ #
840
+ #
841
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html
842
+ #
843
+ # @note FlowTrace is a union - when returned from an API call exactly one value will be set and the returned type will be a subclass of FlowTrace corresponding to the set member.
844
+ #
845
+ # @!attribute [rw] condition_node_result_trace
846
+ # Contains information about an output from a condition node.
847
+ # @return [Types::FlowTraceConditionNodeResultEvent]
848
+ #
849
+ # @!attribute [rw] node_input_trace
850
+ # Contains information about the input into a node.
851
+ # @return [Types::FlowTraceNodeInputEvent]
852
+ #
853
+ # @!attribute [rw] node_output_trace
854
+ # Contains information about the output from a node.
855
+ # @return [Types::FlowTraceNodeOutputEvent]
856
+ #
857
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/FlowTrace AWS API Documentation
858
+ #
859
+ class FlowTrace < Struct.new(
860
+ :condition_node_result_trace,
861
+ :node_input_trace,
862
+ :node_output_trace,
863
+ :unknown)
864
+ SENSITIVE = [:condition_node_result_trace, :node_input_trace, :node_output_trace]
865
+ include Aws::Structure
866
+ include Aws::Structure::Union
867
+
868
+ class ConditionNodeResultTrace < FlowTrace; end
869
+ class NodeInputTrace < FlowTrace; end
870
+ class NodeOutputTrace < FlowTrace; end
871
+ class Unknown < FlowTrace; end
872
+ end
873
+
874
+ # Contains information about a condition that was satisfied. For more
875
+ # information, see [Track each step in your prompt flow by viewing its
876
+ # trace in Amazon Bedrock][1].
877
+ #
878
+ #
879
+ #
880
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html
881
+ #
882
+ # @!attribute [rw] condition_name
883
+ # The name of the condition.
884
+ # @return [String]
885
+ #
886
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/FlowTraceCondition AWS API Documentation
887
+ #
888
+ class FlowTraceCondition < Struct.new(
889
+ :condition_name)
890
+ SENSITIVE = []
891
+ include Aws::Structure
892
+ end
893
+
894
+ # Contains information about an output from a condition node. For more
895
+ # information, see [Track each step in your prompt flow by viewing its
896
+ # trace in Amazon Bedrock][1].
897
+ #
898
+ #
899
+ #
900
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html
901
+ #
902
+ # @!attribute [rw] node_name
903
+ # The name of the condition node.
904
+ # @return [String]
905
+ #
906
+ # @!attribute [rw] satisfied_conditions
907
+ # An array of objects containing information about the conditions that
908
+ # were satisfied.
909
+ # @return [Array<Types::FlowTraceCondition>]
910
+ #
911
+ # @!attribute [rw] timestamp
912
+ # The date and time that the trace was returned.
913
+ # @return [Time]
914
+ #
915
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/FlowTraceConditionNodeResultEvent AWS API Documentation
916
+ #
917
+ class FlowTraceConditionNodeResultEvent < Struct.new(
918
+ :node_name,
919
+ :satisfied_conditions,
920
+ :timestamp)
921
+ SENSITIVE = [:satisfied_conditions]
922
+ include Aws::Structure
923
+ end
924
+
925
+ # Contains information about a trace, which tracks an input or output
926
+ # for a node in the flow. For more information, see [Track each step in
927
+ # your prompt flow by viewing its trace in Amazon Bedrock][1].
928
+ #
929
+ #
930
+ #
931
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html
932
+ #
933
+ # @!attribute [rw] trace
934
+ # The trace object containing information about an input or output for
935
+ # a node in the flow.
936
+ # @return [Types::FlowTrace]
937
+ #
938
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/FlowTraceEvent AWS API Documentation
939
+ #
940
+ class FlowTraceEvent < Struct.new(
941
+ :trace,
942
+ :event_type)
943
+ SENSITIVE = [:trace]
944
+ include Aws::Structure
945
+ end
946
+
947
+ # Contains the content of the node input. For more information, see
948
+ # [Track each step in your prompt flow by viewing its trace in Amazon
949
+ # Bedrock][1].
950
+ #
951
+ #
952
+ #
953
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html
954
+ #
955
+ # @note FlowTraceNodeInputContent is a union - when returned from an API call exactly one value will be set and the returned type will be a subclass of FlowTraceNodeInputContent corresponding to the set member.
956
+ #
957
+ # @!attribute [rw] document
958
+ # The content of the node input.
959
+ # @return [Hash,Array,String,Numeric,Boolean]
960
+ #
961
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/FlowTraceNodeInputContent AWS API Documentation
962
+ #
963
+ class FlowTraceNodeInputContent < Struct.new(
964
+ :document,
965
+ :unknown)
966
+ SENSITIVE = []
967
+ include Aws::Structure
968
+ include Aws::Structure::Union
969
+
970
+ class Document < FlowTraceNodeInputContent; end
971
+ class Unknown < FlowTraceNodeInputContent; end
972
+ end
973
+
974
+ # Contains information about the input into a node. For more
975
+ # information, see [Track each step in your prompt flow by viewing its
976
+ # trace in Amazon Bedrock][1].
977
+ #
978
+ #
979
+ #
980
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html
981
+ #
982
+ # @!attribute [rw] fields
983
+ # An array of objects containing information about each field in the
984
+ # input.
985
+ # @return [Array<Types::FlowTraceNodeInputField>]
986
+ #
987
+ # @!attribute [rw] node_name
988
+ # The name of the node that received the input.
989
+ # @return [String]
990
+ #
991
+ # @!attribute [rw] timestamp
992
+ # The date and time that the trace was returned.
993
+ # @return [Time]
994
+ #
995
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/FlowTraceNodeInputEvent AWS API Documentation
996
+ #
997
+ class FlowTraceNodeInputEvent < Struct.new(
998
+ :fields,
999
+ :node_name,
1000
+ :timestamp)
1001
+ SENSITIVE = [:fields]
1002
+ include Aws::Structure
1003
+ end
1004
+
1005
+ # Contains information about a field in the input into a node. For more
1006
+ # information, see [Track each step in your prompt flow by viewing its
1007
+ # trace in Amazon Bedrock][1].
1008
+ #
1009
+ #
1010
+ #
1011
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html
1012
+ #
1013
+ # @!attribute [rw] content
1014
+ # The content of the node input.
1015
+ # @return [Types::FlowTraceNodeInputContent]
1016
+ #
1017
+ # @!attribute [rw] node_input_name
1018
+ # The name of the node input.
1019
+ # @return [String]
1020
+ #
1021
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/FlowTraceNodeInputField AWS API Documentation
1022
+ #
1023
+ class FlowTraceNodeInputField < Struct.new(
1024
+ :content,
1025
+ :node_input_name)
1026
+ SENSITIVE = [:content]
1027
+ include Aws::Structure
1028
+ end
1029
+
1030
+ # Contains the content of the node output. For more information, see
1031
+ # [Track each step in your prompt flow by viewing its trace in Amazon
1032
+ # Bedrock][1].
1033
+ #
1034
+ #
1035
+ #
1036
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html
1037
+ #
1038
+ # @note FlowTraceNodeOutputContent is a union - when returned from an API call exactly one value will be set and the returned type will be a subclass of FlowTraceNodeOutputContent corresponding to the set member.
1039
+ #
1040
+ # @!attribute [rw] document
1041
+ # The content of the node output.
1042
+ # @return [Hash,Array,String,Numeric,Boolean]
1043
+ #
1044
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/FlowTraceNodeOutputContent AWS API Documentation
1045
+ #
1046
+ class FlowTraceNodeOutputContent < Struct.new(
1047
+ :document,
1048
+ :unknown)
1049
+ SENSITIVE = []
1050
+ include Aws::Structure
1051
+ include Aws::Structure::Union
1052
+
1053
+ class Document < FlowTraceNodeOutputContent; end
1054
+ class Unknown < FlowTraceNodeOutputContent; end
1055
+ end
1056
+
1057
+ # Contains information about the output from a node. For more
1058
+ # information, see [Track each step in your prompt flow by viewing its
1059
+ # trace in Amazon Bedrock][1].
1060
+ #
1061
+ #
1062
+ #
1063
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html
1064
+ #
1065
+ # @!attribute [rw] fields
1066
+ # An array of objects containing information about each field in the
1067
+ # output.
1068
+ # @return [Array<Types::FlowTraceNodeOutputField>]
1069
+ #
1070
+ # @!attribute [rw] node_name
1071
+ # The name of the node that yielded the output.
1072
+ # @return [String]
1073
+ #
1074
+ # @!attribute [rw] timestamp
1075
+ # The date and time that the trace was returned.
1076
+ # @return [Time]
1077
+ #
1078
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/FlowTraceNodeOutputEvent AWS API Documentation
1079
+ #
1080
+ class FlowTraceNodeOutputEvent < Struct.new(
1081
+ :fields,
1082
+ :node_name,
1083
+ :timestamp)
1084
+ SENSITIVE = [:fields]
1085
+ include Aws::Structure
1086
+ end
1087
+
1088
+ # Contains information about a field in the output from a node. For more
1089
+ # information, see [Track each step in your prompt flow by viewing its
1090
+ # trace in Amazon Bedrock][1].
1091
+ #
1092
+ #
1093
+ #
1094
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html
1095
+ #
1096
+ # @!attribute [rw] content
1097
+ # The content of the node output.
1098
+ # @return [Types::FlowTraceNodeOutputContent]
1099
+ #
1100
+ # @!attribute [rw] node_output_name
1101
+ # The name of the node output.
1102
+ # @return [String]
1103
+ #
1104
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/FlowTraceNodeOutputField AWS API Documentation
1105
+ #
1106
+ class FlowTraceNodeOutputField < Struct.new(
1107
+ :content,
1108
+ :node_output_name)
1109
+ SENSITIVE = []
1110
+ include Aws::Structure
1111
+ end
1112
+
885
1113
  # Contains information about the function that the agent predicts should
886
1114
  # be called.
887
1115
  #
@@ -1069,7 +1297,13 @@ module Aws::BedrockAgentRuntime
1069
1297
  #
1070
1298
  # @!attribute [rw] prompt_template
1071
1299
  # Contains the template for the prompt that's sent to the model for
1072
- # response generation.
1300
+ # response generation. Generation prompts must include the
1301
+ # `$search_results$` variable. For more information, see [Use
1302
+ # placeholder variables][1] in the user guide.
1303
+ #
1304
+ #
1305
+ #
1306
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html
1073
1307
  # @return [Types::PromptTemplate]
1074
1308
  #
1075
1309
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/GenerationConfiguration AWS API Documentation
@@ -1763,6 +1997,17 @@ module Aws::BedrockAgentRuntime
1763
1997
  include Aws::Structure
1764
1998
  end
1765
1999
 
2000
+ # @!attribute [rw] enable_trace
2001
+ # Specifies whether to return the trace for the flow or not. Traces
2002
+ # track inputs and outputs for nodes in the flow. For more
2003
+ # information, see [Track each step in your prompt flow by viewing its
2004
+ # trace in Amazon Bedrock][1].
2005
+ #
2006
+ #
2007
+ #
2008
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html
2009
+ # @return [Boolean]
2010
+ #
1766
2011
  # @!attribute [rw] flow_alias_identifier
1767
2012
  # The unique identifier of the flow alias.
1768
2013
  # @return [String]
@@ -1779,6 +2024,7 @@ module Aws::BedrockAgentRuntime
1779
2024
  # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/InvokeFlowRequest AWS API Documentation
1780
2025
  #
1781
2026
  class InvokeFlowRequest < Struct.new(
2027
+ :enable_trace,
1782
2028
  :flow_alias_identifier,
1783
2029
  :flow_identifier,
1784
2030
  :inputs)
@@ -2297,8 +2543,14 @@ module Aws::BedrockAgentRuntime
2297
2543
  # @return [Types::InferenceConfig]
2298
2544
  #
2299
2545
  # @!attribute [rw] prompt_template
2300
- # Contains the template for the prompt that's sent to the model for
2301
- # response generation.
2546
+ # Contains the template for the prompt that's sent to the model.
2547
+ # Orchestration prompts must include the `$conversation_history$` and
2548
+ # `$output_format_instructions$` variables. For more information, see
2549
+ # [Use placeholder variables][1] in the user guide.
2550
+ #
2551
+ #
2552
+ #
2553
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html
2302
2554
  # @return [Types::PromptTemplate]
2303
2555
  #
2304
2556
  # @!attribute [rw] query_transformation_configuration
@@ -3888,16 +4140,6 @@ module Aws::BedrockAgentRuntime
3888
4140
 
3889
4141
  # The output of the flow.
3890
4142
  #
3891
- # This data type is used in the following API operations:
3892
- #
3893
- # * [InvokeFlow response][1]
3894
- #
3895
- # ^
3896
- #
3897
- #
3898
- #
3899
- # [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeFlow.html#API_agent_InvokeFlow_ResponseSyntax
3900
- #
3901
4143
  # EventStream is an Enumerator of Events.
3902
4144
  # #event_types #=> Array, returns all modeled event types in the stream
3903
4145
  #
@@ -3913,6 +4155,7 @@ module Aws::BedrockAgentRuntime
3913
4155
  :dependency_failed_exception,
3914
4156
  :flow_completion_event,
3915
4157
  :flow_output_event,
4158
+ :flow_trace_event,
3916
4159
  :internal_server_exception,
3917
4160
  :resource_not_found_exception,
3918
4161
  :service_quota_exceeded_exception,
@@ -55,7 +55,7 @@ module Aws::BedrockAgentRuntime
55
55
  autoload :Endpoints, 'aws-sdk-bedrockagentruntime/endpoints'
56
56
  autoload :EventStreams, 'aws-sdk-bedrockagentruntime/event_streams'
57
57
 
58
- GEM_VERSION = '1.30.0'
58
+ GEM_VERSION = '1.31.0'
59
59
 
60
60
  end
61
61
 
data/sig/client.rbs CHANGED
@@ -249,6 +249,7 @@ module Aws
249
249
  end
250
250
  # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/BedrockAgentRuntime/Client.html#invoke_flow-instance_method
251
251
  def invoke_flow: (
252
+ ?enable_trace: bool,
252
253
  flow_alias_identifier: ::String,
253
254
  flow_identifier: ::String,
254
255
  inputs: Array[
data/sig/types.rbs CHANGED
@@ -232,6 +232,89 @@ module Aws::BedrockAgentRuntime
232
232
  SENSITIVE: []
233
233
  end
234
234
 
235
+ class FlowTrace
236
+ attr_accessor condition_node_result_trace: Types::FlowTraceConditionNodeResultEvent
237
+ attr_accessor node_input_trace: Types::FlowTraceNodeInputEvent
238
+ attr_accessor node_output_trace: Types::FlowTraceNodeOutputEvent
239
+ attr_accessor unknown: untyped
240
+ SENSITIVE: [:condition_node_result_trace, :node_input_trace, :node_output_trace]
241
+
242
+ class ConditionNodeResultTrace < FlowTrace
243
+ end
244
+ class NodeInputTrace < FlowTrace
245
+ end
246
+ class NodeOutputTrace < FlowTrace
247
+ end
248
+ class Unknown < FlowTrace
249
+ end
250
+ end
251
+
252
+ class FlowTraceCondition
253
+ attr_accessor condition_name: ::String
254
+ SENSITIVE: []
255
+ end
256
+
257
+ class FlowTraceConditionNodeResultEvent
258
+ attr_accessor node_name: ::String
259
+ attr_accessor satisfied_conditions: ::Array[Types::FlowTraceCondition]
260
+ attr_accessor timestamp: ::Time
261
+ SENSITIVE: []
262
+ end
263
+
264
+ class FlowTraceEvent
265
+ attr_accessor trace: Types::FlowTrace
266
+ attr_accessor event_type: untyped
267
+ SENSITIVE: [:trace]
268
+ end
269
+
270
+ class FlowTraceNodeInputContent
271
+ attr_accessor document: untyped
272
+ attr_accessor unknown: untyped
273
+ SENSITIVE: []
274
+
275
+ class Document < FlowTraceNodeInputContent
276
+ end
277
+ class Unknown < FlowTraceNodeInputContent
278
+ end
279
+ end
280
+
281
+ class FlowTraceNodeInputEvent
282
+ attr_accessor fields: ::Array[Types::FlowTraceNodeInputField]
283
+ attr_accessor node_name: ::String
284
+ attr_accessor timestamp: ::Time
285
+ SENSITIVE: []
286
+ end
287
+
288
+ class FlowTraceNodeInputField
289
+ attr_accessor content: Types::FlowTraceNodeInputContent
290
+ attr_accessor node_input_name: ::String
291
+ SENSITIVE: [:content]
292
+ end
293
+
294
+ class FlowTraceNodeOutputContent
295
+ attr_accessor document: untyped
296
+ attr_accessor unknown: untyped
297
+ SENSITIVE: []
298
+
299
+ class Document < FlowTraceNodeOutputContent
300
+ end
301
+ class Unknown < FlowTraceNodeOutputContent
302
+ end
303
+ end
304
+
305
+ class FlowTraceNodeOutputEvent
306
+ attr_accessor fields: ::Array[Types::FlowTraceNodeOutputField]
307
+ attr_accessor node_name: ::String
308
+ attr_accessor timestamp: ::Time
309
+ SENSITIVE: []
310
+ end
311
+
312
+ class FlowTraceNodeOutputField
313
+ attr_accessor content: Types::FlowTraceNodeOutputContent
314
+ attr_accessor node_output_name: ::String
315
+ SENSITIVE: []
316
+ end
317
+
235
318
  class FunctionInvocationInput
236
319
  attr_accessor action_group: ::String
237
320
  attr_accessor action_invocation_type: ("RESULT" | "USER_CONFIRMATION" | "USER_CONFIRMATION_AND_RESULT")
@@ -456,6 +539,7 @@ module Aws::BedrockAgentRuntime
456
539
  end
457
540
 
458
541
  class InvokeFlowRequest
542
+ attr_accessor enable_trace: bool
459
543
  attr_accessor flow_alias_identifier: ::String
460
544
  attr_accessor flow_identifier: ::String
461
545
  attr_accessor inputs: ::Array[Types::FlowInput]
@@ -973,7 +1057,7 @@ module Aws::BedrockAgentRuntime
973
1057
  end
974
1058
 
975
1059
  class FlowResponseStream < Enumerator[untyped, untyped]
976
- def event_types: () -> [:access_denied_exception, :bad_gateway_exception, :conflict_exception, :dependency_failed_exception, :flow_completion_event, :flow_output_event, :internal_server_exception, :resource_not_found_exception, :service_quota_exceeded_exception, :throttling_exception, :validation_exception]
1060
+ def event_types: () -> [:access_denied_exception, :bad_gateway_exception, :conflict_exception, :dependency_failed_exception, :flow_completion_event, :flow_output_event, :flow_trace_event, :internal_server_exception, :resource_not_found_exception, :service_quota_exceeded_exception, :throttling_exception, :validation_exception]
977
1061
  end
978
1062
 
979
1063
  class ResponseStream < Enumerator[untyped, untyped]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-bedrockagentruntime
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.30.0
4
+ version: 1.31.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-06 00:00:00.000000000 Z
11
+ date: 2024-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core