aws-sdk-bedrockagentruntime 1.32.0 → 1.33.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.
@@ -1148,7 +1148,7 @@ module Aws::BedrockAgentRuntime
1148
1148
  # event.trace.orchestration_trace.model_invocation_input.prompt_creation_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
1149
1149
  # event.trace.orchestration_trace.model_invocation_input.text #=> String
1150
1150
  # event.trace.orchestration_trace.model_invocation_input.trace_id #=> String
1151
- # event.trace.orchestration_trace.model_invocation_input.type #=> String, one of "PRE_PROCESSING", "ORCHESTRATION", "KNOWLEDGE_BASE_RESPONSE_GENERATION", "POST_PROCESSING"
1151
+ # event.trace.orchestration_trace.model_invocation_input.type #=> String, one of "PRE_PROCESSING", "ORCHESTRATION", "KNOWLEDGE_BASE_RESPONSE_GENERATION", "POST_PROCESSING", "ROUTING_CLASSIFIER"
1152
1152
  # event.trace.orchestration_trace.model_invocation_output.metadata.usage.input_tokens #=> Integer
1153
1153
  # event.trace.orchestration_trace.model_invocation_output.metadata.usage.output_tokens #=> Integer
1154
1154
  # event.trace.orchestration_trace.model_invocation_output.raw_response.content #=> String
@@ -1186,7 +1186,7 @@ module Aws::BedrockAgentRuntime
1186
1186
  # event.trace.post_processing_trace.model_invocation_input.prompt_creation_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
1187
1187
  # event.trace.post_processing_trace.model_invocation_input.text #=> String
1188
1188
  # event.trace.post_processing_trace.model_invocation_input.trace_id #=> String
1189
- # event.trace.post_processing_trace.model_invocation_input.type #=> String, one of "PRE_PROCESSING", "ORCHESTRATION", "KNOWLEDGE_BASE_RESPONSE_GENERATION", "POST_PROCESSING"
1189
+ # event.trace.post_processing_trace.model_invocation_input.type #=> String, one of "PRE_PROCESSING", "ORCHESTRATION", "KNOWLEDGE_BASE_RESPONSE_GENERATION", "POST_PROCESSING", "ROUTING_CLASSIFIER"
1190
1190
  # event.trace.post_processing_trace.model_invocation_output.metadata.usage.input_tokens #=> Integer
1191
1191
  # event.trace.post_processing_trace.model_invocation_output.metadata.usage.output_tokens #=> Integer
1192
1192
  # event.trace.post_processing_trace.model_invocation_output.parsed_response.text #=> String
@@ -1203,7 +1203,7 @@ module Aws::BedrockAgentRuntime
1203
1203
  # event.trace.pre_processing_trace.model_invocation_input.prompt_creation_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
1204
1204
  # event.trace.pre_processing_trace.model_invocation_input.text #=> String
1205
1205
  # event.trace.pre_processing_trace.model_invocation_input.trace_id #=> String
1206
- # event.trace.pre_processing_trace.model_invocation_input.type #=> String, one of "PRE_PROCESSING", "ORCHESTRATION", "KNOWLEDGE_BASE_RESPONSE_GENERATION", "POST_PROCESSING"
1206
+ # event.trace.pre_processing_trace.model_invocation_input.type #=> String, one of "PRE_PROCESSING", "ORCHESTRATION", "KNOWLEDGE_BASE_RESPONSE_GENERATION", "POST_PROCESSING", "ROUTING_CLASSIFIER"
1207
1207
  # event.trace.pre_processing_trace.model_invocation_output.metadata.usage.input_tokens #=> Integer
1208
1208
  # event.trace.pre_processing_trace.model_invocation_output.metadata.usage.output_tokens #=> Integer
1209
1209
  # event.trace.pre_processing_trace.model_invocation_output.parsed_response.is_valid #=> Boolean
@@ -1567,6 +1567,779 @@ module Aws::BedrockAgentRuntime
1567
1567
  req.send_request(options, &block)
1568
1568
  end
1569
1569
 
1570
+ # Invokes an inline Amazon Bedrock agent using the configurations you
1571
+ # provide with the request.
1572
+ #
1573
+ # * Specify the following fields for security purposes.
1574
+ #
1575
+ # * (Optional) `customerEncryptionKeyArn` – The Amazon Resource Name
1576
+ # (ARN) of a KMS key to encrypt the creation of the agent.
1577
+ #
1578
+ # * (Optional) `idleSessionTTLinSeconds` – Specify the number of
1579
+ # seconds for which the agent should maintain session information.
1580
+ # After this time expires, the subsequent `InvokeInlineAgent`
1581
+ # request begins a new session.
1582
+ # * To override the default prompt behavior for agent orchestration and
1583
+ # to use advanced prompts, include a `promptOverrideConfiguration`
1584
+ # object. For more information, see [Advanced prompts][1].
1585
+ #
1586
+ # * The agent instructions will not be honored if your agent has only
1587
+ # one knowledge base, uses default prompts, has no action group, and
1588
+ # user input is disabled.
1589
+ #
1590
+ # <note markdown="1"> The CLI doesn't support streaming operations in Amazon Bedrock,
1591
+ # including `InvokeInlineAgent`.
1592
+ #
1593
+ # </note>
1594
+ #
1595
+ #
1596
+ #
1597
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html
1598
+ #
1599
+ # @option params [Array<Types::AgentActionGroup>] :action_groups
1600
+ # A list of action groups with each action group defining the action the
1601
+ # inline agent needs to carry out.
1602
+ #
1603
+ # @option params [String] :customer_encryption_key_arn
1604
+ # The Amazon Resource Name (ARN) of the Amazon Web Services KMS key to
1605
+ # use to encrypt your inline agent.
1606
+ #
1607
+ # @option params [Boolean] :enable_trace
1608
+ # Specifies whether to turn on the trace or not to track the agent's
1609
+ # reasoning process. For more information, see [Using trace][1].
1610
+ # </p>
1611
+ #
1612
+ #
1613
+ #
1614
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/trace-events.html
1615
+ #
1616
+ # @option params [Boolean] :end_session
1617
+ # Specifies whether to end the session with the inline agent or not.
1618
+ #
1619
+ # @option params [required, String] :foundation_model
1620
+ # The [model identifier (ID)][1] of the model to use for orchestration
1621
+ # by the inline agent. For example, `meta.llama3-1-70b-instruct-v1:0`.
1622
+ #
1623
+ #
1624
+ #
1625
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns
1626
+ #
1627
+ # @option params [Types::GuardrailConfigurationWithArn] :guardrail_configuration
1628
+ # The [guardrails][1] to assign to the inline agent.
1629
+ #
1630
+ #
1631
+ #
1632
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html
1633
+ #
1634
+ # @option params [Integer] :idle_session_ttl_in_seconds
1635
+ # The number of seconds for which the inline agent should maintain
1636
+ # session information. After this time expires, the subsequent
1637
+ # `InvokeInlineAgent` request begins a new session.
1638
+ #
1639
+ # A user interaction remains active for the amount of time specified. If
1640
+ # no conversation occurs during this time, the session expires and the
1641
+ # data provided before the timeout is deleted.
1642
+ #
1643
+ # @option params [Types::InlineSessionState] :inline_session_state
1644
+ # Parameters that specify the various attributes of a sessions. You can
1645
+ # include attributes for the session or prompt or, if you configured an
1646
+ # action group to return control, results from invocation of the action
1647
+ # group. For more information, see [Control session context][1].
1648
+ #
1649
+ # <note markdown="1"> If you include `returnControlInvocationResults` in the `sessionState`
1650
+ # field, the `inputText` field will be ignored.
1651
+ #
1652
+ # </note>
1653
+ #
1654
+ #
1655
+ #
1656
+ # [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html
1657
+ #
1658
+ # @option params [String] :input_text
1659
+ # The prompt text to send to the agent.
1660
+ #
1661
+ # <note markdown="1"> If you include `returnControlInvocationResults` in the `sessionState`
1662
+ # field, the `inputText` field will be ignored.
1663
+ #
1664
+ # </note>
1665
+ #
1666
+ # @option params [required, String] :instruction
1667
+ # The instructions that tell the inline agent what it should do and how
1668
+ # it should interact with users.
1669
+ #
1670
+ # @option params [Array<Types::KnowledgeBase>] :knowledge_bases
1671
+ # Contains information of the knowledge bases to associate with.
1672
+ #
1673
+ # @option params [Types::PromptOverrideConfiguration] :prompt_override_configuration
1674
+ # Configurations for advanced prompts used to override the default
1675
+ # prompts to enhance the accuracy of the inline agent.
1676
+ #
1677
+ # @option params [required, String] :session_id
1678
+ # The unique identifier of the session. Use the same value across
1679
+ # requests to continue the same conversation.
1680
+ #
1681
+ # @return [Types::InvokeInlineAgentResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1682
+ #
1683
+ # * {Types::InvokeInlineAgentResponse#completion #completion} => Types::InlineAgentResponseStream
1684
+ # * {Types::InvokeInlineAgentResponse#content_type #content_type} => String
1685
+ # * {Types::InvokeInlineAgentResponse#session_id #session_id} => String
1686
+ #
1687
+ # @example EventStream Operation Example
1688
+ #
1689
+ # You can process the event once it arrives immediately, or wait until the
1690
+ # full response is complete and iterate through the eventstream enumerator.
1691
+ #
1692
+ # To interact with event immediately, you need to register #invoke_inline_agent
1693
+ # with callbacks. Callbacks can be registered for specific events or for all
1694
+ # events, including error events.
1695
+ #
1696
+ # Callbacks can be passed into the `:event_stream_handler` option or within a
1697
+ # block statement attached to the #invoke_inline_agent call directly. Hybrid
1698
+ # pattern of both is also supported.
1699
+ #
1700
+ # `:event_stream_handler` option takes in either a Proc object or
1701
+ # Aws::BedrockAgentRuntime::EventStreams::InlineAgentResponseStream object.
1702
+ #
1703
+ # Usage pattern a): Callbacks with a block attached to #invoke_inline_agent
1704
+ # Example for registering callbacks for all event types and an error event
1705
+ #
1706
+ # client.invoke_inline_agent( # params input# ) do |stream|
1707
+ # stream.on_error_event do |event|
1708
+ # # catch unmodeled error event in the stream
1709
+ # raise event
1710
+ # # => Aws::Errors::EventError
1711
+ # # event.event_type => :error
1712
+ # # event.error_code => String
1713
+ # # event.error_message => String
1714
+ # end
1715
+ #
1716
+ # stream.on_event do |event|
1717
+ # # process all events arrive
1718
+ # puts event.event_type
1719
+ # ...
1720
+ # end
1721
+ #
1722
+ # end
1723
+ #
1724
+ # Usage pattern b): Pass in `:event_stream_handler` for #invoke_inline_agent
1725
+ #
1726
+ # 1) Create a Aws::BedrockAgentRuntime::EventStreams::InlineAgentResponseStream object
1727
+ # Example for registering callbacks with specific events
1728
+ #
1729
+ # handler = Aws::BedrockAgentRuntime::EventStreams::InlineAgentResponseStream.new
1730
+ # handler.on_access_denied_exception_event do |event|
1731
+ # event # => Aws::BedrockAgentRuntime::Types::accessDeniedException
1732
+ # end
1733
+ # handler.on_bad_gateway_exception_event do |event|
1734
+ # event # => Aws::BedrockAgentRuntime::Types::badGatewayException
1735
+ # end
1736
+ # handler.on_chunk_event do |event|
1737
+ # event # => Aws::BedrockAgentRuntime::Types::chunk
1738
+ # end
1739
+ # handler.on_conflict_exception_event do |event|
1740
+ # event # => Aws::BedrockAgentRuntime::Types::conflictException
1741
+ # end
1742
+ # handler.on_dependency_failed_exception_event do |event|
1743
+ # event # => Aws::BedrockAgentRuntime::Types::dependencyFailedException
1744
+ # end
1745
+ # handler.on_files_event do |event|
1746
+ # event # => Aws::BedrockAgentRuntime::Types::files
1747
+ # end
1748
+ # handler.on_internal_server_exception_event do |event|
1749
+ # event # => Aws::BedrockAgentRuntime::Types::internalServerException
1750
+ # end
1751
+ # handler.on_resource_not_found_exception_event do |event|
1752
+ # event # => Aws::BedrockAgentRuntime::Types::resourceNotFoundException
1753
+ # end
1754
+ # handler.on_return_control_event do |event|
1755
+ # event # => Aws::BedrockAgentRuntime::Types::returnControl
1756
+ # end
1757
+ # handler.on_service_quota_exceeded_exception_event do |event|
1758
+ # event # => Aws::BedrockAgentRuntime::Types::serviceQuotaExceededException
1759
+ # end
1760
+ # handler.on_throttling_exception_event do |event|
1761
+ # event # => Aws::BedrockAgentRuntime::Types::throttlingException
1762
+ # end
1763
+ # handler.on_trace_event do |event|
1764
+ # event # => Aws::BedrockAgentRuntime::Types::trace
1765
+ # end
1766
+ # handler.on_validation_exception_event do |event|
1767
+ # event # => Aws::BedrockAgentRuntime::Types::validationException
1768
+ # end
1769
+ #
1770
+ # client.invoke_inline_agent( # params input #, event_stream_handler: handler)
1771
+ #
1772
+ # 2) Use a Ruby Proc object
1773
+ # Example for registering callbacks with specific events
1774
+ #
1775
+ # handler = Proc.new do |stream|
1776
+ # stream.on_access_denied_exception_event do |event|
1777
+ # event # => Aws::BedrockAgentRuntime::Types::accessDeniedException
1778
+ # end
1779
+ # stream.on_bad_gateway_exception_event do |event|
1780
+ # event # => Aws::BedrockAgentRuntime::Types::badGatewayException
1781
+ # end
1782
+ # stream.on_chunk_event do |event|
1783
+ # event # => Aws::BedrockAgentRuntime::Types::chunk
1784
+ # end
1785
+ # stream.on_conflict_exception_event do |event|
1786
+ # event # => Aws::BedrockAgentRuntime::Types::conflictException
1787
+ # end
1788
+ # stream.on_dependency_failed_exception_event do |event|
1789
+ # event # => Aws::BedrockAgentRuntime::Types::dependencyFailedException
1790
+ # end
1791
+ # stream.on_files_event do |event|
1792
+ # event # => Aws::BedrockAgentRuntime::Types::files
1793
+ # end
1794
+ # stream.on_internal_server_exception_event do |event|
1795
+ # event # => Aws::BedrockAgentRuntime::Types::internalServerException
1796
+ # end
1797
+ # stream.on_resource_not_found_exception_event do |event|
1798
+ # event # => Aws::BedrockAgentRuntime::Types::resourceNotFoundException
1799
+ # end
1800
+ # stream.on_return_control_event do |event|
1801
+ # event # => Aws::BedrockAgentRuntime::Types::returnControl
1802
+ # end
1803
+ # stream.on_service_quota_exceeded_exception_event do |event|
1804
+ # event # => Aws::BedrockAgentRuntime::Types::serviceQuotaExceededException
1805
+ # end
1806
+ # stream.on_throttling_exception_event do |event|
1807
+ # event # => Aws::BedrockAgentRuntime::Types::throttlingException
1808
+ # end
1809
+ # stream.on_trace_event do |event|
1810
+ # event # => Aws::BedrockAgentRuntime::Types::trace
1811
+ # end
1812
+ # stream.on_validation_exception_event do |event|
1813
+ # event # => Aws::BedrockAgentRuntime::Types::validationException
1814
+ # end
1815
+ # end
1816
+ #
1817
+ # client.invoke_inline_agent( # params input #, event_stream_handler: handler)
1818
+ #
1819
+ # Usage pattern c): Hybrid pattern of a) and b)
1820
+ #
1821
+ # handler = Aws::BedrockAgentRuntime::EventStreams::InlineAgentResponseStream.new
1822
+ # handler.on_access_denied_exception_event do |event|
1823
+ # event # => Aws::BedrockAgentRuntime::Types::accessDeniedException
1824
+ # end
1825
+ # handler.on_bad_gateway_exception_event do |event|
1826
+ # event # => Aws::BedrockAgentRuntime::Types::badGatewayException
1827
+ # end
1828
+ # handler.on_chunk_event do |event|
1829
+ # event # => Aws::BedrockAgentRuntime::Types::chunk
1830
+ # end
1831
+ # handler.on_conflict_exception_event do |event|
1832
+ # event # => Aws::BedrockAgentRuntime::Types::conflictException
1833
+ # end
1834
+ # handler.on_dependency_failed_exception_event do |event|
1835
+ # event # => Aws::BedrockAgentRuntime::Types::dependencyFailedException
1836
+ # end
1837
+ # handler.on_files_event do |event|
1838
+ # event # => Aws::BedrockAgentRuntime::Types::files
1839
+ # end
1840
+ # handler.on_internal_server_exception_event do |event|
1841
+ # event # => Aws::BedrockAgentRuntime::Types::internalServerException
1842
+ # end
1843
+ # handler.on_resource_not_found_exception_event do |event|
1844
+ # event # => Aws::BedrockAgentRuntime::Types::resourceNotFoundException
1845
+ # end
1846
+ # handler.on_return_control_event do |event|
1847
+ # event # => Aws::BedrockAgentRuntime::Types::returnControl
1848
+ # end
1849
+ # handler.on_service_quota_exceeded_exception_event do |event|
1850
+ # event # => Aws::BedrockAgentRuntime::Types::serviceQuotaExceededException
1851
+ # end
1852
+ # handler.on_throttling_exception_event do |event|
1853
+ # event # => Aws::BedrockAgentRuntime::Types::throttlingException
1854
+ # end
1855
+ # handler.on_trace_event do |event|
1856
+ # event # => Aws::BedrockAgentRuntime::Types::trace
1857
+ # end
1858
+ # handler.on_validation_exception_event do |event|
1859
+ # event # => Aws::BedrockAgentRuntime::Types::validationException
1860
+ # end
1861
+ #
1862
+ # client.invoke_inline_agent( # params input #, event_stream_handler: handler) do |stream|
1863
+ # stream.on_error_event do |event|
1864
+ # # catch unmodeled error event in the stream
1865
+ # raise event
1866
+ # # => Aws::Errors::EventError
1867
+ # # event.event_type => :error
1868
+ # # event.error_code => String
1869
+ # # event.error_message => String
1870
+ # end
1871
+ # end
1872
+ #
1873
+ # You can also iterate through events after the response complete.
1874
+ #
1875
+ # Events are available at resp.completion # => Enumerator
1876
+ # For parameter input example, please refer to following request syntax
1877
+ #
1878
+ # @example Request syntax with placeholder values
1879
+ #
1880
+ # resp = client.invoke_inline_agent({
1881
+ # action_groups: [
1882
+ # {
1883
+ # action_group_executor: {
1884
+ # custom_control: "RETURN_CONTROL", # accepts RETURN_CONTROL
1885
+ # lambda: "LambdaResourceArn",
1886
+ # },
1887
+ # action_group_name: "ResourceName", # required
1888
+ # api_schema: {
1889
+ # payload: "Payload",
1890
+ # s3: {
1891
+ # s3_bucket_name: "S3BucketName",
1892
+ # s3_object_key: "S3ObjectKey",
1893
+ # },
1894
+ # },
1895
+ # description: "ResourceDescription",
1896
+ # function_schema: {
1897
+ # functions: [
1898
+ # {
1899
+ # description: "FunctionDescription",
1900
+ # name: "ResourceName", # required
1901
+ # parameters: {
1902
+ # "ParameterName" => {
1903
+ # description: "ParameterDescription",
1904
+ # required: false,
1905
+ # type: "string", # required, accepts string, number, integer, boolean, array
1906
+ # },
1907
+ # },
1908
+ # require_confirmation: "ENABLED", # accepts ENABLED, DISABLED
1909
+ # },
1910
+ # ],
1911
+ # },
1912
+ # parent_action_group_signature: "AMAZON.UserInput", # accepts AMAZON.UserInput, AMAZON.CodeInterpreter
1913
+ # },
1914
+ # ],
1915
+ # customer_encryption_key_arn: "KmsKeyArn",
1916
+ # enable_trace: false,
1917
+ # end_session: false,
1918
+ # foundation_model: "ModelIdentifier", # required
1919
+ # guardrail_configuration: {
1920
+ # guardrail_identifier: "GuardrailIdentifierWithArn", # required
1921
+ # guardrail_version: "GuardrailVersion", # required
1922
+ # },
1923
+ # idle_session_ttl_in_seconds: 1,
1924
+ # inline_session_state: {
1925
+ # files: [
1926
+ # {
1927
+ # name: "String", # required
1928
+ # source: { # required
1929
+ # byte_content: {
1930
+ # data: "data", # required
1931
+ # media_type: "MimeType", # required
1932
+ # },
1933
+ # s3_location: {
1934
+ # uri: "S3Uri", # required
1935
+ # },
1936
+ # source_type: "S3", # required, accepts S3, BYTE_CONTENT
1937
+ # },
1938
+ # use_case: "CODE_INTERPRETER", # required, accepts CODE_INTERPRETER, CHAT
1939
+ # },
1940
+ # ],
1941
+ # invocation_id: "String",
1942
+ # prompt_session_attributes: {
1943
+ # "String" => "String",
1944
+ # },
1945
+ # return_control_invocation_results: [
1946
+ # {
1947
+ # api_result: {
1948
+ # action_group: "String", # required
1949
+ # api_path: "ApiPath",
1950
+ # confirmation_state: "CONFIRM", # accepts CONFIRM, DENY
1951
+ # http_method: "String",
1952
+ # http_status_code: 1,
1953
+ # response_body: {
1954
+ # "String" => {
1955
+ # body: "String",
1956
+ # },
1957
+ # },
1958
+ # response_state: "FAILURE", # accepts FAILURE, REPROMPT
1959
+ # },
1960
+ # function_result: {
1961
+ # action_group: "String", # required
1962
+ # confirmation_state: "CONFIRM", # accepts CONFIRM, DENY
1963
+ # function: "String",
1964
+ # response_body: {
1965
+ # "String" => {
1966
+ # body: "String",
1967
+ # },
1968
+ # },
1969
+ # response_state: "FAILURE", # accepts FAILURE, REPROMPT
1970
+ # },
1971
+ # },
1972
+ # ],
1973
+ # session_attributes: {
1974
+ # "String" => "String",
1975
+ # },
1976
+ # },
1977
+ # input_text: "InputText",
1978
+ # instruction: "Instruction", # required
1979
+ # knowledge_bases: [
1980
+ # {
1981
+ # description: "ResourceDescription", # required
1982
+ # knowledge_base_id: "KnowledgeBaseId", # required
1983
+ # retrieval_configuration: {
1984
+ # vector_search_configuration: { # required
1985
+ # filter: {
1986
+ # and_all: [
1987
+ # {
1988
+ # # recursive RetrievalFilter
1989
+ # },
1990
+ # ],
1991
+ # equals: {
1992
+ # key: "FilterKey", # required
1993
+ # value: { # required
1994
+ # },
1995
+ # },
1996
+ # greater_than: {
1997
+ # key: "FilterKey", # required
1998
+ # value: { # required
1999
+ # },
2000
+ # },
2001
+ # greater_than_or_equals: {
2002
+ # key: "FilterKey", # required
2003
+ # value: { # required
2004
+ # },
2005
+ # },
2006
+ # in: {
2007
+ # key: "FilterKey", # required
2008
+ # value: { # required
2009
+ # },
2010
+ # },
2011
+ # less_than: {
2012
+ # key: "FilterKey", # required
2013
+ # value: { # required
2014
+ # },
2015
+ # },
2016
+ # less_than_or_equals: {
2017
+ # key: "FilterKey", # required
2018
+ # value: { # required
2019
+ # },
2020
+ # },
2021
+ # list_contains: {
2022
+ # key: "FilterKey", # required
2023
+ # value: { # required
2024
+ # },
2025
+ # },
2026
+ # not_equals: {
2027
+ # key: "FilterKey", # required
2028
+ # value: { # required
2029
+ # },
2030
+ # },
2031
+ # not_in: {
2032
+ # key: "FilterKey", # required
2033
+ # value: { # required
2034
+ # },
2035
+ # },
2036
+ # or_all: [
2037
+ # {
2038
+ # # recursive RetrievalFilter
2039
+ # },
2040
+ # ],
2041
+ # starts_with: {
2042
+ # key: "FilterKey", # required
2043
+ # value: { # required
2044
+ # },
2045
+ # },
2046
+ # string_contains: {
2047
+ # key: "FilterKey", # required
2048
+ # value: { # required
2049
+ # },
2050
+ # },
2051
+ # },
2052
+ # number_of_results: 1,
2053
+ # override_search_type: "HYBRID", # accepts HYBRID, SEMANTIC
2054
+ # },
2055
+ # },
2056
+ # },
2057
+ # ],
2058
+ # prompt_override_configuration: {
2059
+ # override_lambda: "LambdaResourceArn",
2060
+ # prompt_configurations: [ # required
2061
+ # {
2062
+ # base_prompt_template: "BasePromptTemplate",
2063
+ # inference_configuration: {
2064
+ # maximum_length: 1,
2065
+ # stop_sequences: ["String"],
2066
+ # temperature: 1.0,
2067
+ # top_k: 1,
2068
+ # top_p: 1.0,
2069
+ # },
2070
+ # parser_mode: "DEFAULT", # accepts DEFAULT, OVERRIDDEN
2071
+ # prompt_creation_mode: "DEFAULT", # accepts DEFAULT, OVERRIDDEN
2072
+ # prompt_state: "ENABLED", # accepts ENABLED, DISABLED
2073
+ # prompt_type: "PRE_PROCESSING", # accepts PRE_PROCESSING, ORCHESTRATION, KNOWLEDGE_BASE_RESPONSE_GENERATION, POST_PROCESSING, ROUTING_CLASSIFIER
2074
+ # },
2075
+ # ],
2076
+ # },
2077
+ # session_id: "SessionId", # required
2078
+ # })
2079
+ #
2080
+ # @example Response structure
2081
+ #
2082
+ # All events are available at resp.completion:
2083
+ # resp.completion #=> Enumerator
2084
+ # resp.completion.event_types #=> [:access_denied_exception, :bad_gateway_exception, :chunk, :conflict_exception, :dependency_failed_exception, :files, :internal_server_exception, :resource_not_found_exception, :return_control, :service_quota_exceeded_exception, :throttling_exception, :trace, :validation_exception]
2085
+ #
2086
+ # For :access_denied_exception event available at #on_access_denied_exception_event callback and response eventstream enumerator:
2087
+ # event.message #=> String
2088
+ #
2089
+ # For :bad_gateway_exception event available at #on_bad_gateway_exception_event callback and response eventstream enumerator:
2090
+ # event.message #=> String
2091
+ # event.resource_name #=> String
2092
+ #
2093
+ # For :chunk event available at #on_chunk_event callback and response eventstream enumerator:
2094
+ # event.attribution.citations #=> Array
2095
+ # event.attribution.citations[0].generated_response_part.text_response_part.span.end #=> Integer
2096
+ # event.attribution.citations[0].generated_response_part.text_response_part.span.start #=> Integer
2097
+ # event.attribution.citations[0].generated_response_part.text_response_part.text #=> String
2098
+ # event.attribution.citations[0].retrieved_references #=> Array
2099
+ # event.attribution.citations[0].retrieved_references[0].content.text #=> String
2100
+ # event.attribution.citations[0].retrieved_references[0].location.confluence_location.url #=> String
2101
+ # event.attribution.citations[0].retrieved_references[0].location.s3_location.uri #=> String
2102
+ # event.attribution.citations[0].retrieved_references[0].location.salesforce_location.url #=> String
2103
+ # event.attribution.citations[0].retrieved_references[0].location.share_point_location.url #=> String
2104
+ # event.attribution.citations[0].retrieved_references[0].location.type #=> String, one of "S3", "WEB", "CONFLUENCE", "SALESFORCE", "SHAREPOINT"
2105
+ # event.attribution.citations[0].retrieved_references[0].location.web_location.url #=> String
2106
+ # event.attribution.citations[0].retrieved_references[0].metadata #=> Hash
2107
+ # event.bytes #=> String
2108
+ #
2109
+ # For :conflict_exception event available at #on_conflict_exception_event callback and response eventstream enumerator:
2110
+ # event.message #=> String
2111
+ #
2112
+ # For :dependency_failed_exception event available at #on_dependency_failed_exception_event callback and response eventstream enumerator:
2113
+ # event.message #=> String
2114
+ # event.resource_name #=> String
2115
+ #
2116
+ # For :files event available at #on_files_event callback and response eventstream enumerator:
2117
+ # event.files #=> Array
2118
+ # event.files[0].bytes #=> String
2119
+ # event.files[0].name #=> String
2120
+ # event.files[0].type #=> String
2121
+ #
2122
+ # For :internal_server_exception event available at #on_internal_server_exception_event callback and response eventstream enumerator:
2123
+ # event.message #=> String
2124
+ #
2125
+ # For :resource_not_found_exception event available at #on_resource_not_found_exception_event callback and response eventstream enumerator:
2126
+ # event.message #=> String
2127
+ #
2128
+ # For :return_control event available at #on_return_control_event callback and response eventstream enumerator:
2129
+ # event.invocation_id #=> String
2130
+ # event.invocation_inputs #=> Array
2131
+ # event.invocation_inputs[0].api_invocation_input.action_group #=> String
2132
+ # event.invocation_inputs[0].api_invocation_input.action_invocation_type #=> String, one of "RESULT", "USER_CONFIRMATION", "USER_CONFIRMATION_AND_RESULT"
2133
+ # event.invocation_inputs[0].api_invocation_input.api_path #=> String
2134
+ # event.invocation_inputs[0].api_invocation_input.http_method #=> String
2135
+ # event.invocation_inputs[0].api_invocation_input.parameters #=> Array
2136
+ # event.invocation_inputs[0].api_invocation_input.parameters[0].name #=> String
2137
+ # event.invocation_inputs[0].api_invocation_input.parameters[0].type #=> String
2138
+ # event.invocation_inputs[0].api_invocation_input.parameters[0].value #=> String
2139
+ # event.invocation_inputs[0].api_invocation_input.request_body.content #=> Hash
2140
+ # event.invocation_inputs[0].api_invocation_input.request_body.content["String"].properties #=> Array
2141
+ # event.invocation_inputs[0].api_invocation_input.request_body.content["String"].properties[0].name #=> String
2142
+ # event.invocation_inputs[0].api_invocation_input.request_body.content["String"].properties[0].type #=> String
2143
+ # event.invocation_inputs[0].api_invocation_input.request_body.content["String"].properties[0].value #=> String
2144
+ # event.invocation_inputs[0].function_invocation_input.action_group #=> String
2145
+ # event.invocation_inputs[0].function_invocation_input.action_invocation_type #=> String, one of "RESULT", "USER_CONFIRMATION", "USER_CONFIRMATION_AND_RESULT"
2146
+ # event.invocation_inputs[0].function_invocation_input.function #=> String
2147
+ # event.invocation_inputs[0].function_invocation_input.parameters #=> Array
2148
+ # event.invocation_inputs[0].function_invocation_input.parameters[0].name #=> String
2149
+ # event.invocation_inputs[0].function_invocation_input.parameters[0].type #=> String
2150
+ # event.invocation_inputs[0].function_invocation_input.parameters[0].value #=> String
2151
+ #
2152
+ # For :service_quota_exceeded_exception event available at #on_service_quota_exceeded_exception_event callback and response eventstream enumerator:
2153
+ # event.message #=> String
2154
+ #
2155
+ # For :throttling_exception event available at #on_throttling_exception_event callback and response eventstream enumerator:
2156
+ # event.message #=> String
2157
+ #
2158
+ # For :trace event available at #on_trace_event callback and response eventstream enumerator:
2159
+ # event.session_id #=> String
2160
+ # event.trace.failure_trace.failure_reason #=> String
2161
+ # event.trace.failure_trace.trace_id #=> String
2162
+ # event.trace.guardrail_trace.action #=> String, one of "INTERVENED", "NONE"
2163
+ # event.trace.guardrail_trace.input_assessments #=> Array
2164
+ # event.trace.guardrail_trace.input_assessments[0].content_policy.filters #=> Array
2165
+ # event.trace.guardrail_trace.input_assessments[0].content_policy.filters[0].action #=> String, one of "BLOCKED"
2166
+ # event.trace.guardrail_trace.input_assessments[0].content_policy.filters[0].confidence #=> String, one of "NONE", "LOW", "MEDIUM", "HIGH"
2167
+ # event.trace.guardrail_trace.input_assessments[0].content_policy.filters[0].type #=> String, one of "INSULTS", "HATE", "SEXUAL", "VIOLENCE", "MISCONDUCT", "PROMPT_ATTACK"
2168
+ # event.trace.guardrail_trace.input_assessments[0].sensitive_information_policy.pii_entities #=> Array
2169
+ # event.trace.guardrail_trace.input_assessments[0].sensitive_information_policy.pii_entities[0].action #=> String, one of "BLOCKED", "ANONYMIZED"
2170
+ # event.trace.guardrail_trace.input_assessments[0].sensitive_information_policy.pii_entities[0].match #=> String
2171
+ # event.trace.guardrail_trace.input_assessments[0].sensitive_information_policy.pii_entities[0].type #=> String, one of "ADDRESS", "AGE", "AWS_ACCESS_KEY", "AWS_SECRET_KEY", "CA_HEALTH_NUMBER", "CA_SOCIAL_INSURANCE_NUMBER", "CREDIT_DEBIT_CARD_CVV", "CREDIT_DEBIT_CARD_EXPIRY", "CREDIT_DEBIT_CARD_NUMBER", "DRIVER_ID", "EMAIL", "INTERNATIONAL_BANK_ACCOUNT_NUMBER", "IP_ADDRESS", "LICENSE_PLATE", "MAC_ADDRESS", "NAME", "PASSWORD", "PHONE", "PIN", "SWIFT_CODE", "UK_NATIONAL_HEALTH_SERVICE_NUMBER", "UK_NATIONAL_INSURANCE_NUMBER", "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER", "URL", "USERNAME", "US_BANK_ACCOUNT_NUMBER", "US_BANK_ROUTING_NUMBER", "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER", "US_PASSPORT_NUMBER", "US_SOCIAL_SECURITY_NUMBER", "VEHICLE_IDENTIFICATION_NUMBER"
2172
+ # event.trace.guardrail_trace.input_assessments[0].sensitive_information_policy.regexes #=> Array
2173
+ # event.trace.guardrail_trace.input_assessments[0].sensitive_information_policy.regexes[0].action #=> String, one of "BLOCKED", "ANONYMIZED"
2174
+ # event.trace.guardrail_trace.input_assessments[0].sensitive_information_policy.regexes[0].match #=> String
2175
+ # event.trace.guardrail_trace.input_assessments[0].sensitive_information_policy.regexes[0].name #=> String
2176
+ # event.trace.guardrail_trace.input_assessments[0].sensitive_information_policy.regexes[0].regex #=> String
2177
+ # event.trace.guardrail_trace.input_assessments[0].topic_policy.topics #=> Array
2178
+ # event.trace.guardrail_trace.input_assessments[0].topic_policy.topics[0].action #=> String, one of "BLOCKED"
2179
+ # event.trace.guardrail_trace.input_assessments[0].topic_policy.topics[0].name #=> String
2180
+ # event.trace.guardrail_trace.input_assessments[0].topic_policy.topics[0].type #=> String, one of "DENY"
2181
+ # event.trace.guardrail_trace.input_assessments[0].word_policy.custom_words #=> Array
2182
+ # event.trace.guardrail_trace.input_assessments[0].word_policy.custom_words[0].action #=> String, one of "BLOCKED"
2183
+ # event.trace.guardrail_trace.input_assessments[0].word_policy.custom_words[0].match #=> String
2184
+ # event.trace.guardrail_trace.input_assessments[0].word_policy.managed_word_lists #=> Array
2185
+ # event.trace.guardrail_trace.input_assessments[0].word_policy.managed_word_lists[0].action #=> String, one of "BLOCKED"
2186
+ # event.trace.guardrail_trace.input_assessments[0].word_policy.managed_word_lists[0].match #=> String
2187
+ # event.trace.guardrail_trace.input_assessments[0].word_policy.managed_word_lists[0].type #=> String, one of "PROFANITY"
2188
+ # event.trace.guardrail_trace.output_assessments #=> Array
2189
+ # event.trace.guardrail_trace.output_assessments[0].content_policy.filters #=> Array
2190
+ # event.trace.guardrail_trace.output_assessments[0].content_policy.filters[0].action #=> String, one of "BLOCKED"
2191
+ # event.trace.guardrail_trace.output_assessments[0].content_policy.filters[0].confidence #=> String, one of "NONE", "LOW", "MEDIUM", "HIGH"
2192
+ # event.trace.guardrail_trace.output_assessments[0].content_policy.filters[0].type #=> String, one of "INSULTS", "HATE", "SEXUAL", "VIOLENCE", "MISCONDUCT", "PROMPT_ATTACK"
2193
+ # event.trace.guardrail_trace.output_assessments[0].sensitive_information_policy.pii_entities #=> Array
2194
+ # event.trace.guardrail_trace.output_assessments[0].sensitive_information_policy.pii_entities[0].action #=> String, one of "BLOCKED", "ANONYMIZED"
2195
+ # event.trace.guardrail_trace.output_assessments[0].sensitive_information_policy.pii_entities[0].match #=> String
2196
+ # event.trace.guardrail_trace.output_assessments[0].sensitive_information_policy.pii_entities[0].type #=> String, one of "ADDRESS", "AGE", "AWS_ACCESS_KEY", "AWS_SECRET_KEY", "CA_HEALTH_NUMBER", "CA_SOCIAL_INSURANCE_NUMBER", "CREDIT_DEBIT_CARD_CVV", "CREDIT_DEBIT_CARD_EXPIRY", "CREDIT_DEBIT_CARD_NUMBER", "DRIVER_ID", "EMAIL", "INTERNATIONAL_BANK_ACCOUNT_NUMBER", "IP_ADDRESS", "LICENSE_PLATE", "MAC_ADDRESS", "NAME", "PASSWORD", "PHONE", "PIN", "SWIFT_CODE", "UK_NATIONAL_HEALTH_SERVICE_NUMBER", "UK_NATIONAL_INSURANCE_NUMBER", "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER", "URL", "USERNAME", "US_BANK_ACCOUNT_NUMBER", "US_BANK_ROUTING_NUMBER", "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER", "US_PASSPORT_NUMBER", "US_SOCIAL_SECURITY_NUMBER", "VEHICLE_IDENTIFICATION_NUMBER"
2197
+ # event.trace.guardrail_trace.output_assessments[0].sensitive_information_policy.regexes #=> Array
2198
+ # event.trace.guardrail_trace.output_assessments[0].sensitive_information_policy.regexes[0].action #=> String, one of "BLOCKED", "ANONYMIZED"
2199
+ # event.trace.guardrail_trace.output_assessments[0].sensitive_information_policy.regexes[0].match #=> String
2200
+ # event.trace.guardrail_trace.output_assessments[0].sensitive_information_policy.regexes[0].name #=> String
2201
+ # event.trace.guardrail_trace.output_assessments[0].sensitive_information_policy.regexes[0].regex #=> String
2202
+ # event.trace.guardrail_trace.output_assessments[0].topic_policy.topics #=> Array
2203
+ # event.trace.guardrail_trace.output_assessments[0].topic_policy.topics[0].action #=> String, one of "BLOCKED"
2204
+ # event.trace.guardrail_trace.output_assessments[0].topic_policy.topics[0].name #=> String
2205
+ # event.trace.guardrail_trace.output_assessments[0].topic_policy.topics[0].type #=> String, one of "DENY"
2206
+ # event.trace.guardrail_trace.output_assessments[0].word_policy.custom_words #=> Array
2207
+ # event.trace.guardrail_trace.output_assessments[0].word_policy.custom_words[0].action #=> String, one of "BLOCKED"
2208
+ # event.trace.guardrail_trace.output_assessments[0].word_policy.custom_words[0].match #=> String
2209
+ # event.trace.guardrail_trace.output_assessments[0].word_policy.managed_word_lists #=> Array
2210
+ # event.trace.guardrail_trace.output_assessments[0].word_policy.managed_word_lists[0].action #=> String, one of "BLOCKED"
2211
+ # event.trace.guardrail_trace.output_assessments[0].word_policy.managed_word_lists[0].match #=> String
2212
+ # event.trace.guardrail_trace.output_assessments[0].word_policy.managed_word_lists[0].type #=> String, one of "PROFANITY"
2213
+ # event.trace.guardrail_trace.trace_id #=> String
2214
+ # event.trace.orchestration_trace.invocation_input.action_group_invocation_input.action_group_name #=> String
2215
+ # event.trace.orchestration_trace.invocation_input.action_group_invocation_input.api_path #=> String
2216
+ # event.trace.orchestration_trace.invocation_input.action_group_invocation_input.execution_type #=> String, one of "LAMBDA", "RETURN_CONTROL"
2217
+ # event.trace.orchestration_trace.invocation_input.action_group_invocation_input.function #=> String
2218
+ # event.trace.orchestration_trace.invocation_input.action_group_invocation_input.invocation_id #=> String
2219
+ # event.trace.orchestration_trace.invocation_input.action_group_invocation_input.parameters #=> Array
2220
+ # event.trace.orchestration_trace.invocation_input.action_group_invocation_input.parameters[0].name #=> String
2221
+ # event.trace.orchestration_trace.invocation_input.action_group_invocation_input.parameters[0].type #=> String
2222
+ # event.trace.orchestration_trace.invocation_input.action_group_invocation_input.parameters[0].value #=> String
2223
+ # event.trace.orchestration_trace.invocation_input.action_group_invocation_input.request_body.content #=> Hash
2224
+ # event.trace.orchestration_trace.invocation_input.action_group_invocation_input.request_body.content["String"] #=> Array
2225
+ # event.trace.orchestration_trace.invocation_input.action_group_invocation_input.request_body.content["String"][0].name #=> String
2226
+ # event.trace.orchestration_trace.invocation_input.action_group_invocation_input.request_body.content["String"][0].type #=> String
2227
+ # event.trace.orchestration_trace.invocation_input.action_group_invocation_input.request_body.content["String"][0].value #=> String
2228
+ # event.trace.orchestration_trace.invocation_input.action_group_invocation_input.verb #=> String
2229
+ # event.trace.orchestration_trace.invocation_input.code_interpreter_invocation_input.code #=> String
2230
+ # event.trace.orchestration_trace.invocation_input.code_interpreter_invocation_input.files #=> Array
2231
+ # event.trace.orchestration_trace.invocation_input.code_interpreter_invocation_input.files[0] #=> String
2232
+ # event.trace.orchestration_trace.invocation_input.invocation_type #=> String, one of "ACTION_GROUP", "KNOWLEDGE_BASE", "FINISH", "ACTION_GROUP_CODE_INTERPRETER"
2233
+ # event.trace.orchestration_trace.invocation_input.knowledge_base_lookup_input.knowledge_base_id #=> String
2234
+ # event.trace.orchestration_trace.invocation_input.knowledge_base_lookup_input.text #=> String
2235
+ # event.trace.orchestration_trace.invocation_input.trace_id #=> String
2236
+ # event.trace.orchestration_trace.model_invocation_input.inference_configuration.maximum_length #=> Integer
2237
+ # event.trace.orchestration_trace.model_invocation_input.inference_configuration.stop_sequences #=> Array
2238
+ # event.trace.orchestration_trace.model_invocation_input.inference_configuration.stop_sequences[0] #=> String
2239
+ # event.trace.orchestration_trace.model_invocation_input.inference_configuration.temperature #=> Float
2240
+ # event.trace.orchestration_trace.model_invocation_input.inference_configuration.top_k #=> Integer
2241
+ # event.trace.orchestration_trace.model_invocation_input.inference_configuration.top_p #=> Float
2242
+ # event.trace.orchestration_trace.model_invocation_input.override_lambda #=> String
2243
+ # event.trace.orchestration_trace.model_invocation_input.parser_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
2244
+ # event.trace.orchestration_trace.model_invocation_input.prompt_creation_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
2245
+ # event.trace.orchestration_trace.model_invocation_input.text #=> String
2246
+ # event.trace.orchestration_trace.model_invocation_input.trace_id #=> String
2247
+ # event.trace.orchestration_trace.model_invocation_input.type #=> String, one of "PRE_PROCESSING", "ORCHESTRATION", "KNOWLEDGE_BASE_RESPONSE_GENERATION", "POST_PROCESSING", "ROUTING_CLASSIFIER"
2248
+ # event.trace.orchestration_trace.model_invocation_output.metadata.usage.input_tokens #=> Integer
2249
+ # event.trace.orchestration_trace.model_invocation_output.metadata.usage.output_tokens #=> Integer
2250
+ # event.trace.orchestration_trace.model_invocation_output.raw_response.content #=> String
2251
+ # event.trace.orchestration_trace.model_invocation_output.trace_id #=> String
2252
+ # event.trace.orchestration_trace.observation.action_group_invocation_output.text #=> String
2253
+ # event.trace.orchestration_trace.observation.code_interpreter_invocation_output.execution_error #=> String
2254
+ # event.trace.orchestration_trace.observation.code_interpreter_invocation_output.execution_output #=> String
2255
+ # event.trace.orchestration_trace.observation.code_interpreter_invocation_output.execution_timeout #=> Boolean
2256
+ # event.trace.orchestration_trace.observation.code_interpreter_invocation_output.files #=> Array
2257
+ # event.trace.orchestration_trace.observation.code_interpreter_invocation_output.files[0] #=> String
2258
+ # event.trace.orchestration_trace.observation.final_response.text #=> String
2259
+ # event.trace.orchestration_trace.observation.knowledge_base_lookup_output.retrieved_references #=> Array
2260
+ # event.trace.orchestration_trace.observation.knowledge_base_lookup_output.retrieved_references[0].content.text #=> String
2261
+ # event.trace.orchestration_trace.observation.knowledge_base_lookup_output.retrieved_references[0].location.confluence_location.url #=> String
2262
+ # event.trace.orchestration_trace.observation.knowledge_base_lookup_output.retrieved_references[0].location.s3_location.uri #=> String
2263
+ # event.trace.orchestration_trace.observation.knowledge_base_lookup_output.retrieved_references[0].location.salesforce_location.url #=> String
2264
+ # event.trace.orchestration_trace.observation.knowledge_base_lookup_output.retrieved_references[0].location.share_point_location.url #=> String
2265
+ # event.trace.orchestration_trace.observation.knowledge_base_lookup_output.retrieved_references[0].location.type #=> String, one of "S3", "WEB", "CONFLUENCE", "SALESFORCE", "SHAREPOINT"
2266
+ # event.trace.orchestration_trace.observation.knowledge_base_lookup_output.retrieved_references[0].location.web_location.url #=> String
2267
+ # event.trace.orchestration_trace.observation.knowledge_base_lookup_output.retrieved_references[0].metadata #=> Hash
2268
+ # event.trace.orchestration_trace.observation.reprompt_response.source #=> String, one of "ACTION_GROUP", "KNOWLEDGE_BASE", "PARSER"
2269
+ # event.trace.orchestration_trace.observation.reprompt_response.text #=> String
2270
+ # event.trace.orchestration_trace.observation.trace_id #=> String
2271
+ # event.trace.orchestration_trace.observation.type #=> String, one of "ACTION_GROUP", "KNOWLEDGE_BASE", "FINISH", "ASK_USER", "REPROMPT"
2272
+ # event.trace.orchestration_trace.rationale.text #=> String
2273
+ # event.trace.orchestration_trace.rationale.trace_id #=> String
2274
+ # event.trace.post_processing_trace.model_invocation_input.inference_configuration.maximum_length #=> Integer
2275
+ # event.trace.post_processing_trace.model_invocation_input.inference_configuration.stop_sequences #=> Array
2276
+ # event.trace.post_processing_trace.model_invocation_input.inference_configuration.stop_sequences[0] #=> String
2277
+ # event.trace.post_processing_trace.model_invocation_input.inference_configuration.temperature #=> Float
2278
+ # event.trace.post_processing_trace.model_invocation_input.inference_configuration.top_k #=> Integer
2279
+ # event.trace.post_processing_trace.model_invocation_input.inference_configuration.top_p #=> Float
2280
+ # event.trace.post_processing_trace.model_invocation_input.override_lambda #=> String
2281
+ # event.trace.post_processing_trace.model_invocation_input.parser_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
2282
+ # event.trace.post_processing_trace.model_invocation_input.prompt_creation_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
2283
+ # event.trace.post_processing_trace.model_invocation_input.text #=> String
2284
+ # event.trace.post_processing_trace.model_invocation_input.trace_id #=> String
2285
+ # event.trace.post_processing_trace.model_invocation_input.type #=> String, one of "PRE_PROCESSING", "ORCHESTRATION", "KNOWLEDGE_BASE_RESPONSE_GENERATION", "POST_PROCESSING", "ROUTING_CLASSIFIER"
2286
+ # event.trace.post_processing_trace.model_invocation_output.metadata.usage.input_tokens #=> Integer
2287
+ # event.trace.post_processing_trace.model_invocation_output.metadata.usage.output_tokens #=> Integer
2288
+ # event.trace.post_processing_trace.model_invocation_output.parsed_response.text #=> String
2289
+ # event.trace.post_processing_trace.model_invocation_output.raw_response.content #=> String
2290
+ # event.trace.post_processing_trace.model_invocation_output.trace_id #=> String
2291
+ # event.trace.pre_processing_trace.model_invocation_input.inference_configuration.maximum_length #=> Integer
2292
+ # event.trace.pre_processing_trace.model_invocation_input.inference_configuration.stop_sequences #=> Array
2293
+ # event.trace.pre_processing_trace.model_invocation_input.inference_configuration.stop_sequences[0] #=> String
2294
+ # event.trace.pre_processing_trace.model_invocation_input.inference_configuration.temperature #=> Float
2295
+ # event.trace.pre_processing_trace.model_invocation_input.inference_configuration.top_k #=> Integer
2296
+ # event.trace.pre_processing_trace.model_invocation_input.inference_configuration.top_p #=> Float
2297
+ # event.trace.pre_processing_trace.model_invocation_input.override_lambda #=> String
2298
+ # event.trace.pre_processing_trace.model_invocation_input.parser_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
2299
+ # event.trace.pre_processing_trace.model_invocation_input.prompt_creation_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
2300
+ # event.trace.pre_processing_trace.model_invocation_input.text #=> String
2301
+ # event.trace.pre_processing_trace.model_invocation_input.trace_id #=> String
2302
+ # event.trace.pre_processing_trace.model_invocation_input.type #=> String, one of "PRE_PROCESSING", "ORCHESTRATION", "KNOWLEDGE_BASE_RESPONSE_GENERATION", "POST_PROCESSING", "ROUTING_CLASSIFIER"
2303
+ # event.trace.pre_processing_trace.model_invocation_output.metadata.usage.input_tokens #=> Integer
2304
+ # event.trace.pre_processing_trace.model_invocation_output.metadata.usage.output_tokens #=> Integer
2305
+ # event.trace.pre_processing_trace.model_invocation_output.parsed_response.is_valid #=> Boolean
2306
+ # event.trace.pre_processing_trace.model_invocation_output.parsed_response.rationale #=> String
2307
+ # event.trace.pre_processing_trace.model_invocation_output.raw_response.content #=> String
2308
+ # event.trace.pre_processing_trace.model_invocation_output.trace_id #=> String
2309
+ #
2310
+ # For :validation_exception event available at #on_validation_exception_event callback and response eventstream enumerator:
2311
+ # event.message #=> String
2312
+ #
2313
+ # resp.content_type #=> String
2314
+ # resp.session_id #=> String
2315
+ #
2316
+ # @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/InvokeInlineAgent AWS API Documentation
2317
+ #
2318
+ # @overload invoke_inline_agent(params = {})
2319
+ # @param [Hash] params ({})
2320
+ def invoke_inline_agent(params = {}, options = {}, &block)
2321
+ params = params.dup
2322
+ event_stream_handler = case handler = params.delete(:event_stream_handler)
2323
+ when EventStreams::InlineAgentResponseStream then handler
2324
+ when Proc then EventStreams::InlineAgentResponseStream.new.tap(&handler)
2325
+ when nil then EventStreams::InlineAgentResponseStream.new
2326
+ else
2327
+ msg = "expected :event_stream_handler to be a block or "\
2328
+ "instance of Aws::BedrockAgentRuntime::EventStreams::InlineAgentResponseStream"\
2329
+ ", got `#{handler.inspect}` instead"
2330
+ raise ArgumentError, msg
2331
+ end
2332
+
2333
+ yield(event_stream_handler) if block_given?
2334
+
2335
+ req = build_request(:invoke_inline_agent, params)
2336
+
2337
+ req.context[:event_stream_handler] = event_stream_handler
2338
+ req.handlers.add(Aws::Binary::DecodeHandler, priority: 95)
2339
+
2340
+ req.send_request(options, &block)
2341
+ end
2342
+
1570
2343
  # Optimizes a prompt for the task that you specify. For more
1571
2344
  # information, see [Optimize a prompt][1] in the [Amazon Bedrock User
1572
2345
  # Guide][2].
@@ -2191,7 +2964,7 @@ module Aws::BedrockAgentRuntime
2191
2964
  tracer: tracer
2192
2965
  )
2193
2966
  context[:gem_name] = 'aws-sdk-bedrockagentruntime'
2194
- context[:gem_version] = '1.32.0'
2967
+ context[:gem_version] = '1.33.0'
2195
2968
  Seahorse::Client::Request.new(handlers, context)
2196
2969
  end
2197
2970