Skip to content

Commit 1bdb776

Browse files
Features: Add inline code node to prompt flow
1 parent 2da8681 commit 1bdb776

20 files changed

+459
-42
lines changed

generator/ServiceModels/bedrock-agent/bedrock-agent-2023-06-05.api.json

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3490,6 +3490,7 @@
34903490
"agent":{"shape":"AgentFlowNodeConfiguration"},
34913491
"collector":{"shape":"CollectorFlowNodeConfiguration"},
34923492
"condition":{"shape":"ConditionFlowNodeConfiguration"},
3493+
"inlineCode":{"shape":"InlineCodeFlowNodeConfiguration"},
34933494
"input":{"shape":"InputFlowNodeConfiguration"},
34943495
"iterator":{"shape":"IteratorFlowNodeConfiguration"},
34953496
"knowledgeBase":{"shape":"KnowledgeBaseFlowNodeConfiguration"},
@@ -3580,7 +3581,8 @@
35803581
"Agent",
35813582
"Retrieval",
35823583
"Iterator",
3583-
"Collector"
3584+
"Collector",
3585+
"InlineCode"
35843586
]
35853587
},
35863588
"FlowNodes":{
@@ -4445,6 +4447,23 @@
44454447
"updatedAt":{"shape":"DateTimestamp"}
44464448
}
44474449
},
4450+
"InlineCode":{
4451+
"type":"string",
4452+
"max":5000000,
4453+
"min":1,
4454+
"sensitive":true
4455+
},
4456+
"InlineCodeFlowNodeConfiguration":{
4457+
"type":"structure",
4458+
"required":[
4459+
"code",
4460+
"language"
4461+
],
4462+
"members":{
4463+
"code":{"shape":"InlineCode"},
4464+
"language":{"shape":"SupportedLanguages"}
4465+
}
4466+
},
44484467
"InlineContent":{
44494468
"type":"structure",
44504469
"required":["type"],
@@ -6461,7 +6480,7 @@
64616480
"SessionTTL":{
64626481
"type":"integer",
64636482
"box":true,
6464-
"max":3600,
6483+
"max":5400,
64656484
"min":60
64666485
},
64676486
"SharePointAuthType":{
@@ -6691,6 +6710,10 @@
66916710
"max":1,
66926711
"min":1
66936712
},
6713+
"SupportedLanguages":{
6714+
"type":"string",
6715+
"enum":["Python_3"]
6716+
},
66946717
"SystemContentBlock":{
66956718
"type":"structure",
66966719
"members":{

generator/ServiceModels/bedrock-agent/bedrock-agent-2023-06-05.docs.json

Lines changed: 28 additions & 10 deletions
Large diffs are not rendered by default.

generator/ServiceModels/bedrock-agent/bedrock-agent-2023-06-05.normal.json

Lines changed: 45 additions & 12 deletions
Large diffs are not rendered by default.

sdk/code-analysis/ServiceAnalysis/BedrockAgent/Generated/PropertyValueRules.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
<property-value-rule>
8181
<property>Amazon.BedrockAgent.Model.CreateAgentRequest.IdleSessionTTLInSeconds</property>
8282
<min>60</min>
83-
<max>3600</max>
83+
<max>5400</max>
8484
</property-value-rule>
8585
<property-value-rule>
8686
<property>Amazon.BedrockAgent.Model.CreateAgentRequest.Instruction</property>
@@ -1276,7 +1276,7 @@
12761276
<property-value-rule>
12771277
<property>Amazon.BedrockAgent.Model.UpdateAgentRequest.IdleSessionTTLInSeconds</property>
12781278
<min>60</min>
1279-
<max>3600</max>
1279+
<max>5400</max>
12801280
</property-value-rule>
12811281
<property-value-rule>
12821282
<property>Amazon.BedrockAgent.Model.UpdateAgentRequest.Instruction</property>
@@ -1628,7 +1628,7 @@
16281628
<property-value-rule>
16291629
<property>Amazon.BedrockAgent.Model.Agent.IdleSessionTTLInSeconds</property>
16301630
<min>60</min>
1631-
<max>3600</max>
1631+
<max>5400</max>
16321632
</property-value-rule>
16331633
<property-value-rule>
16341634
<property>Amazon.BedrockAgent.Model.Agent.Instruction</property>
@@ -1873,7 +1873,7 @@
18731873
<property-value-rule>
18741874
<property>Amazon.BedrockAgent.Model.AgentVersion.IdleSessionTTLInSeconds</property>
18751875
<min>60</min>
1876-
<max>3600</max>
1876+
<max>5400</max>
18771877
</property-value-rule>
18781878
<property-value-rule>
18791879
<property>Amazon.BedrockAgent.Model.AgentVersion.Instruction</property>
@@ -2225,6 +2225,11 @@
22252225
<property>Amazon.BedrockAgent.Model.IngestionJobSummary.KnowledgeBaseId</property>
22262226
<pattern>^[0-9a-zA-Z]{10}$</pattern>
22272227
</property-value-rule>
2228+
<property-value-rule>
2229+
<property>Amazon.BedrockAgent.Model.InlineCodeFlowNodeConfiguration.Code</property>
2230+
<min>1</min>
2231+
<max>5000000</max>
2232+
</property-value-rule>
22282233
<property-value-rule>
22292234
<property>Amazon.BedrockAgent.Model.KendraKnowledgeBaseConfiguration.KendraIndexArn</property>
22302235
<pattern>^arn:aws(|-cn|-us-gov):kendra:[a-z0-9-]{1,20}:([0-9]{12}|):index/([a-zA-Z0-9][a-zA-Z0-9-]{35}|[a-zA-Z0-9][a-zA-Z0-9-]{35}-[a-zA-Z0-9][a-zA-Z0-9-]{35})$</pattern>

sdk/src/Services/BedrockAgent/Generated/Model/Agent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ internal bool IsSetGuardrailConfiguration()
387387
/// before the timeout.
388388
/// </para>
389389
/// </summary>
390-
[AWSProperty(Required=true, Min=60, Max=3600)]
390+
[AWSProperty(Required=true, Min=60, Max=5400)]
391391
public int? IdleSessionTTLInSeconds
392392
{
393393
get { return this._idleSessionTTLInSeconds; }

sdk/src/Services/BedrockAgent/Generated/Model/AgentActionGroup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ internal bool IsSetFunctionSchema()
274274
/// <important>
275275
/// <para>
276276
/// Computer use is a new Anthropic Claude model capability (in beta) available with
277-
/// Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agent-computer-use.html">Configure
277+
/// Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html">Configure
278278
/// an Amazon Bedrock Agent to complete tasks with computer use tools</a>.
279279
/// </para>
280280
/// </important>

sdk/src/Services/BedrockAgent/Generated/Model/AgentVersion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ internal bool IsSetGuardrailConfiguration()
294294
/// before the timeout.
295295
/// </para>
296296
/// </summary>
297-
[AWSProperty(Required=true, Min=60, Max=3600)]
297+
[AWSProperty(Required=true, Min=60, Max=5400)]
298298
public int? IdleSessionTTLInSeconds
299299
{
300300
get { return this._idleSessionTTLInSeconds; }

sdk/src/Services/BedrockAgent/Generated/Model/CreateAgentActionGroupRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ internal bool IsSetFunctionSchema()
277277
/// Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only. When operating computer
278278
/// use functionality, we recommend taking additional security precautions, such as executing
279279
/// computer actions in virtual environments with restricted data access and limited internet
280-
/// connectivity. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agent-computer-use.html">Configure
280+
/// connectivity. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html">Configure
281281
/// an Amazon Bedrock Agent to complete tasks with computer use tools</a>.
282282
/// </para>
283283
/// </important> <ul> <li>
@@ -317,7 +317,7 @@ internal bool IsSetParentActionGroupSignature()
317317
/// <para>
318318
/// Computer use is a new Anthropic Claude model capability (in beta) available with
319319
/// Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only. For more information, see
320-
/// <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agent-computer-use.html">Configure
320+
/// <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html">Configure
321321
/// an Amazon Bedrock Agent to complete tasks with computer use tools</a>.
322322
/// </para>
323323
/// </important>

sdk/src/Services/BedrockAgent/Generated/Model/CreateAgentRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ internal bool IsSetGuardrailConfiguration()
320320
/// before the timeout.
321321
/// </para>
322322
/// </summary>
323-
[AWSProperty(Min=60, Max=3600)]
323+
[AWSProperty(Min=60, Max=5400)]
324324
public int? IdleSessionTTLInSeconds
325325
{
326326
get { return this._idleSessionTTLInSeconds; }

sdk/src/Services/BedrockAgent/Generated/Model/FlowNodeConfiguration.cs

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public partial class FlowNodeConfiguration
3838
private AgentFlowNodeConfiguration _agent;
3939
private CollectorFlowNodeConfiguration _collector;
4040
private ConditionFlowNodeConfiguration _condition;
41+
private InlineCodeFlowNodeConfiguration _inlineCode;
4142
private InputFlowNodeConfiguration _input;
4243
private IteratorFlowNodeConfiguration _iterator;
4344
private KnowledgeBaseFlowNodeConfiguration _knowledgeBase;
@@ -89,7 +90,7 @@ internal bool IsSetCollector()
8990
/// <summary>
9091
/// Gets and sets the property Condition.
9192
/// <para>
92-
/// Contains configurations for a Condition node in your flow. Defines conditions that
93+
/// Contains configurations for a condition node in your flow. Defines conditions that
9394
/// lead to different branches of the flow.
9495
/// </para>
9596
/// </summary>
@@ -105,6 +106,26 @@ internal bool IsSetCondition()
105106
return this._condition != null;
106107
}
107108

109+
/// <summary>
110+
/// Gets and sets the property InlineCode.
111+
/// <para>
112+
/// Contains configurations for an inline code node in your flow. Inline code nodes let
113+
/// you write and execute code directly within your flow, enabling data transformations,
114+
/// custom logic, and integrations without needing an external Lambda function.
115+
/// </para>
116+
/// </summary>
117+
public InlineCodeFlowNodeConfiguration InlineCode
118+
{
119+
get { return this._inlineCode; }
120+
set { this._inlineCode = value; }
121+
}
122+
123+
// Check to see if InlineCode property is set
124+
internal bool IsSetInlineCode()
125+
{
126+
return this._inlineCode != null;
127+
}
128+
108129
/// <summary>
109130
/// Gets and sets the property Input.
110131
/// <para>
@@ -249,7 +270,7 @@ internal bool IsSetPrompt()
249270
/// <summary>
250271
/// Gets and sets the property Retrieval.
251272
/// <para>
252-
/// Contains configurations for a Retrieval node in your flow. Retrieves data from an
273+
/// Contains configurations for a retrieval node in your flow. Retrieves data from an
253274
/// Amazon S3 location and returns it as the output.
254275
/// </para>
255276
/// </summary>
@@ -268,7 +289,7 @@ internal bool IsSetRetrieval()
268289
/// <summary>
269290
/// Gets and sets the property Storage.
270291
/// <para>
271-
/// Contains configurations for a Storage node in your flow. Stores an input in an Amazon
292+
/// Contains configurations for a storage node in your flow. Stores an input in an Amazon
272293
/// S3 location.
273294
/// </para>
274295
/// </summary>

sdk/src/Services/BedrockAgent/Generated/Model/InferenceConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ internal bool IsSetTopK()
133133
/// While generating a response, the model determines the probability of the following
134134
/// token at each point of generation. The value that you set for <c>Top P</c> determines
135135
/// the number of most-likely candidates from which the model chooses the next token in
136-
/// the sequence. For example, if you set <c>topP</c> to 80, the model only selects the
136+
/// the sequence. For example, if you set <c>topP</c> to 0.8, the model only selects the
137137
/// next token from the top 80% of the probability distribution of next tokens.
138138
/// </para>
139139
/// </summary>
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the bedrock-agent-2023-06-05.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
29+
#pragma warning disable CS0612,CS0618,CS1570
30+
namespace Amazon.BedrockAgent.Model
31+
{
32+
/// <summary>
33+
/// Contains configurations for an inline code node in your flow. Inline code nodes let
34+
/// you write and execute code directly within your flow, enabling data transformations,
35+
/// custom logic, and integrations without needing an external Lambda function.
36+
/// </summary>
37+
public partial class InlineCodeFlowNodeConfiguration
38+
{
39+
private string _code;
40+
private SupportedLanguages _language;
41+
42+
/// <summary>
43+
/// Gets and sets the property Code.
44+
/// <para>
45+
/// The code that's executed in your inline code node. The code can access input data
46+
/// from previous nodes in the flow, perform operations on that data, and produce output
47+
/// that can be used by other nodes in your flow.
48+
/// </para>
49+
///
50+
/// <para>
51+
/// The code must be valid in the programming <c>language</c> that you specify.
52+
/// </para>
53+
/// </summary>
54+
[AWSProperty(Required=true, Sensitive=true, Min=1, Max=5000000)]
55+
public string Code
56+
{
57+
get { return this._code; }
58+
set { this._code = value; }
59+
}
60+
61+
// Check to see if Code property is set
62+
internal bool IsSetCode()
63+
{
64+
return this._code != null;
65+
}
66+
67+
/// <summary>
68+
/// Gets and sets the property Language.
69+
/// <para>
70+
/// The programming language used by your inline code node.
71+
/// </para>
72+
///
73+
/// <para>
74+
/// The code must be valid in the programming <c>language</c> that you specify. Currently,
75+
/// only Python 3 (<c>Python_3</c>) is supported.
76+
/// </para>
77+
/// </summary>
78+
[AWSProperty(Required=true)]
79+
public SupportedLanguages Language
80+
{
81+
get { return this._language; }
82+
set { this._language = value; }
83+
}
84+
85+
// Check to see if Language property is set
86+
internal bool IsSetLanguage()
87+
{
88+
return this._language != null;
89+
}
90+
91+
}
92+
}

sdk/src/Services/BedrockAgent/Generated/Model/Internal/MarshallTransformations/FlowNodeConfigurationMarshaller.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ public void Marshall(FlowNodeConfiguration requestObject, JsonMarshallerContext
7979
context.Writer.WriteEndObject();
8080
}
8181

82+
if(requestObject.IsSetInlineCode())
83+
{
84+
context.Writer.WritePropertyName("inlineCode");
85+
context.Writer.WriteStartObject();
86+
87+
var marshaller = InlineCodeFlowNodeConfigurationMarshaller.Instance;
88+
marshaller.Marshall(requestObject.InlineCode, context);
89+
90+
context.Writer.WriteEndObject();
91+
}
92+
8293
if(requestObject.IsSetInput())
8394
{
8495
context.Writer.WritePropertyName("input");

sdk/src/Services/BedrockAgent/Generated/Model/Internal/MarshallTransformations/FlowNodeConfigurationUnmarshaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ public FlowNodeConfiguration Unmarshall(JsonUnmarshallerContext context, ref Str
7474
unmarshalledObject.Condition = unmarshaller.Unmarshall(context, ref reader);
7575
continue;
7676
}
77+
if (context.TestExpression("inlineCode", targetDepth))
78+
{
79+
var unmarshaller = InlineCodeFlowNodeConfigurationUnmarshaller.Instance;
80+
unmarshalledObject.InlineCode = unmarshaller.Unmarshall(context, ref reader);
81+
continue;
82+
}
7783
if (context.TestExpression("input", targetDepth))
7884
{
7985
var unmarshaller = InputFlowNodeConfigurationUnmarshaller.Instance;

0 commit comments

Comments
 (0)