aws-sdk-bedrockagentruntime 1.32.0 → 1.33.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-bedrockagentruntime/client.rb +777 -4
- data/lib/aws-sdk-bedrockagentruntime/client_api.rb +197 -0
- data/lib/aws-sdk-bedrockagentruntime/event_streams.rb +94 -0
- data/lib/aws-sdk-bedrockagentruntime/types.rb +744 -0
- data/lib/aws-sdk-bedrockagentruntime.rb +1 -1
- data/sig/client.rbs +194 -0
- data/sig/types.rbs +164 -1
- metadata +2 -2
@@ -10,6 +10,43 @@
|
|
10
10
|
module Aws::BedrockAgentRuntime
|
11
11
|
module Types
|
12
12
|
|
13
|
+
# Contains details about the OpenAPI schema for the action group. For
|
14
|
+
# more information, see [Action group OpenAPI schemas][1]. You can
|
15
|
+
# either include the schema directly in the payload field or you can
|
16
|
+
# upload it to an S3 bucket and specify the S3 bucket location in the s3
|
17
|
+
# field.
|
18
|
+
#
|
19
|
+
#
|
20
|
+
#
|
21
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html
|
22
|
+
#
|
23
|
+
# @note APISchema is a union - when making an API calls you must set exactly one of the members.
|
24
|
+
#
|
25
|
+
# @!attribute [rw] payload
|
26
|
+
# The JSON or YAML-formatted payload defining the OpenAPI schema for
|
27
|
+
# the action group.
|
28
|
+
# @return [String]
|
29
|
+
#
|
30
|
+
# @!attribute [rw] s3
|
31
|
+
# Contains details about the S3 object containing the OpenAPI schema
|
32
|
+
# for the action group.
|
33
|
+
# @return [Types::S3Identifier]
|
34
|
+
#
|
35
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/APISchema AWS API Documentation
|
36
|
+
#
|
37
|
+
class APISchema < Struct.new(
|
38
|
+
:payload,
|
39
|
+
:s3,
|
40
|
+
:unknown)
|
41
|
+
SENSITIVE = [:payload]
|
42
|
+
include Aws::Structure
|
43
|
+
include Aws::Structure::Union
|
44
|
+
|
45
|
+
class Payload < APISchema; end
|
46
|
+
class S3 < APISchema; end
|
47
|
+
class Unknown < APISchema; end
|
48
|
+
end
|
49
|
+
|
13
50
|
# The request is denied because of missing access permissions. Check
|
14
51
|
# your permissions and retry your request.
|
15
52
|
#
|
@@ -25,6 +62,37 @@ module Aws::BedrockAgentRuntime
|
|
25
62
|
include Aws::Structure
|
26
63
|
end
|
27
64
|
|
65
|
+
# Contains details about the Lambda function containing the business
|
66
|
+
# logic that is carried out upon invoking the action or the custom
|
67
|
+
# control method for handling the information elicited from the user.
|
68
|
+
#
|
69
|
+
# @note ActionGroupExecutor is a union - when making an API calls you must set exactly one of the members.
|
70
|
+
#
|
71
|
+
# @!attribute [rw] custom_control
|
72
|
+
# To return the action group invocation results directly in the
|
73
|
+
# `InvokeInlineAgent` response, specify `RETURN_CONTROL`.
|
74
|
+
# @return [String]
|
75
|
+
#
|
76
|
+
# @!attribute [rw] lambda
|
77
|
+
# The Amazon Resource Name (ARN) of the Lambda function containing the
|
78
|
+
# business logic that is carried out upon invoking the action.
|
79
|
+
# @return [String]
|
80
|
+
#
|
81
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/ActionGroupExecutor AWS API Documentation
|
82
|
+
#
|
83
|
+
class ActionGroupExecutor < Struct.new(
|
84
|
+
:custom_control,
|
85
|
+
:lambda,
|
86
|
+
:unknown)
|
87
|
+
SENSITIVE = []
|
88
|
+
include Aws::Structure
|
89
|
+
include Aws::Structure::Union
|
90
|
+
|
91
|
+
class CustomControl < ActionGroupExecutor; end
|
92
|
+
class Lambda < ActionGroupExecutor; end
|
93
|
+
class Unknown < ActionGroupExecutor; end
|
94
|
+
end
|
95
|
+
|
28
96
|
# Contains information about the action group being invoked. For more
|
29
97
|
# information about the possible structures, see the InvocationInput tab
|
30
98
|
# in [OrchestrationTrace][1] in the [Amazon Bedrock User Guide][2].
|
@@ -103,6 +171,75 @@ module Aws::BedrockAgentRuntime
|
|
103
171
|
include Aws::Structure
|
104
172
|
end
|
105
173
|
|
174
|
+
# Contains details of the inline agent's action group.
|
175
|
+
#
|
176
|
+
# @!attribute [rw] action_group_executor
|
177
|
+
# The Amazon Resource Name (ARN) of the Lambda function containing the
|
178
|
+
# business logic that is carried out upon invoking the action or the
|
179
|
+
# custom control method for handling the information elicited from the
|
180
|
+
# user.
|
181
|
+
# @return [Types::ActionGroupExecutor]
|
182
|
+
#
|
183
|
+
# @!attribute [rw] action_group_name
|
184
|
+
# The name of the action group.
|
185
|
+
# @return [String]
|
186
|
+
#
|
187
|
+
# @!attribute [rw] api_schema
|
188
|
+
# Contains either details about the S3 object containing the OpenAPI
|
189
|
+
# schema for the action group or the JSON or YAML-formatted payload
|
190
|
+
# defining the schema. For more information, see [Action group OpenAPI
|
191
|
+
# schemas][1].
|
192
|
+
#
|
193
|
+
#
|
194
|
+
#
|
195
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html
|
196
|
+
# @return [Types::APISchema]
|
197
|
+
#
|
198
|
+
# @!attribute [rw] description
|
199
|
+
# A description of the action group.
|
200
|
+
# @return [String]
|
201
|
+
#
|
202
|
+
# @!attribute [rw] function_schema
|
203
|
+
# Contains details about the function schema for the action group or
|
204
|
+
# the JSON or YAML-formatted payload defining the schema.
|
205
|
+
# @return [Types::FunctionSchema]
|
206
|
+
#
|
207
|
+
# @!attribute [rw] parent_action_group_signature
|
208
|
+
# To allow your agent to request the user for additional information
|
209
|
+
# when trying to complete a task, set this field to
|
210
|
+
# `AMAZON.UserInput`. You must leave the `description`, `apiSchema`,
|
211
|
+
# and `actionGroupExecutor` fields blank for this action group.
|
212
|
+
#
|
213
|
+
# To allow your agent to generate, run, and troubleshoot code when
|
214
|
+
# trying to complete a task, set this field to
|
215
|
+
# `AMAZON.CodeInterpreter`. You must leave the `description`,
|
216
|
+
# `apiSchema`, and `actionGroupExecutor` fields blank for this action
|
217
|
+
# group.
|
218
|
+
#
|
219
|
+
# During orchestration, if your agent determines that it needs to
|
220
|
+
# invoke an API in an action group, but doesn't have enough
|
221
|
+
# information to complete the API request, it will invoke this action
|
222
|
+
# group instead and return an [Observation][1] reprompting the user
|
223
|
+
# for more information.
|
224
|
+
#
|
225
|
+
#
|
226
|
+
#
|
227
|
+
# [1]: https://docs.aws.amazon.com/https:/docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Observation.html
|
228
|
+
# @return [String]
|
229
|
+
#
|
230
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/AgentActionGroup AWS API Documentation
|
231
|
+
#
|
232
|
+
class AgentActionGroup < Struct.new(
|
233
|
+
:action_group_executor,
|
234
|
+
:action_group_name,
|
235
|
+
:api_schema,
|
236
|
+
:description,
|
237
|
+
:function_schema,
|
238
|
+
:parent_action_group_signature)
|
239
|
+
SENSITIVE = [:action_group_name, :description]
|
240
|
+
include Aws::Structure
|
241
|
+
end
|
242
|
+
|
106
243
|
# An event in which the prompt was analyzed in preparation for
|
107
244
|
# optimization.
|
108
245
|
#
|
@@ -1127,6 +1264,38 @@ module Aws::BedrockAgentRuntime
|
|
1127
1264
|
include Aws::Structure
|
1128
1265
|
end
|
1129
1266
|
|
1267
|
+
# Defines parameters that the agent needs to invoke from the user to
|
1268
|
+
# complete the function. Corresponds to an action in an action group.
|
1269
|
+
#
|
1270
|
+
# @!attribute [rw] description
|
1271
|
+
# A description of the function and its purpose.
|
1272
|
+
# @return [String]
|
1273
|
+
#
|
1274
|
+
# @!attribute [rw] name
|
1275
|
+
# A name for the function.
|
1276
|
+
# @return [String]
|
1277
|
+
#
|
1278
|
+
# @!attribute [rw] parameters
|
1279
|
+
# The parameters that the agent elicits from the user to fulfill the
|
1280
|
+
# function.
|
1281
|
+
# @return [Hash<String,Types::ParameterDetail>]
|
1282
|
+
#
|
1283
|
+
# @!attribute [rw] require_confirmation
|
1284
|
+
# Contains information if user confirmation is required to invoke the
|
1285
|
+
# function.
|
1286
|
+
# @return [String]
|
1287
|
+
#
|
1288
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/FunctionDefinition AWS API Documentation
|
1289
|
+
#
|
1290
|
+
class FunctionDefinition < Struct.new(
|
1291
|
+
:description,
|
1292
|
+
:name,
|
1293
|
+
:parameters,
|
1294
|
+
:require_confirmation)
|
1295
|
+
SENSITIVE = [:name]
|
1296
|
+
include Aws::Structure
|
1297
|
+
end
|
1298
|
+
|
1130
1299
|
# Contains information about the function that the agent predicts should
|
1131
1300
|
# be called.
|
1132
1301
|
#
|
@@ -1255,6 +1424,28 @@ module Aws::BedrockAgentRuntime
|
|
1255
1424
|
include Aws::Structure
|
1256
1425
|
end
|
1257
1426
|
|
1427
|
+
# Contains details about the function schema for the action group or the
|
1428
|
+
# JSON or YAML-formatted payload defining the schema.
|
1429
|
+
#
|
1430
|
+
# @note FunctionSchema is a union - when making an API calls you must set exactly one of the members.
|
1431
|
+
#
|
1432
|
+
# @!attribute [rw] functions
|
1433
|
+
# A list of functions that each define an action in the action group.
|
1434
|
+
# @return [Array<Types::FunctionDefinition>]
|
1435
|
+
#
|
1436
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/FunctionSchema AWS API Documentation
|
1437
|
+
#
|
1438
|
+
class FunctionSchema < Struct.new(
|
1439
|
+
:functions,
|
1440
|
+
:unknown)
|
1441
|
+
SENSITIVE = []
|
1442
|
+
include Aws::Structure
|
1443
|
+
include Aws::Structure::Union
|
1444
|
+
|
1445
|
+
class Functions < FunctionSchema; end
|
1446
|
+
class Unknown < FunctionSchema; end
|
1447
|
+
end
|
1448
|
+
|
1258
1449
|
# Contains metadata about a part of the generated response that is
|
1259
1450
|
# accompanied by a citation.
|
1260
1451
|
#
|
@@ -1444,6 +1635,25 @@ module Aws::BedrockAgentRuntime
|
|
1444
1635
|
include Aws::Structure
|
1445
1636
|
end
|
1446
1637
|
|
1638
|
+
# The configuration details for the guardrail.
|
1639
|
+
#
|
1640
|
+
# @!attribute [rw] guardrail_identifier
|
1641
|
+
# The unique identifier for the guardrail.
|
1642
|
+
# @return [String]
|
1643
|
+
#
|
1644
|
+
# @!attribute [rw] guardrail_version
|
1645
|
+
# The version of the guardrail.
|
1646
|
+
# @return [String]
|
1647
|
+
#
|
1648
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/GuardrailConfigurationWithArn AWS API Documentation
|
1649
|
+
#
|
1650
|
+
class GuardrailConfigurationWithArn < Struct.new(
|
1651
|
+
:guardrail_identifier,
|
1652
|
+
:guardrail_version)
|
1653
|
+
SENSITIVE = []
|
1654
|
+
include Aws::Structure
|
1655
|
+
end
|
1656
|
+
|
1447
1657
|
# Details of the content filter used in the Guardrail.
|
1448
1658
|
#
|
1449
1659
|
# @!attribute [rw] action
|
@@ -1762,6 +1972,173 @@ module Aws::BedrockAgentRuntime
|
|
1762
1972
|
include Aws::Structure
|
1763
1973
|
end
|
1764
1974
|
|
1975
|
+
# Contains intermediate response for code interpreter if any files have
|
1976
|
+
# been generated.
|
1977
|
+
#
|
1978
|
+
# @!attribute [rw] files
|
1979
|
+
# Files containing intermediate response for the user.
|
1980
|
+
# @return [Array<Types::OutputFile>]
|
1981
|
+
#
|
1982
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/InlineAgentFilePart AWS API Documentation
|
1983
|
+
#
|
1984
|
+
class InlineAgentFilePart < Struct.new(
|
1985
|
+
:files,
|
1986
|
+
:event_type)
|
1987
|
+
SENSITIVE = [:files]
|
1988
|
+
include Aws::Structure
|
1989
|
+
end
|
1990
|
+
|
1991
|
+
# Contains a part of an agent response and citations for it.
|
1992
|
+
#
|
1993
|
+
# @!attribute [rw] attribution
|
1994
|
+
# Contains citations for a part of an agent response.
|
1995
|
+
# @return [Types::Attribution]
|
1996
|
+
#
|
1997
|
+
# @!attribute [rw] bytes
|
1998
|
+
# A part of the agent response in bytes.
|
1999
|
+
# @return [String]
|
2000
|
+
#
|
2001
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/InlineAgentPayloadPart AWS API Documentation
|
2002
|
+
#
|
2003
|
+
class InlineAgentPayloadPart < Struct.new(
|
2004
|
+
:attribution,
|
2005
|
+
:bytes,
|
2006
|
+
:event_type)
|
2007
|
+
SENSITIVE = [:bytes]
|
2008
|
+
include Aws::Structure
|
2009
|
+
end
|
2010
|
+
|
2011
|
+
# Contains information to return from the action group that the agent
|
2012
|
+
# has predicted to invoke.
|
2013
|
+
#
|
2014
|
+
# This data type is used in the [InvokeAgent response][1] API operation.
|
2015
|
+
#
|
2016
|
+
#
|
2017
|
+
#
|
2018
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax
|
2019
|
+
#
|
2020
|
+
# @!attribute [rw] invocation_id
|
2021
|
+
# The identifier of the action group invocation.
|
2022
|
+
# @return [String]
|
2023
|
+
#
|
2024
|
+
# @!attribute [rw] invocation_inputs
|
2025
|
+
# A list of objects that contain information about the parameters and
|
2026
|
+
# inputs that need to be sent into the API operation or function,
|
2027
|
+
# based on what the agent determines from its session with the user.
|
2028
|
+
# @return [Array<Types::InvocationInputMember>]
|
2029
|
+
#
|
2030
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/InlineAgentReturnControlPayload AWS API Documentation
|
2031
|
+
#
|
2032
|
+
class InlineAgentReturnControlPayload < Struct.new(
|
2033
|
+
:invocation_id,
|
2034
|
+
:invocation_inputs,
|
2035
|
+
:event_type)
|
2036
|
+
SENSITIVE = []
|
2037
|
+
include Aws::Structure
|
2038
|
+
end
|
2039
|
+
|
2040
|
+
# Contains information about the agent and session, alongside the
|
2041
|
+
# agent's reasoning process and results from calling API actions and
|
2042
|
+
# querying knowledge bases and metadata about the trace. You can use the
|
2043
|
+
# trace to understand how the agent arrived at the response it provided
|
2044
|
+
# the customer. For more information, see [Trace enablement][1].
|
2045
|
+
#
|
2046
|
+
#
|
2047
|
+
#
|
2048
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-enablement
|
2049
|
+
#
|
2050
|
+
# @!attribute [rw] session_id
|
2051
|
+
# The unique identifier of the session with the agent.
|
2052
|
+
# @return [String]
|
2053
|
+
#
|
2054
|
+
# @!attribute [rw] trace
|
2055
|
+
# Contains one part of the agent's reasoning process and results from
|
2056
|
+
# calling API actions and querying knowledge bases. You can use the
|
2057
|
+
# trace to understand how the agent arrived at the response it
|
2058
|
+
# provided the customer. For more information, see [Trace
|
2059
|
+
# enablement][1].
|
2060
|
+
#
|
2061
|
+
#
|
2062
|
+
#
|
2063
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-enablement
|
2064
|
+
# @return [Types::Trace]
|
2065
|
+
#
|
2066
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/InlineAgentTracePart AWS API Documentation
|
2067
|
+
#
|
2068
|
+
class InlineAgentTracePart < Struct.new(
|
2069
|
+
:session_id,
|
2070
|
+
:trace,
|
2071
|
+
:event_type)
|
2072
|
+
SENSITIVE = [:trace]
|
2073
|
+
include Aws::Structure
|
2074
|
+
end
|
2075
|
+
|
2076
|
+
# Contains parameters that specify various attributes that persist
|
2077
|
+
# across a session or prompt. You can define session state attributes as
|
2078
|
+
# key-value pairs when writing a [Lambda function][1] for an action
|
2079
|
+
# group or pass them when making an `InvokeInlineAgent` request. Use
|
2080
|
+
# session state attributes to control and provide conversational context
|
2081
|
+
# for your inline agent and to help customize your agent's behavior.
|
2082
|
+
# For more information, see [Control session context][2]
|
2083
|
+
#
|
2084
|
+
#
|
2085
|
+
#
|
2086
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html
|
2087
|
+
# [2]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html
|
2088
|
+
#
|
2089
|
+
# @!attribute [rw] files
|
2090
|
+
# Contains information about the files used by code interpreter.
|
2091
|
+
# @return [Array<Types::InputFile>]
|
2092
|
+
#
|
2093
|
+
# @!attribute [rw] invocation_id
|
2094
|
+
# The identifier of the invocation of an action. This value must match
|
2095
|
+
# the `invocationId` returned in the `InvokeInlineAgent` response for
|
2096
|
+
# the action whose results are provided in the
|
2097
|
+
# `returnControlInvocationResults` field. For more information, see
|
2098
|
+
# [Return control to the agent developer][1].
|
2099
|
+
#
|
2100
|
+
#
|
2101
|
+
#
|
2102
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html
|
2103
|
+
# @return [String]
|
2104
|
+
#
|
2105
|
+
# @!attribute [rw] prompt_session_attributes
|
2106
|
+
# Contains attributes that persist across a session and the values of
|
2107
|
+
# those attributes.
|
2108
|
+
# @return [Hash<String,String>]
|
2109
|
+
#
|
2110
|
+
# @!attribute [rw] return_control_invocation_results
|
2111
|
+
# Contains information about the results from the action group
|
2112
|
+
# invocation. For more information, see [Return control to the agent
|
2113
|
+
# developer][1].
|
2114
|
+
#
|
2115
|
+
# <note markdown="1"> If you include this field in the `sessionState` field, the
|
2116
|
+
# `inputText` field will be ignored.
|
2117
|
+
#
|
2118
|
+
# </note>
|
2119
|
+
#
|
2120
|
+
#
|
2121
|
+
#
|
2122
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html
|
2123
|
+
# @return [Array<Types::InvocationResultMember>]
|
2124
|
+
#
|
2125
|
+
# @!attribute [rw] session_attributes
|
2126
|
+
# Contains attributes that persist across a session and the values of
|
2127
|
+
# those attributes.
|
2128
|
+
# @return [Hash<String,String>]
|
2129
|
+
#
|
2130
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/InlineSessionState AWS API Documentation
|
2131
|
+
#
|
2132
|
+
class InlineSessionState < Struct.new(
|
2133
|
+
:files,
|
2134
|
+
:invocation_id,
|
2135
|
+
:prompt_session_attributes,
|
2136
|
+
:return_control_invocation_results,
|
2137
|
+
:session_attributes)
|
2138
|
+
SENSITIVE = []
|
2139
|
+
include Aws::Structure
|
2140
|
+
end
|
2141
|
+
|
1765
2142
|
# Contains details of the source files.
|
1766
2143
|
#
|
1767
2144
|
# @!attribute [rw] name
|
@@ -2083,6 +2460,176 @@ module Aws::BedrockAgentRuntime
|
|
2083
2460
|
include Aws::Structure
|
2084
2461
|
end
|
2085
2462
|
|
2463
|
+
# @!attribute [rw] action_groups
|
2464
|
+
# A list of action groups with each action group defining the action
|
2465
|
+
# the inline agent needs to carry out.
|
2466
|
+
# @return [Array<Types::AgentActionGroup>]
|
2467
|
+
#
|
2468
|
+
# @!attribute [rw] customer_encryption_key_arn
|
2469
|
+
# The Amazon Resource Name (ARN) of the Amazon Web Services KMS key to
|
2470
|
+
# use to encrypt your inline agent.
|
2471
|
+
# @return [String]
|
2472
|
+
#
|
2473
|
+
# @!attribute [rw] enable_trace
|
2474
|
+
# Specifies whether to turn on the trace or not to track the agent's
|
2475
|
+
# reasoning process. For more information, see [Using trace][1].
|
2476
|
+
# </p>
|
2477
|
+
#
|
2478
|
+
#
|
2479
|
+
#
|
2480
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/trace-events.html
|
2481
|
+
# @return [Boolean]
|
2482
|
+
#
|
2483
|
+
# @!attribute [rw] end_session
|
2484
|
+
# Specifies whether to end the session with the inline agent or not.
|
2485
|
+
# @return [Boolean]
|
2486
|
+
#
|
2487
|
+
# @!attribute [rw] foundation_model
|
2488
|
+
# The [model identifier (ID)][1] of the model to use for orchestration
|
2489
|
+
# by the inline agent. For example, `meta.llama3-1-70b-instruct-v1:0`.
|
2490
|
+
#
|
2491
|
+
#
|
2492
|
+
#
|
2493
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns
|
2494
|
+
# @return [String]
|
2495
|
+
#
|
2496
|
+
# @!attribute [rw] guardrail_configuration
|
2497
|
+
# The [guardrails][1] to assign to the inline agent.
|
2498
|
+
#
|
2499
|
+
#
|
2500
|
+
#
|
2501
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html
|
2502
|
+
# @return [Types::GuardrailConfigurationWithArn]
|
2503
|
+
#
|
2504
|
+
# @!attribute [rw] idle_session_ttl_in_seconds
|
2505
|
+
# The number of seconds for which the inline agent should maintain
|
2506
|
+
# session information. After this time expires, the subsequent
|
2507
|
+
# `InvokeInlineAgent` request begins a new session.
|
2508
|
+
#
|
2509
|
+
# A user interaction remains active for the amount of time specified.
|
2510
|
+
# If no conversation occurs during this time, the session expires and
|
2511
|
+
# the data provided before the timeout is deleted.
|
2512
|
+
# @return [Integer]
|
2513
|
+
#
|
2514
|
+
# @!attribute [rw] inline_session_state
|
2515
|
+
# Parameters that specify the various attributes of a sessions. You
|
2516
|
+
# can include attributes for the session or prompt or, if you
|
2517
|
+
# configured an action group to return control, results from
|
2518
|
+
# invocation of the action group. For more information, see [Control
|
2519
|
+
# session context][1].
|
2520
|
+
#
|
2521
|
+
# <note markdown="1"> If you include `returnControlInvocationResults` in the
|
2522
|
+
# `sessionState` field, the `inputText` field will be ignored.
|
2523
|
+
#
|
2524
|
+
# </note>
|
2525
|
+
#
|
2526
|
+
#
|
2527
|
+
#
|
2528
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html
|
2529
|
+
# @return [Types::InlineSessionState]
|
2530
|
+
#
|
2531
|
+
# @!attribute [rw] input_text
|
2532
|
+
# The prompt text to send to the agent.
|
2533
|
+
#
|
2534
|
+
# <note markdown="1"> If you include `returnControlInvocationResults` in the
|
2535
|
+
# `sessionState` field, the `inputText` field will be ignored.
|
2536
|
+
#
|
2537
|
+
# </note>
|
2538
|
+
# @return [String]
|
2539
|
+
#
|
2540
|
+
# @!attribute [rw] instruction
|
2541
|
+
# The instructions that tell the inline agent what it should do and
|
2542
|
+
# how it should interact with users.
|
2543
|
+
# @return [String]
|
2544
|
+
#
|
2545
|
+
# @!attribute [rw] knowledge_bases
|
2546
|
+
# Contains information of the knowledge bases to associate with.
|
2547
|
+
# @return [Array<Types::KnowledgeBase>]
|
2548
|
+
#
|
2549
|
+
# @!attribute [rw] prompt_override_configuration
|
2550
|
+
# Configurations for advanced prompts used to override the default
|
2551
|
+
# prompts to enhance the accuracy of the inline agent.
|
2552
|
+
# @return [Types::PromptOverrideConfiguration]
|
2553
|
+
#
|
2554
|
+
# @!attribute [rw] session_id
|
2555
|
+
# The unique identifier of the session. Use the same value across
|
2556
|
+
# requests to continue the same conversation.
|
2557
|
+
# @return [String]
|
2558
|
+
#
|
2559
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/InvokeInlineAgentRequest AWS API Documentation
|
2560
|
+
#
|
2561
|
+
class InvokeInlineAgentRequest < Struct.new(
|
2562
|
+
:action_groups,
|
2563
|
+
:customer_encryption_key_arn,
|
2564
|
+
:enable_trace,
|
2565
|
+
:end_session,
|
2566
|
+
:foundation_model,
|
2567
|
+
:guardrail_configuration,
|
2568
|
+
:idle_session_ttl_in_seconds,
|
2569
|
+
:inline_session_state,
|
2570
|
+
:input_text,
|
2571
|
+
:instruction,
|
2572
|
+
:knowledge_bases,
|
2573
|
+
:prompt_override_configuration,
|
2574
|
+
:session_id)
|
2575
|
+
SENSITIVE = [:input_text, :instruction, :prompt_override_configuration]
|
2576
|
+
include Aws::Structure
|
2577
|
+
end
|
2578
|
+
|
2579
|
+
# @!attribute [rw] completion
|
2580
|
+
# </p>
|
2581
|
+
# @return [Types::InlineAgentResponseStream]
|
2582
|
+
#
|
2583
|
+
# @!attribute [rw] content_type
|
2584
|
+
# The MIME type of the input data in the request. The default value is
|
2585
|
+
# application/json.
|
2586
|
+
# @return [String]
|
2587
|
+
#
|
2588
|
+
# @!attribute [rw] session_id
|
2589
|
+
# The unique identifier of the session with the agent.
|
2590
|
+
# @return [String]
|
2591
|
+
#
|
2592
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/InvokeInlineAgentResponse AWS API Documentation
|
2593
|
+
#
|
2594
|
+
class InvokeInlineAgentResponse < Struct.new(
|
2595
|
+
:completion,
|
2596
|
+
:content_type,
|
2597
|
+
:session_id)
|
2598
|
+
SENSITIVE = []
|
2599
|
+
include Aws::Structure
|
2600
|
+
end
|
2601
|
+
|
2602
|
+
# Details of the knowledge base associated withe inline agent.
|
2603
|
+
#
|
2604
|
+
# @!attribute [rw] description
|
2605
|
+
# The description of the knowledge base associated with the inline
|
2606
|
+
# agent.
|
2607
|
+
# @return [String]
|
2608
|
+
#
|
2609
|
+
# @!attribute [rw] knowledge_base_id
|
2610
|
+
# The unique identifier for a knowledge base associated with the
|
2611
|
+
# inline agent.
|
2612
|
+
# @return [String]
|
2613
|
+
#
|
2614
|
+
# @!attribute [rw] retrieval_configuration
|
2615
|
+
# The configurations to apply to the knowledge base during query. For
|
2616
|
+
# more information, see [Query configurations][1].
|
2617
|
+
#
|
2618
|
+
#
|
2619
|
+
#
|
2620
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html
|
2621
|
+
# @return [Types::KnowledgeBaseRetrievalConfiguration]
|
2622
|
+
#
|
2623
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/KnowledgeBase AWS API Documentation
|
2624
|
+
#
|
2625
|
+
class KnowledgeBase < Struct.new(
|
2626
|
+
:description,
|
2627
|
+
:knowledge_base_id,
|
2628
|
+
:retrieval_configuration)
|
2629
|
+
SENSITIVE = [:description]
|
2630
|
+
include Aws::Structure
|
2631
|
+
end
|
2632
|
+
|
2086
2633
|
# Configurations to apply to a knowledge base attached to the agent
|
2087
2634
|
# during query. For more information, see [Knowledge base retrieval
|
2088
2635
|
# configurations][1].
|
@@ -2813,6 +3360,32 @@ module Aws::BedrockAgentRuntime
|
|
2813
3360
|
include Aws::Structure
|
2814
3361
|
end
|
2815
3362
|
|
3363
|
+
# Contains details about a parameter in a function for an action group.
|
3364
|
+
#
|
3365
|
+
# @!attribute [rw] description
|
3366
|
+
# A description of the parameter. Helps the foundation model determine
|
3367
|
+
# how to elicit the parameters from the user.
|
3368
|
+
# @return [String]
|
3369
|
+
#
|
3370
|
+
# @!attribute [rw] required
|
3371
|
+
# Whether the parameter is required for the agent to complete the
|
3372
|
+
# function for action group invocation.
|
3373
|
+
# @return [Boolean]
|
3374
|
+
#
|
3375
|
+
# @!attribute [rw] type
|
3376
|
+
# The data type of the parameter.
|
3377
|
+
# @return [String]
|
3378
|
+
#
|
3379
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/ParameterDetail AWS API Documentation
|
3380
|
+
#
|
3381
|
+
class ParameterDetail < Struct.new(
|
3382
|
+
:description,
|
3383
|
+
:required,
|
3384
|
+
:type)
|
3385
|
+
SENSITIVE = []
|
3386
|
+
include Aws::Structure
|
3387
|
+
end
|
3388
|
+
|
2816
3389
|
# Contains a part of an agent response and citations for it.
|
2817
3390
|
#
|
2818
3391
|
# @!attribute [rw] attribution
|
@@ -3013,6 +3586,128 @@ module Aws::BedrockAgentRuntime
|
|
3013
3586
|
class Unknown < PreProcessingTrace; end
|
3014
3587
|
end
|
3015
3588
|
|
3589
|
+
# Contains configurations to override a prompt template in one part of
|
3590
|
+
# an agent sequence. For more information, see [Advanced prompts][1].
|
3591
|
+
#
|
3592
|
+
#
|
3593
|
+
#
|
3594
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html
|
3595
|
+
#
|
3596
|
+
# @!attribute [rw] base_prompt_template
|
3597
|
+
# Defines the prompt template with which to replace the default prompt
|
3598
|
+
# template. You can use placeholder variables in the base prompt
|
3599
|
+
# template to customize the prompt. For more information, see [Prompt
|
3600
|
+
# template placeholder variables][1]. For more information, see
|
3601
|
+
# [Configure the prompt templates][2].
|
3602
|
+
#
|
3603
|
+
#
|
3604
|
+
#
|
3605
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html
|
3606
|
+
# [2]: https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts-configure.html
|
3607
|
+
# @return [String]
|
3608
|
+
#
|
3609
|
+
# @!attribute [rw] inference_configuration
|
3610
|
+
# Contains inference parameters to use when the agent invokes a
|
3611
|
+
# foundation model in the part of the agent sequence defined by the
|
3612
|
+
# `promptType`. For more information, see [Inference parameters for
|
3613
|
+
# foundation models][1].
|
3614
|
+
#
|
3615
|
+
#
|
3616
|
+
#
|
3617
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html
|
3618
|
+
# @return [Types::InferenceConfiguration]
|
3619
|
+
#
|
3620
|
+
# @!attribute [rw] parser_mode
|
3621
|
+
# Specifies whether to override the default parser Lambda function
|
3622
|
+
# when parsing the raw foundation model output in the part of the
|
3623
|
+
# agent sequence defined by the `promptType`. If you set the field as
|
3624
|
+
# `OVERRIDEN`, the `overrideLambda` field in the
|
3625
|
+
# [PromptOverrideConfiguration][1] must be specified with the ARN of a
|
3626
|
+
# Lambda function.
|
3627
|
+
#
|
3628
|
+
#
|
3629
|
+
#
|
3630
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html
|
3631
|
+
# @return [String]
|
3632
|
+
#
|
3633
|
+
# @!attribute [rw] prompt_creation_mode
|
3634
|
+
# Specifies whether to override the default prompt template for this
|
3635
|
+
# `promptType`. Set this value to `OVERRIDDEN` to use the prompt that
|
3636
|
+
# you provide in the `basePromptTemplate`. If you leave it as
|
3637
|
+
# `DEFAULT`, the agent uses a default prompt template.
|
3638
|
+
# @return [String]
|
3639
|
+
#
|
3640
|
+
# @!attribute [rw] prompt_state
|
3641
|
+
# Specifies whether to allow the inline agent to carry out the step
|
3642
|
+
# specified in the `promptType`. If you set this value to `DISABLED`,
|
3643
|
+
# the agent skips that step. The default state for each `promptType`
|
3644
|
+
# is as follows.
|
3645
|
+
#
|
3646
|
+
# * `PRE_PROCESSING` – `ENABLED`
|
3647
|
+
#
|
3648
|
+
# * `ORCHESTRATION` – `ENABLED`
|
3649
|
+
#
|
3650
|
+
# * `KNOWLEDGE_BASE_RESPONSE_GENERATION` – `ENABLED`
|
3651
|
+
#
|
3652
|
+
# * `POST_PROCESSING` – `DISABLED`
|
3653
|
+
# @return [String]
|
3654
|
+
#
|
3655
|
+
# @!attribute [rw] prompt_type
|
3656
|
+
# The step in the agent sequence that this prompt configuration
|
3657
|
+
# applies to.
|
3658
|
+
# @return [String]
|
3659
|
+
#
|
3660
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/PromptConfiguration AWS API Documentation
|
3661
|
+
#
|
3662
|
+
class PromptConfiguration < Struct.new(
|
3663
|
+
:base_prompt_template,
|
3664
|
+
:inference_configuration,
|
3665
|
+
:parser_mode,
|
3666
|
+
:prompt_creation_mode,
|
3667
|
+
:prompt_state,
|
3668
|
+
:prompt_type)
|
3669
|
+
SENSITIVE = [:base_prompt_template]
|
3670
|
+
include Aws::Structure
|
3671
|
+
end
|
3672
|
+
|
3673
|
+
# Contains configurations to override prompts in different parts of an
|
3674
|
+
# agent sequence. For more information, see [Advanced prompts][1].
|
3675
|
+
#
|
3676
|
+
#
|
3677
|
+
#
|
3678
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html
|
3679
|
+
#
|
3680
|
+
# @!attribute [rw] override_lambda
|
3681
|
+
# The ARN of the Lambda function to use when parsing the raw
|
3682
|
+
# foundation model output in parts of the agent sequence. If you
|
3683
|
+
# specify this field, at least one of the `promptConfigurations` must
|
3684
|
+
# contain a `parserMode` value that is set to `OVERRIDDEN`. For more
|
3685
|
+
# information, see [Parser Lambda function in Amazon Bedrock
|
3686
|
+
# Agents][1].
|
3687
|
+
#
|
3688
|
+
#
|
3689
|
+
#
|
3690
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/lambda-parser.html
|
3691
|
+
# @return [String]
|
3692
|
+
#
|
3693
|
+
# @!attribute [rw] prompt_configurations
|
3694
|
+
# Contains configurations to override a prompt template in one part of
|
3695
|
+
# an agent sequence. For more information, see [Advanced prompts][1].
|
3696
|
+
#
|
3697
|
+
#
|
3698
|
+
#
|
3699
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html
|
3700
|
+
# @return [Array<Types::PromptConfiguration>]
|
3701
|
+
#
|
3702
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/PromptOverrideConfiguration AWS API Documentation
|
3703
|
+
#
|
3704
|
+
class PromptOverrideConfiguration < Struct.new(
|
3705
|
+
:override_lambda,
|
3706
|
+
:prompt_configurations)
|
3707
|
+
SENSITIVE = []
|
3708
|
+
include Aws::Structure
|
3709
|
+
end
|
3710
|
+
|
3016
3711
|
# Contains the template for the prompt that's sent to the model for
|
3017
3712
|
# response generation. For more information, see [Knowledge base prompt
|
3018
3713
|
# templates][1].
|
@@ -3842,6 +4537,25 @@ module Aws::BedrockAgentRuntime
|
|
3842
4537
|
include Aws::Structure
|
3843
4538
|
end
|
3844
4539
|
|
4540
|
+
# The identifier information for an Amazon S3 bucket.
|
4541
|
+
#
|
4542
|
+
# @!attribute [rw] s3_bucket_name
|
4543
|
+
# The name of the S3 bucket.
|
4544
|
+
# @return [String]
|
4545
|
+
#
|
4546
|
+
# @!attribute [rw] s3_object_key
|
4547
|
+
# The S3 object key for the S3 resource.
|
4548
|
+
# @return [String]
|
4549
|
+
#
|
4550
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/S3Identifier AWS API Documentation
|
4551
|
+
#
|
4552
|
+
class S3Identifier < Struct.new(
|
4553
|
+
:s3_bucket_name,
|
4554
|
+
:s3_object_key)
|
4555
|
+
SENSITIVE = []
|
4556
|
+
include Aws::Structure
|
4557
|
+
end
|
4558
|
+
|
3845
4559
|
# The unique wrapper object of the document from the S3 location.
|
3846
4560
|
#
|
3847
4561
|
# @!attribute [rw] uri
|
@@ -4285,6 +4999,36 @@ module Aws::BedrockAgentRuntime
|
|
4285
4999
|
|
4286
5000
|
end
|
4287
5001
|
|
5002
|
+
# The response from invoking the agent and associated citations and
|
5003
|
+
# trace information.
|
5004
|
+
#
|
5005
|
+
# EventStream is an Enumerator of Events.
|
5006
|
+
# #event_types #=> Array, returns all modeled event types in the stream
|
5007
|
+
#
|
5008
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/InlineAgentResponseStream AWS API Documentation
|
5009
|
+
#
|
5010
|
+
class InlineAgentResponseStream < Enumerator
|
5011
|
+
|
5012
|
+
def event_types
|
5013
|
+
[
|
5014
|
+
:access_denied_exception,
|
5015
|
+
:bad_gateway_exception,
|
5016
|
+
:chunk,
|
5017
|
+
:conflict_exception,
|
5018
|
+
:dependency_failed_exception,
|
5019
|
+
:files,
|
5020
|
+
:internal_server_exception,
|
5021
|
+
:resource_not_found_exception,
|
5022
|
+
:return_control,
|
5023
|
+
:service_quota_exceeded_exception,
|
5024
|
+
:throttling_exception,
|
5025
|
+
:trace,
|
5026
|
+
:validation_exception
|
5027
|
+
]
|
5028
|
+
end
|
5029
|
+
|
5030
|
+
end
|
5031
|
+
|
4288
5032
|
# The stream containing events in the prompt optimization process.
|
4289
5033
|
#
|
4290
5034
|
# EventStream is an Enumerator of Events.
|