aws-sdk-bedrockagentruntime 1.30.0 → 1.32.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: 9a5c8f9ada774c7b6b0f076b035f69819f5b0d0c04912808fda03f994b242e96
4
+ data.tar.gz: 9142d0bc53700130ddda7545064b22ae00b04e60057c0643add3f5cfa1cb59c5
5
5
  SHA512:
6
- metadata.gz: 3ce22f6888e86e1c8303524cbd67791e688f760182d326fb88f856c98aabefe428310b52b954d243f0d7a8e8a46e79c2e3eae70e8f0acde4d47e24d9b7ef1543
7
- data.tar.gz: 9fae515be407940cd0821112ef9248f5f714e139d332da4f3d6a222ca589332c59cf161729493ae69a309ac894fd614664d7fba3e9bb967f7630aa4ae35402d2
6
+ metadata.gz: 5e5d6f501e8d9cc30c2310099696aebf003fbc3e9d2d228276643178ea15f29c819537d5942a6f63e66bfc5e7656b62a81f2fca55e114422476a91af7d22ad96
7
+ data.tar.gz: 54e0b35d92200a5b96f66ab97b14ebe698f5ff7aa4f0ed0334522b28dad7451b0270f632a4e2f75bf97c4849b8da4a3ae0ca43dbb6ca5b4d4b52ac3cb97c3461
data/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.32.0 (2024-11-20)
5
+ ------------------
6
+
7
+ * Feature - Releasing new Prompt Optimization to enhance your prompts for improved performance
8
+
9
+ 1.31.0 (2024-11-08)
10
+ ------------------
11
+
12
+ * Feature - This release adds trace functionality to Bedrock Prompt Flows
13
+
4
14
  1.30.0 (2024-11-06)
5
15
  ------------------
6
16
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.30.0
1
+ 1.32.0
@@ -1248,7 +1248,7 @@ module Aws::BedrockAgentRuntime
1248
1248
  # Invokes an alias of a flow to run the inputs that you specify and
1249
1249
  # return the output of each node as a stream. If there's an error, the
1250
1250
  # error is returned. For more information, see [Test a flow in Amazon
1251
- # Bedrock][1] in the Amazon Bedrock User Guide.
1251
+ # Bedrock][1] in the [Amazon Bedrock User Guide][2].
1252
1252
  #
1253
1253
  # <note markdown="1"> The CLI doesn't support streaming operations in Amazon Bedrock,
1254
1254
  # including `InvokeFlow`.
@@ -1258,6 +1258,17 @@ module Aws::BedrockAgentRuntime
1258
1258
  #
1259
1259
  #
1260
1260
  # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-test.html
1261
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html
1262
+ #
1263
+ # @option params [Boolean] :enable_trace
1264
+ # Specifies whether to return the trace for the flow or not. Traces
1265
+ # track inputs and outputs for nodes in the flow. For more information,
1266
+ # see [Track each step in your prompt flow by viewing its trace in
1267
+ # Amazon Bedrock][1].
1268
+ #
1269
+ #
1270
+ #
1271
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html
1261
1272
  #
1262
1273
  # @option params [required, String] :flow_alias_identifier
1263
1274
  # The unique identifier of the flow alias.
@@ -1334,6 +1345,9 @@ module Aws::BedrockAgentRuntime
1334
1345
  # handler.on_flow_output_event_event do |event|
1335
1346
  # event # => Aws::BedrockAgentRuntime::Types::flowOutputEvent
1336
1347
  # end
1348
+ # handler.on_flow_trace_event_event do |event|
1349
+ # event # => Aws::BedrockAgentRuntime::Types::flowTraceEvent
1350
+ # end
1337
1351
  # handler.on_internal_server_exception_event do |event|
1338
1352
  # event # => Aws::BedrockAgentRuntime::Types::internalServerException
1339
1353
  # end
@@ -1374,6 +1388,9 @@ module Aws::BedrockAgentRuntime
1374
1388
  # stream.on_flow_output_event_event do |event|
1375
1389
  # event # => Aws::BedrockAgentRuntime::Types::flowOutputEvent
1376
1390
  # end
1391
+ # stream.on_flow_trace_event_event do |event|
1392
+ # event # => Aws::BedrockAgentRuntime::Types::flowTraceEvent
1393
+ # end
1377
1394
  # stream.on_internal_server_exception_event do |event|
1378
1395
  # event # => Aws::BedrockAgentRuntime::Types::internalServerException
1379
1396
  # end
@@ -1414,6 +1431,9 @@ module Aws::BedrockAgentRuntime
1414
1431
  # handler.on_flow_output_event_event do |event|
1415
1432
  # event # => Aws::BedrockAgentRuntime::Types::flowOutputEvent
1416
1433
  # end
1434
+ # handler.on_flow_trace_event_event do |event|
1435
+ # event # => Aws::BedrockAgentRuntime::Types::flowTraceEvent
1436
+ # end
1417
1437
  # handler.on_internal_server_exception_event do |event|
1418
1438
  # event # => Aws::BedrockAgentRuntime::Types::internalServerException
1419
1439
  # end
@@ -1449,6 +1469,7 @@ module Aws::BedrockAgentRuntime
1449
1469
  # @example Request syntax with placeholder values
1450
1470
  #
1451
1471
  # resp = client.invoke_flow({
1472
+ # enable_trace: false,
1452
1473
  # flow_alias_identifier: "FlowAliasIdentifier", # required
1453
1474
  # flow_identifier: "FlowIdentifier", # required
1454
1475
  # inputs: [ # required
@@ -1467,7 +1488,7 @@ module Aws::BedrockAgentRuntime
1467
1488
  #
1468
1489
  # All events are available at resp.response_stream:
1469
1490
  # 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]
1491
+ # 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
1492
  #
1472
1493
  # For :access_denied_exception event available at #on_access_denied_exception_event callback and response eventstream enumerator:
1473
1494
  # event.message #=> String
@@ -1490,6 +1511,20 @@ module Aws::BedrockAgentRuntime
1490
1511
  # event.node_name #=> String
1491
1512
  # event.node_type #=> String, one of "FlowInputNode", "FlowOutputNode", "LambdaFunctionNode", "KnowledgeBaseNode", "PromptNode", "ConditionNode", "LexNode"
1492
1513
  #
1514
+ # For :flow_trace_event event available at #on_flow_trace_event_event callback and response eventstream enumerator:
1515
+ # event.trace.condition_node_result_trace.node_name #=> String
1516
+ # event.trace.condition_node_result_trace.satisfied_conditions #=> Array
1517
+ # event.trace.condition_node_result_trace.satisfied_conditions[0].condition_name #=> String
1518
+ # event.trace.condition_node_result_trace.timestamp #=> Time
1519
+ # event.trace.node_input_trace.fields #=> Array
1520
+ # event.trace.node_input_trace.fields[0].node_input_name #=> String
1521
+ # event.trace.node_input_trace.node_name #=> String
1522
+ # event.trace.node_input_trace.timestamp #=> Time
1523
+ # event.trace.node_output_trace.fields #=> Array
1524
+ # event.trace.node_output_trace.fields[0].node_output_name #=> String
1525
+ # event.trace.node_output_trace.node_name #=> String
1526
+ # event.trace.node_output_trace.timestamp #=> Time
1527
+ #
1493
1528
  # For :internal_server_exception event available at #on_internal_server_exception_event callback and response eventstream enumerator:
1494
1529
  # event.message #=> String
1495
1530
  #
@@ -1532,6 +1567,242 @@ module Aws::BedrockAgentRuntime
1532
1567
  req.send_request(options, &block)
1533
1568
  end
1534
1569
 
1570
+ # Optimizes a prompt for the task that you specify. For more
1571
+ # information, see [Optimize a prompt][1] in the [Amazon Bedrock User
1572
+ # Guide][2].
1573
+ #
1574
+ #
1575
+ #
1576
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-optimize.html
1577
+ # [2]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html
1578
+ #
1579
+ # @option params [required, Types::InputPrompt] :input
1580
+ # Contains the prompt to optimize.
1581
+ #
1582
+ # @option params [required, String] :target_model_id
1583
+ # The unique identifier of the model that you want to optimize the
1584
+ # prompt for.
1585
+ #
1586
+ # @return [Types::OptimizePromptResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1587
+ #
1588
+ # * {Types::OptimizePromptResponse#optimized_prompt #optimized_prompt} => Types::OptimizedPromptStream
1589
+ #
1590
+ # @example EventStream Operation Example
1591
+ #
1592
+ # You can process the event once it arrives immediately, or wait until the
1593
+ # full response is complete and iterate through the eventstream enumerator.
1594
+ #
1595
+ # To interact with event immediately, you need to register #optimize_prompt
1596
+ # with callbacks. Callbacks can be registered for specific events or for all
1597
+ # events, including error events.
1598
+ #
1599
+ # Callbacks can be passed into the `:event_stream_handler` option or within a
1600
+ # block statement attached to the #optimize_prompt call directly. Hybrid
1601
+ # pattern of both is also supported.
1602
+ #
1603
+ # `:event_stream_handler` option takes in either a Proc object or
1604
+ # Aws::BedrockAgentRuntime::EventStreams::OptimizedPromptStream object.
1605
+ #
1606
+ # Usage pattern a): Callbacks with a block attached to #optimize_prompt
1607
+ # Example for registering callbacks for all event types and an error event
1608
+ #
1609
+ # client.optimize_prompt( # params input# ) do |stream|
1610
+ # stream.on_error_event do |event|
1611
+ # # catch unmodeled error event in the stream
1612
+ # raise event
1613
+ # # => Aws::Errors::EventError
1614
+ # # event.event_type => :error
1615
+ # # event.error_code => String
1616
+ # # event.error_message => String
1617
+ # end
1618
+ #
1619
+ # stream.on_event do |event|
1620
+ # # process all events arrive
1621
+ # puts event.event_type
1622
+ # ...
1623
+ # end
1624
+ #
1625
+ # end
1626
+ #
1627
+ # Usage pattern b): Pass in `:event_stream_handler` for #optimize_prompt
1628
+ #
1629
+ # 1) Create a Aws::BedrockAgentRuntime::EventStreams::OptimizedPromptStream object
1630
+ # Example for registering callbacks with specific events
1631
+ #
1632
+ # handler = Aws::BedrockAgentRuntime::EventStreams::OptimizedPromptStream.new
1633
+ # handler.on_access_denied_exception_event do |event|
1634
+ # event # => Aws::BedrockAgentRuntime::Types::accessDeniedException
1635
+ # end
1636
+ # handler.on_analyze_prompt_event_event do |event|
1637
+ # event # => Aws::BedrockAgentRuntime::Types::analyzePromptEvent
1638
+ # end
1639
+ # handler.on_bad_gateway_exception_event do |event|
1640
+ # event # => Aws::BedrockAgentRuntime::Types::badGatewayException
1641
+ # end
1642
+ # handler.on_dependency_failed_exception_event do |event|
1643
+ # event # => Aws::BedrockAgentRuntime::Types::dependencyFailedException
1644
+ # end
1645
+ # handler.on_internal_server_exception_event do |event|
1646
+ # event # => Aws::BedrockAgentRuntime::Types::internalServerException
1647
+ # end
1648
+ # handler.on_optimized_prompt_event_event do |event|
1649
+ # event # => Aws::BedrockAgentRuntime::Types::optimizedPromptEvent
1650
+ # end
1651
+ # handler.on_throttling_exception_event do |event|
1652
+ # event # => Aws::BedrockAgentRuntime::Types::throttlingException
1653
+ # end
1654
+ # handler.on_validation_exception_event do |event|
1655
+ # event # => Aws::BedrockAgentRuntime::Types::validationException
1656
+ # end
1657
+ #
1658
+ # client.optimize_prompt( # params input #, event_stream_handler: handler)
1659
+ #
1660
+ # 2) Use a Ruby Proc object
1661
+ # Example for registering callbacks with specific events
1662
+ #
1663
+ # handler = Proc.new do |stream|
1664
+ # stream.on_access_denied_exception_event do |event|
1665
+ # event # => Aws::BedrockAgentRuntime::Types::accessDeniedException
1666
+ # end
1667
+ # stream.on_analyze_prompt_event_event do |event|
1668
+ # event # => Aws::BedrockAgentRuntime::Types::analyzePromptEvent
1669
+ # end
1670
+ # stream.on_bad_gateway_exception_event do |event|
1671
+ # event # => Aws::BedrockAgentRuntime::Types::badGatewayException
1672
+ # end
1673
+ # stream.on_dependency_failed_exception_event do |event|
1674
+ # event # => Aws::BedrockAgentRuntime::Types::dependencyFailedException
1675
+ # end
1676
+ # stream.on_internal_server_exception_event do |event|
1677
+ # event # => Aws::BedrockAgentRuntime::Types::internalServerException
1678
+ # end
1679
+ # stream.on_optimized_prompt_event_event do |event|
1680
+ # event # => Aws::BedrockAgentRuntime::Types::optimizedPromptEvent
1681
+ # end
1682
+ # stream.on_throttling_exception_event do |event|
1683
+ # event # => Aws::BedrockAgentRuntime::Types::throttlingException
1684
+ # end
1685
+ # stream.on_validation_exception_event do |event|
1686
+ # event # => Aws::BedrockAgentRuntime::Types::validationException
1687
+ # end
1688
+ # end
1689
+ #
1690
+ # client.optimize_prompt( # params input #, event_stream_handler: handler)
1691
+ #
1692
+ # Usage pattern c): Hybrid pattern of a) and b)
1693
+ #
1694
+ # handler = Aws::BedrockAgentRuntime::EventStreams::OptimizedPromptStream.new
1695
+ # handler.on_access_denied_exception_event do |event|
1696
+ # event # => Aws::BedrockAgentRuntime::Types::accessDeniedException
1697
+ # end
1698
+ # handler.on_analyze_prompt_event_event do |event|
1699
+ # event # => Aws::BedrockAgentRuntime::Types::analyzePromptEvent
1700
+ # end
1701
+ # handler.on_bad_gateway_exception_event do |event|
1702
+ # event # => Aws::BedrockAgentRuntime::Types::badGatewayException
1703
+ # end
1704
+ # handler.on_dependency_failed_exception_event do |event|
1705
+ # event # => Aws::BedrockAgentRuntime::Types::dependencyFailedException
1706
+ # end
1707
+ # handler.on_internal_server_exception_event do |event|
1708
+ # event # => Aws::BedrockAgentRuntime::Types::internalServerException
1709
+ # end
1710
+ # handler.on_optimized_prompt_event_event do |event|
1711
+ # event # => Aws::BedrockAgentRuntime::Types::optimizedPromptEvent
1712
+ # end
1713
+ # handler.on_throttling_exception_event do |event|
1714
+ # event # => Aws::BedrockAgentRuntime::Types::throttlingException
1715
+ # end
1716
+ # handler.on_validation_exception_event do |event|
1717
+ # event # => Aws::BedrockAgentRuntime::Types::validationException
1718
+ # end
1719
+ #
1720
+ # client.optimize_prompt( # params input #, event_stream_handler: handler) do |stream|
1721
+ # stream.on_error_event do |event|
1722
+ # # catch unmodeled error event in the stream
1723
+ # raise event
1724
+ # # => Aws::Errors::EventError
1725
+ # # event.event_type => :error
1726
+ # # event.error_code => String
1727
+ # # event.error_message => String
1728
+ # end
1729
+ # end
1730
+ #
1731
+ # You can also iterate through events after the response complete.
1732
+ #
1733
+ # Events are available at resp.optimized_prompt # => Enumerator
1734
+ # For parameter input example, please refer to following request syntax
1735
+ #
1736
+ # @example Request syntax with placeholder values
1737
+ #
1738
+ # resp = client.optimize_prompt({
1739
+ # input: { # required
1740
+ # text_prompt: {
1741
+ # text: "TextPromptTextString", # required
1742
+ # },
1743
+ # },
1744
+ # target_model_id: "OptimizePromptRequestTargetModelIdString", # required
1745
+ # })
1746
+ #
1747
+ # @example Response structure
1748
+ #
1749
+ # All events are available at resp.optimized_prompt:
1750
+ # resp.optimized_prompt #=> Enumerator
1751
+ # resp.optimized_prompt.event_types #=> [:access_denied_exception, :analyze_prompt_event, :bad_gateway_exception, :dependency_failed_exception, :internal_server_exception, :optimized_prompt_event, :throttling_exception, :validation_exception]
1752
+ #
1753
+ # For :access_denied_exception event available at #on_access_denied_exception_event callback and response eventstream enumerator:
1754
+ # event.message #=> String
1755
+ #
1756
+ # For :analyze_prompt_event event available at #on_analyze_prompt_event_event callback and response eventstream enumerator:
1757
+ # event.message #=> String
1758
+ #
1759
+ # For :bad_gateway_exception event available at #on_bad_gateway_exception_event callback and response eventstream enumerator:
1760
+ # event.message #=> String
1761
+ # event.resource_name #=> String
1762
+ #
1763
+ # For :dependency_failed_exception event available at #on_dependency_failed_exception_event callback and response eventstream enumerator:
1764
+ # event.message #=> String
1765
+ # event.resource_name #=> String
1766
+ #
1767
+ # For :internal_server_exception event available at #on_internal_server_exception_event callback and response eventstream enumerator:
1768
+ # event.message #=> String
1769
+ #
1770
+ # For :optimized_prompt_event event available at #on_optimized_prompt_event_event callback and response eventstream enumerator:
1771
+ # event.optimized_prompt.text_prompt.text #=> String
1772
+ #
1773
+ # For :throttling_exception event available at #on_throttling_exception_event callback and response eventstream enumerator:
1774
+ # event.message #=> String
1775
+ #
1776
+ # For :validation_exception event available at #on_validation_exception_event callback and response eventstream enumerator:
1777
+ # event.message #=> String
1778
+ #
1779
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/OptimizePrompt AWS API Documentation
1780
+ #
1781
+ # @overload optimize_prompt(params = {})
1782
+ # @param [Hash] params ({})
1783
+ def optimize_prompt(params = {}, options = {}, &block)
1784
+ params = params.dup
1785
+ event_stream_handler = case handler = params.delete(:event_stream_handler)
1786
+ when EventStreams::OptimizedPromptStream then handler
1787
+ when Proc then EventStreams::OptimizedPromptStream.new.tap(&handler)
1788
+ when nil then EventStreams::OptimizedPromptStream.new
1789
+ else
1790
+ msg = "expected :event_stream_handler to be a block or "\
1791
+ "instance of Aws::BedrockAgentRuntime::EventStreams::OptimizedPromptStream"\
1792
+ ", got `#{handler.inspect}` instead"
1793
+ raise ArgumentError, msg
1794
+ end
1795
+
1796
+ yield(event_stream_handler) if block_given?
1797
+
1798
+ req = build_request(:optimize_prompt, params)
1799
+
1800
+ req.context[:event_stream_handler] = event_stream_handler
1801
+ req.handlers.add(Aws::Binary::DecodeHandler, priority: 95)
1802
+
1803
+ req.send_request(options, &block)
1804
+ end
1805
+
1535
1806
  # Queries a knowledge base and retrieves information from it.
1536
1807
  #
1537
1808
  # @option params [required, String] :knowledge_base_id
@@ -1920,7 +2191,7 @@ module Aws::BedrockAgentRuntime
1920
2191
  tracer: tracer
1921
2192
  )
1922
2193
  context[:gem_name] = 'aws-sdk-bedrockagentruntime'
1923
- context[:gem_version] = '1.30.0'
2194
+ context[:gem_version] = '1.32.0'
1924
2195
  Seahorse::Client::Request.new(handlers, context)
1925
2196
  end
1926
2197
 
@@ -26,6 +26,7 @@ module Aws::BedrockAgentRuntime
26
26
  AgentAliasId = Shapes::StringShape.new(name: 'AgentAliasId')
27
27
  AgentId = Shapes::StringShape.new(name: 'AgentId')
28
28
  AgentVersion = Shapes::StringShape.new(name: 'AgentVersion')
29
+ AnalyzePromptEvent = Shapes::StructureShape.new(name: 'AnalyzePromptEvent')
29
30
  ApiContentMap = Shapes::MapShape.new(name: 'ApiContentMap')
30
31
  ApiInvocationInput = Shapes::StructureShape.new(name: 'ApiInvocationInput')
31
32
  ApiParameter = Shapes::StructureShape.new(name: 'ApiParameter')
@@ -85,6 +86,19 @@ module Aws::BedrockAgentRuntime
85
86
  FlowOutputContent = Shapes::UnionShape.new(name: 'FlowOutputContent')
86
87
  FlowOutputEvent = Shapes::StructureShape.new(name: 'FlowOutputEvent')
87
88
  FlowResponseStream = Shapes::StructureShape.new(name: 'FlowResponseStream')
89
+ FlowTrace = Shapes::UnionShape.new(name: 'FlowTrace')
90
+ FlowTraceCondition = Shapes::StructureShape.new(name: 'FlowTraceCondition')
91
+ FlowTraceConditionNodeResultEvent = Shapes::StructureShape.new(name: 'FlowTraceConditionNodeResultEvent')
92
+ FlowTraceConditions = Shapes::ListShape.new(name: 'FlowTraceConditions')
93
+ FlowTraceEvent = Shapes::StructureShape.new(name: 'FlowTraceEvent')
94
+ FlowTraceNodeInputContent = Shapes::UnionShape.new(name: 'FlowTraceNodeInputContent')
95
+ FlowTraceNodeInputEvent = Shapes::StructureShape.new(name: 'FlowTraceNodeInputEvent')
96
+ FlowTraceNodeInputField = Shapes::StructureShape.new(name: 'FlowTraceNodeInputField')
97
+ FlowTraceNodeInputFields = Shapes::ListShape.new(name: 'FlowTraceNodeInputFields')
98
+ FlowTraceNodeOutputContent = Shapes::UnionShape.new(name: 'FlowTraceNodeOutputContent')
99
+ FlowTraceNodeOutputEvent = Shapes::StructureShape.new(name: 'FlowTraceNodeOutputEvent')
100
+ FlowTraceNodeOutputField = Shapes::StructureShape.new(name: 'FlowTraceNodeOutputField')
101
+ FlowTraceNodeOutputFields = Shapes::ListShape.new(name: 'FlowTraceNodeOutputFields')
88
102
  Function = Shapes::StringShape.new(name: 'Function')
89
103
  FunctionInvocationInput = Shapes::StructureShape.new(name: 'FunctionInvocationInput')
90
104
  FunctionParameter = Shapes::StructureShape.new(name: 'FunctionParameter')
@@ -132,6 +146,7 @@ module Aws::BedrockAgentRuntime
132
146
  InferenceConfiguration = Shapes::StructureShape.new(name: 'InferenceConfiguration')
133
147
  InputFile = Shapes::StructureShape.new(name: 'InputFile')
134
148
  InputFiles = Shapes::ListShape.new(name: 'InputFiles')
149
+ InputPrompt = Shapes::UnionShape.new(name: 'InputPrompt')
135
150
  InputText = Shapes::StringShape.new(name: 'InputText')
136
151
  Integer = Shapes::IntegerShape.new(name: 'Integer')
137
152
  InternalServerException = Shapes::StructureShape.new(name: 'InternalServerException')
@@ -172,11 +187,18 @@ module Aws::BedrockAgentRuntime
172
187
  MimeType = Shapes::StringShape.new(name: 'MimeType')
173
188
  ModelInvocationInput = Shapes::StructureShape.new(name: 'ModelInvocationInput')
174
189
  NextToken = Shapes::StringShape.new(name: 'NextToken')
190
+ NodeInputName = Shapes::StringShape.new(name: 'NodeInputName')
175
191
  NodeName = Shapes::StringShape.new(name: 'NodeName')
176
192
  NodeOutputName = Shapes::StringShape.new(name: 'NodeOutputName')
177
193
  NodeType = Shapes::StringShape.new(name: 'NodeType')
178
194
  NonBlankString = Shapes::StringShape.new(name: 'NonBlankString')
179
195
  Observation = Shapes::StructureShape.new(name: 'Observation')
196
+ OptimizePromptRequest = Shapes::StructureShape.new(name: 'OptimizePromptRequest')
197
+ OptimizePromptRequestTargetModelIdString = Shapes::StringShape.new(name: 'OptimizePromptRequestTargetModelIdString')
198
+ OptimizePromptResponse = Shapes::StructureShape.new(name: 'OptimizePromptResponse')
199
+ OptimizedPrompt = Shapes::UnionShape.new(name: 'OptimizedPrompt')
200
+ OptimizedPromptEvent = Shapes::StructureShape.new(name: 'OptimizedPromptEvent')
201
+ OptimizedPromptStream = Shapes::StructureShape.new(name: 'OptimizedPromptStream')
180
202
  OrchestrationConfiguration = Shapes::StructureShape.new(name: 'OrchestrationConfiguration')
181
203
  OrchestrationModelInvocationOutput = Shapes::StructureShape.new(name: 'OrchestrationModelInvocationOutput')
182
204
  OrchestrationTrace = Shapes::UnionShape.new(name: 'OrchestrationTrace')
@@ -256,7 +278,9 @@ module Aws::BedrockAgentRuntime
256
278
  SummaryText = Shapes::StringShape.new(name: 'SummaryText')
257
279
  Temperature = Shapes::FloatShape.new(name: 'Temperature')
258
280
  TextInferenceConfig = Shapes::StructureShape.new(name: 'TextInferenceConfig')
281
+ TextPrompt = Shapes::StructureShape.new(name: 'TextPrompt')
259
282
  TextPromptTemplate = Shapes::StringShape.new(name: 'TextPromptTemplate')
283
+ TextPromptTextString = Shapes::StringShape.new(name: 'TextPromptTextString')
260
284
  TextResponsePart = Shapes::StructureShape.new(name: 'TextResponsePart')
261
285
  ThrottlingException = Shapes::StructureShape.new(name: 'ThrottlingException')
262
286
  TopK = Shapes::IntegerShape.new(name: 'TopK')
@@ -289,6 +313,9 @@ module Aws::BedrockAgentRuntime
289
313
  AdditionalModelRequestFields.key = Shapes::ShapeRef.new(shape: AdditionalModelRequestFieldsKey)
290
314
  AdditionalModelRequestFields.value = Shapes::ShapeRef.new(shape: AdditionalModelRequestFieldsValue)
291
315
 
316
+ AnalyzePromptEvent.add_member(:message, Shapes::ShapeRef.new(shape: String, location_name: "message"))
317
+ AnalyzePromptEvent.struct_class = Types::AnalyzePromptEvent
318
+
292
319
  ApiContentMap.key = Shapes::ShapeRef.new(shape: String)
293
320
  ApiContentMap.value = Shapes::ShapeRef.new(shape: PropertyParameters)
294
321
 
@@ -443,6 +470,7 @@ module Aws::BedrockAgentRuntime
443
470
  FlowResponseStream.add_member(:dependency_failed_exception, Shapes::ShapeRef.new(shape: DependencyFailedException, location_name: "dependencyFailedException"))
444
471
  FlowResponseStream.add_member(:flow_completion_event, Shapes::ShapeRef.new(shape: FlowCompletionEvent, event: true, location_name: "flowCompletionEvent"))
445
472
  FlowResponseStream.add_member(:flow_output_event, Shapes::ShapeRef.new(shape: FlowOutputEvent, event: true, location_name: "flowOutputEvent"))
473
+ FlowResponseStream.add_member(:flow_trace_event, Shapes::ShapeRef.new(shape: FlowTraceEvent, event: true, location_name: "flowTraceEvent"))
446
474
  FlowResponseStream.add_member(:internal_server_exception, Shapes::ShapeRef.new(shape: InternalServerException, location_name: "internalServerException"))
447
475
  FlowResponseStream.add_member(:resource_not_found_exception, Shapes::ShapeRef.new(shape: ResourceNotFoundException, location_name: "resourceNotFoundException"))
448
476
  FlowResponseStream.add_member(:service_quota_exceeded_exception, Shapes::ShapeRef.new(shape: ServiceQuotaExceededException, location_name: "serviceQuotaExceededException"))
@@ -450,6 +478,63 @@ module Aws::BedrockAgentRuntime
450
478
  FlowResponseStream.add_member(:validation_exception, Shapes::ShapeRef.new(shape: ValidationException, location_name: "validationException"))
451
479
  FlowResponseStream.struct_class = Types::FlowResponseStream
452
480
 
481
+ FlowTrace.add_member(:condition_node_result_trace, Shapes::ShapeRef.new(shape: FlowTraceConditionNodeResultEvent, location_name: "conditionNodeResultTrace"))
482
+ FlowTrace.add_member(:node_input_trace, Shapes::ShapeRef.new(shape: FlowTraceNodeInputEvent, location_name: "nodeInputTrace"))
483
+ FlowTrace.add_member(:node_output_trace, Shapes::ShapeRef.new(shape: FlowTraceNodeOutputEvent, location_name: "nodeOutputTrace"))
484
+ FlowTrace.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
485
+ FlowTrace.add_member_subclass(:condition_node_result_trace, Types::FlowTrace::ConditionNodeResultTrace)
486
+ FlowTrace.add_member_subclass(:node_input_trace, Types::FlowTrace::NodeInputTrace)
487
+ FlowTrace.add_member_subclass(:node_output_trace, Types::FlowTrace::NodeOutputTrace)
488
+ FlowTrace.add_member_subclass(:unknown, Types::FlowTrace::Unknown)
489
+ FlowTrace.struct_class = Types::FlowTrace
490
+
491
+ FlowTraceCondition.add_member(:condition_name, Shapes::ShapeRef.new(shape: String, required: true, location_name: "conditionName"))
492
+ FlowTraceCondition.struct_class = Types::FlowTraceCondition
493
+
494
+ FlowTraceConditionNodeResultEvent.add_member(:node_name, Shapes::ShapeRef.new(shape: NodeName, required: true, location_name: "nodeName"))
495
+ FlowTraceConditionNodeResultEvent.add_member(:satisfied_conditions, Shapes::ShapeRef.new(shape: FlowTraceConditions, required: true, location_name: "satisfiedConditions"))
496
+ FlowTraceConditionNodeResultEvent.add_member(:timestamp, Shapes::ShapeRef.new(shape: DateTimestamp, required: true, location_name: "timestamp"))
497
+ FlowTraceConditionNodeResultEvent.struct_class = Types::FlowTraceConditionNodeResultEvent
498
+
499
+ FlowTraceConditions.member = Shapes::ShapeRef.new(shape: FlowTraceCondition)
500
+
501
+ FlowTraceEvent.add_member(:trace, Shapes::ShapeRef.new(shape: FlowTrace, required: true, location_name: "trace"))
502
+ FlowTraceEvent.struct_class = Types::FlowTraceEvent
503
+
504
+ FlowTraceNodeInputContent.add_member(:document, Shapes::ShapeRef.new(shape: Document, location_name: "document"))
505
+ FlowTraceNodeInputContent.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
506
+ FlowTraceNodeInputContent.add_member_subclass(:document, Types::FlowTraceNodeInputContent::Document)
507
+ FlowTraceNodeInputContent.add_member_subclass(:unknown, Types::FlowTraceNodeInputContent::Unknown)
508
+ FlowTraceNodeInputContent.struct_class = Types::FlowTraceNodeInputContent
509
+
510
+ FlowTraceNodeInputEvent.add_member(:fields, Shapes::ShapeRef.new(shape: FlowTraceNodeInputFields, required: true, location_name: "fields"))
511
+ FlowTraceNodeInputEvent.add_member(:node_name, Shapes::ShapeRef.new(shape: NodeName, required: true, location_name: "nodeName"))
512
+ FlowTraceNodeInputEvent.add_member(:timestamp, Shapes::ShapeRef.new(shape: DateTimestamp, required: true, location_name: "timestamp"))
513
+ FlowTraceNodeInputEvent.struct_class = Types::FlowTraceNodeInputEvent
514
+
515
+ FlowTraceNodeInputField.add_member(:content, Shapes::ShapeRef.new(shape: FlowTraceNodeInputContent, required: true, location_name: "content"))
516
+ FlowTraceNodeInputField.add_member(:node_input_name, Shapes::ShapeRef.new(shape: NodeInputName, required: true, location_name: "nodeInputName"))
517
+ FlowTraceNodeInputField.struct_class = Types::FlowTraceNodeInputField
518
+
519
+ FlowTraceNodeInputFields.member = Shapes::ShapeRef.new(shape: FlowTraceNodeInputField)
520
+
521
+ FlowTraceNodeOutputContent.add_member(:document, Shapes::ShapeRef.new(shape: Document, location_name: "document"))
522
+ FlowTraceNodeOutputContent.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
523
+ FlowTraceNodeOutputContent.add_member_subclass(:document, Types::FlowTraceNodeOutputContent::Document)
524
+ FlowTraceNodeOutputContent.add_member_subclass(:unknown, Types::FlowTraceNodeOutputContent::Unknown)
525
+ FlowTraceNodeOutputContent.struct_class = Types::FlowTraceNodeOutputContent
526
+
527
+ FlowTraceNodeOutputEvent.add_member(:fields, Shapes::ShapeRef.new(shape: FlowTraceNodeOutputFields, required: true, location_name: "fields"))
528
+ FlowTraceNodeOutputEvent.add_member(:node_name, Shapes::ShapeRef.new(shape: NodeName, required: true, location_name: "nodeName"))
529
+ FlowTraceNodeOutputEvent.add_member(:timestamp, Shapes::ShapeRef.new(shape: DateTimestamp, required: true, location_name: "timestamp"))
530
+ FlowTraceNodeOutputEvent.struct_class = Types::FlowTraceNodeOutputEvent
531
+
532
+ FlowTraceNodeOutputField.add_member(:content, Shapes::ShapeRef.new(shape: FlowTraceNodeOutputContent, required: true, location_name: "content"))
533
+ FlowTraceNodeOutputField.add_member(:node_output_name, Shapes::ShapeRef.new(shape: NodeOutputName, required: true, location_name: "nodeOutputName"))
534
+ FlowTraceNodeOutputField.struct_class = Types::FlowTraceNodeOutputField
535
+
536
+ FlowTraceNodeOutputFields.member = Shapes::ShapeRef.new(shape: FlowTraceNodeOutputField)
537
+
453
538
  FunctionInvocationInput.add_member(:action_group, Shapes::ShapeRef.new(shape: String, required: true, location_name: "actionGroup"))
454
539
  FunctionInvocationInput.add_member(:action_invocation_type, Shapes::ShapeRef.new(shape: ActionInvocationType, location_name: "actionInvocationType"))
455
540
  FunctionInvocationInput.add_member(:function, Shapes::ShapeRef.new(shape: String, location_name: "function"))
@@ -582,6 +667,12 @@ module Aws::BedrockAgentRuntime
582
667
 
583
668
  InputFiles.member = Shapes::ShapeRef.new(shape: InputFile)
584
669
 
670
+ InputPrompt.add_member(:text_prompt, Shapes::ShapeRef.new(shape: TextPrompt, location_name: "textPrompt"))
671
+ InputPrompt.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
672
+ InputPrompt.add_member_subclass(:text_prompt, Types::InputPrompt::TextPrompt)
673
+ InputPrompt.add_member_subclass(:unknown, Types::InputPrompt::Unknown)
674
+ InputPrompt.struct_class = Types::InputPrompt
675
+
585
676
  InternalServerException.add_member(:message, Shapes::ShapeRef.new(shape: NonBlankString, location_name: "message"))
586
677
  InternalServerException.struct_class = Types::InternalServerException
587
678
 
@@ -628,6 +719,7 @@ module Aws::BedrockAgentRuntime
628
719
  InvokeAgentResponse[:payload] = :completion
629
720
  InvokeAgentResponse[:payload_member] = InvokeAgentResponse.member(:completion)
630
721
 
722
+ InvokeFlowRequest.add_member(:enable_trace, Shapes::ShapeRef.new(shape: Boolean, location_name: "enableTrace"))
631
723
  InvokeFlowRequest.add_member(:flow_alias_identifier, Shapes::ShapeRef.new(shape: FlowAliasIdentifier, required: true, location: "uri", location_name: "flowAliasIdentifier"))
632
724
  InvokeFlowRequest.add_member(:flow_identifier, Shapes::ShapeRef.new(shape: FlowIdentifier, required: true, location: "uri", location_name: "flowIdentifier"))
633
725
  InvokeFlowRequest.add_member(:inputs, Shapes::ShapeRef.new(shape: FlowInputs, required: true, location_name: "inputs"))
@@ -713,6 +805,34 @@ module Aws::BedrockAgentRuntime
713
805
  Observation.add_member(:type, Shapes::ShapeRef.new(shape: Type, location_name: "type"))
714
806
  Observation.struct_class = Types::Observation
715
807
 
808
+ OptimizePromptRequest.add_member(:input, Shapes::ShapeRef.new(shape: InputPrompt, required: true, location_name: "input"))
809
+ OptimizePromptRequest.add_member(:target_model_id, Shapes::ShapeRef.new(shape: OptimizePromptRequestTargetModelIdString, required: true, location_name: "targetModelId"))
810
+ OptimizePromptRequest.struct_class = Types::OptimizePromptRequest
811
+
812
+ OptimizePromptResponse.add_member(:optimized_prompt, Shapes::ShapeRef.new(shape: OptimizedPromptStream, required: true, eventstream: true, location_name: "optimizedPrompt"))
813
+ OptimizePromptResponse.struct_class = Types::OptimizePromptResponse
814
+ OptimizePromptResponse[:payload] = :optimized_prompt
815
+ OptimizePromptResponse[:payload_member] = OptimizePromptResponse.member(:optimized_prompt)
816
+
817
+ OptimizedPrompt.add_member(:text_prompt, Shapes::ShapeRef.new(shape: TextPrompt, location_name: "textPrompt"))
818
+ OptimizedPrompt.add_member(:unknown, Shapes::ShapeRef.new(shape: nil, location_name: 'unknown'))
819
+ OptimizedPrompt.add_member_subclass(:text_prompt, Types::OptimizedPrompt::TextPrompt)
820
+ OptimizedPrompt.add_member_subclass(:unknown, Types::OptimizedPrompt::Unknown)
821
+ OptimizedPrompt.struct_class = Types::OptimizedPrompt
822
+
823
+ OptimizedPromptEvent.add_member(:optimized_prompt, Shapes::ShapeRef.new(shape: OptimizedPrompt, location_name: "optimizedPrompt"))
824
+ OptimizedPromptEvent.struct_class = Types::OptimizedPromptEvent
825
+
826
+ OptimizedPromptStream.add_member(:access_denied_exception, Shapes::ShapeRef.new(shape: AccessDeniedException, location_name: "accessDeniedException"))
827
+ OptimizedPromptStream.add_member(:analyze_prompt_event, Shapes::ShapeRef.new(shape: AnalyzePromptEvent, event: true, location_name: "analyzePromptEvent"))
828
+ OptimizedPromptStream.add_member(:bad_gateway_exception, Shapes::ShapeRef.new(shape: BadGatewayException, location_name: "badGatewayException"))
829
+ OptimizedPromptStream.add_member(:dependency_failed_exception, Shapes::ShapeRef.new(shape: DependencyFailedException, location_name: "dependencyFailedException"))
830
+ OptimizedPromptStream.add_member(:internal_server_exception, Shapes::ShapeRef.new(shape: InternalServerException, location_name: "internalServerException"))
831
+ OptimizedPromptStream.add_member(:optimized_prompt_event, Shapes::ShapeRef.new(shape: OptimizedPromptEvent, event: true, location_name: "optimizedPromptEvent"))
832
+ OptimizedPromptStream.add_member(:throttling_exception, Shapes::ShapeRef.new(shape: ThrottlingException, location_name: "throttlingException"))
833
+ OptimizedPromptStream.add_member(:validation_exception, Shapes::ShapeRef.new(shape: ValidationException, location_name: "validationException"))
834
+ OptimizedPromptStream.struct_class = Types::OptimizedPromptStream
835
+
716
836
  OrchestrationConfiguration.add_member(:additional_model_request_fields, Shapes::ShapeRef.new(shape: AdditionalModelRequestFields, location_name: "additionalModelRequestFields"))
717
837
  OrchestrationConfiguration.add_member(:inference_config, Shapes::ShapeRef.new(shape: InferenceConfig, location_name: "inferenceConfig"))
718
838
  OrchestrationConfiguration.add_member(:prompt_template, Shapes::ShapeRef.new(shape: PromptTemplate, location_name: "promptTemplate"))
@@ -984,6 +1104,9 @@ module Aws::BedrockAgentRuntime
984
1104
  TextInferenceConfig.add_member(:top_p, Shapes::ShapeRef.new(shape: TopP, location_name: "topP"))
985
1105
  TextInferenceConfig.struct_class = Types::TextInferenceConfig
986
1106
 
1107
+ TextPrompt.add_member(:text, Shapes::ShapeRef.new(shape: TextPromptTextString, required: true, location_name: "text"))
1108
+ TextPrompt.struct_class = Types::TextPrompt
1109
+
987
1110
  TextResponsePart.add_member(:span, Shapes::ShapeRef.new(shape: Span, location_name: "span"))
988
1111
  TextResponsePart.add_member(:text, Shapes::ShapeRef.new(shape: String, location_name: "text"))
989
1112
  TextResponsePart.struct_class = Types::TextResponsePart
@@ -1113,6 +1236,20 @@ module Aws::BedrockAgentRuntime
1113
1236
  o.errors << Shapes::ShapeRef.new(shape: ServiceQuotaExceededException)
1114
1237
  end)
1115
1238
 
1239
+ api.add_operation(:optimize_prompt, Seahorse::Model::Operation.new.tap do |o|
1240
+ o.name = "OptimizePrompt"
1241
+ o.http_method = "POST"
1242
+ o.http_request_uri = "/optimize-prompt"
1243
+ o.input = Shapes::ShapeRef.new(shape: OptimizePromptRequest)
1244
+ o.output = Shapes::ShapeRef.new(shape: OptimizePromptResponse)
1245
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
1246
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
1247
+ o.errors << Shapes::ShapeRef.new(shape: DependencyFailedException)
1248
+ o.errors << Shapes::ShapeRef.new(shape: BadGatewayException)
1249
+ o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
1250
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
1251
+ end)
1252
+
1116
1253
  api.add_operation(:retrieve, Seahorse::Model::Operation.new.tap do |o|
1117
1254
  o.name = "Retrieve"
1118
1255
  o.http_method = "POST"