Skip to content

Commit faf2a85

Browse files
authored
Merge branch 'main' into converse-api/python/tool-use-demo
2 parents cf5c580 + 334b575 commit faf2a85

File tree

61 files changed

+416
-456
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+416
-456
lines changed

.tools/readmes/render.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,15 @@ def _transform_hello(self, pre_hello):
129129
post_hello.append(action)
130130
return sorted(post_hello, key=itemgetter("title_abbrev"))
131131

132-
133132
def _transform_actions(self, pre_actions):
134133
post_actions = []
135134
for pre_id, pre in pre_actions.items():
136135
try:
137136
api = next(iter(pre["services"][self.scanner.svc_name]))
138137
except:
139-
raise MissingMetadataError(f"Action not found for example {pre_id} and service {self.scanner.svc_name}.")
138+
raise MissingMetadataError(
139+
f"Action not found for example {pre_id} and service {self.scanner.svc_name}."
140+
)
140141
action = {
141142
"title_abbrev": api,
142143
"file": self.scanner.snippet(
@@ -331,7 +332,8 @@ def write(self):
331332
self.readme_filename,
332333
f'{self.lang_config["service_folder"]}/{config.saved_readme}',
333334
)
334-
os.remove(self.readme_filename) # Do this so that new files are always updated to the correct case (README.md).
335+
# Do this so that new files are always updated to the correct case (README.md).
336+
Path(self.readme_filename).unlink(missing_ok=True)
335337
with open(self.readme_filename, "w", encoding="utf-8") as f:
336338
f.write(self.readme_text)
337339
print(f"Updated {self.readme_filename}.")

dotnetv3/Bedrock-runtime/BedrockRuntimeExamples.sln

+34-7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,33 @@ MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{E2AD9F91-E6D4-412D-A07A-E004042ADF30}"
77
EndProject
88
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BedrockRuntimeTests", "Tests\BedrockRuntimeTests.csproj", "{6DF749A5-67E4-4F4E-BA64-A2D3F00E4700}"
9+
ProjectSection(ProjectDependencies) = postProject
10+
{02823466-F5FF-43A2-B70A-EF3482A0CBDD} = {02823466-F5FF-43A2-B70A-EF3482A0CBDD}
11+
{0574B2F4-D4BE-4155-902B-BF3D7CE4804E} = {0574B2F4-D4BE-4155-902B-BF3D7CE4804E}
12+
{1E62D4FB-CC59-4F1E-BB22-574CEC08C94B} = {1E62D4FB-CC59-4F1E-BB22-574CEC08C94B}
13+
{25DD40DB-953F-4AA4-A273-28848BAFFBD8} = {25DD40DB-953F-4AA4-A273-28848BAFFBD8}
14+
{2A6989CB-B273-4841-BD3E-7B1BBA4DD25F} = {2A6989CB-B273-4841-BD3E-7B1BBA4DD25F}
15+
{3D6441FC-0FE8-4D0C-910D-3D9310599C71} = {3D6441FC-0FE8-4D0C-910D-3D9310599C71}
16+
{4B5A00D6-B9F1-449F-A9D2-80E860D6BD75} = {4B5A00D6-B9F1-449F-A9D2-80E860D6BD75}
17+
{52CDA3F4-F090-4224-978A-5F42388DCF92} = {52CDA3F4-F090-4224-978A-5F42388DCF92}
18+
{63984664-8230-40F3-BFF5-7AC4988D7FE7} = {63984664-8230-40F3-BFF5-7AC4988D7FE7}
19+
{8D40F644-A2EB-46F0-B0A0-C7B7B563E6BA} = {8D40F644-A2EB-46F0-B0A0-C7B7B563E6BA}
20+
{9018AC00-1D39-41DB-9B3F-A0A7FC60AF18} = {9018AC00-1D39-41DB-9B3F-A0A7FC60AF18}
21+
{A992A4DD-FEEE-40B6-8EA1-AEA3EF612698} = {A992A4DD-FEEE-40B6-8EA1-AEA3EF612698}
22+
{AAE5224C-4947-44C2-8BFB-70AF1F91A6EE} = {AAE5224C-4947-44C2-8BFB-70AF1F91A6EE}
23+
{B6924BBB-9993-44C1-BEF9-DEDEA42A12B2} = {B6924BBB-9993-44C1-BEF9-DEDEA42A12B2}
24+
{B753CEB9-EA53-4AE1-997E-B7D54A299D58} = {B753CEB9-EA53-4AE1-997E-B7D54A299D58}
25+
{BCC66C37-4980-484F-819D-066D2FF2669C} = {BCC66C37-4980-484F-819D-066D2FF2669C}
26+
{C9049A40-6C4A-4071-9753-493FEB0C08BE} = {C9049A40-6C4A-4071-9753-493FEB0C08BE}
27+
{CDF1A045-0888-418C-8656-2BF5E3348A48} = {CDF1A045-0888-418C-8656-2BF5E3348A48}
28+
{D1B0719F-4F84-4DBC-BCAD-E856FB3193D7} = {D1B0719F-4F84-4DBC-BCAD-E856FB3193D7}
29+
{D3BA31F5-FF20-4321-9494-3F01439C4F61} = {D3BA31F5-FF20-4321-9494-3F01439C4F61}
30+
{D96E9BC2-3143-4F95-835C-5F3AAC414B9C} = {D96E9BC2-3143-4F95-835C-5F3AAC414B9C}
31+
{E153B47E-DBBF-4793-A2C8-89792CB8C6EE} = {E153B47E-DBBF-4793-A2C8-89792CB8C6EE}
32+
{EFC7D088-EF45-464B-97CD-0BBA486B224A} = {EFC7D088-EF45-464B-97CD-0BBA486B224A}
33+
{F6E2F781-D0C6-4912-8E2F-F6C36FDE4785} = {F6E2F781-D0C6-4912-8E2F-F6C36FDE4785}
34+
{FCA6CE8F-531C-4C53-A7C1-3E3028A98CC4} = {FCA6CE8F-531C-4C53-A7C1-3E3028A98CC4}
35+
EndProjectSection
936
EndProject
1037
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Models", "Models", "{41B69207-8F29-41BC-9114-78EE740485C8}"
1138
EndProject
@@ -61,8 +88,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Command_R_InvokeModel", "Mo
6188
EndProject
6289
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InvokeModelWithResponseStream", "Models\AmazonTitanText\InvokeModelWithResponseStream\InvokeModelWithResponseStream.csproj", "{52CDA3F4-F090-4224-978A-5F42388DCF92}"
6390
EndProject
64-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InvokeModelWithResponseStream", "Models\AnthropicClaude\InvokeModelWithResponseStream\InvokeModelWithResponseStream.csproj", "{7C1848AC-3996-451F-8AF1-40F8D69CF6B6}"
65-
EndProject
6691
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Command_InvokeModelWithResponseStream", "Models\CohereCommand\Command_InvokeModelWithResponseStream\Command_InvokeModelWithResponseStream.csproj", "{63984664-8230-40F3-BFF5-7AC4988D7FE7}"
6792
EndProject
6893
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Command_R_InvokeModelWithResponseStream", "Models\CohereCommand\Command_R_InvokeModelWithResponseStream\Command_R_InvokeModelWithResponseStream.csproj", "{02823466-F5FF-43A2-B70A-EF3482A0CBDD}"
@@ -73,6 +98,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Llama3_InvokeModelWithRespo
7398
EndProject
7499
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InvokeModelWithResponseStream", "Models\Mistral\InvokeModelWithResponseStream\InvokeModelWithResponseStream.csproj", "{EFC7D088-EF45-464B-97CD-0BBA486B224A}"
75100
EndProject
101+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InvokeModelWithResponseStream", "Models\AnthropicClaude\InvokeModelWithResponseStream\InvokeModelWithResponseStream.csproj", "{C75F2BBE-7C84-4B01-9836-7279DAE41499}"
102+
EndProject
76103
Global
77104
GlobalSection(SolutionConfigurationPlatforms) = preSolution
78105
Debug|Any CPU = Debug|Any CPU
@@ -163,10 +190,6 @@ Global
163190
{52CDA3F4-F090-4224-978A-5F42388DCF92}.Debug|Any CPU.Build.0 = Debug|Any CPU
164191
{52CDA3F4-F090-4224-978A-5F42388DCF92}.Release|Any CPU.ActiveCfg = Release|Any CPU
165192
{52CDA3F4-F090-4224-978A-5F42388DCF92}.Release|Any CPU.Build.0 = Release|Any CPU
166-
{7C1848AC-3996-451F-8AF1-40F8D69CF6B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
167-
{7C1848AC-3996-451F-8AF1-40F8D69CF6B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
168-
{7C1848AC-3996-451F-8AF1-40F8D69CF6B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
169-
{7C1848AC-3996-451F-8AF1-40F8D69CF6B6}.Release|Any CPU.Build.0 = Release|Any CPU
170193
{63984664-8230-40F3-BFF5-7AC4988D7FE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
171194
{63984664-8230-40F3-BFF5-7AC4988D7FE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
172195
{63984664-8230-40F3-BFF5-7AC4988D7FE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -187,6 +210,10 @@ Global
187210
{EFC7D088-EF45-464B-97CD-0BBA486B224A}.Debug|Any CPU.Build.0 = Debug|Any CPU
188211
{EFC7D088-EF45-464B-97CD-0BBA486B224A}.Release|Any CPU.ActiveCfg = Release|Any CPU
189212
{EFC7D088-EF45-464B-97CD-0BBA486B224A}.Release|Any CPU.Build.0 = Release|Any CPU
213+
{C75F2BBE-7C84-4B01-9836-7279DAE41499}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
214+
{C75F2BBE-7C84-4B01-9836-7279DAE41499}.Debug|Any CPU.Build.0 = Debug|Any CPU
215+
{C75F2BBE-7C84-4B01-9836-7279DAE41499}.Release|Any CPU.ActiveCfg = Release|Any CPU
216+
{C75F2BBE-7C84-4B01-9836-7279DAE41499}.Release|Any CPU.Build.0 = Release|Any CPU
190217
EndGlobalSection
191218
GlobalSection(SolutionProperties) = preSolution
192219
HideSolutionNode = FALSE
@@ -219,12 +246,12 @@ Global
219246
{2A6989CB-B273-4841-BD3E-7B1BBA4DD25F} = {EF45C0B9-ED76-4B7A-A0A7-F102E979B71C}
220247
{BCC66C37-4980-484F-819D-066D2FF2669C} = {EF45C0B9-ED76-4B7A-A0A7-F102E979B71C}
221248
{52CDA3F4-F090-4224-978A-5F42388DCF92} = {3F96ECB4-1644-43E8-8643-2CDCF9E679F1}
222-
{7C1848AC-3996-451F-8AF1-40F8D69CF6B6} = {8BAC2322-AD3C-484A-B51D-8263BC4E6646}
223249
{63984664-8230-40F3-BFF5-7AC4988D7FE7} = {EF45C0B9-ED76-4B7A-A0A7-F102E979B71C}
224250
{02823466-F5FF-43A2-B70A-EF3482A0CBDD} = {EF45C0B9-ED76-4B7A-A0A7-F102E979B71C}
225251
{C9049A40-6C4A-4071-9753-493FEB0C08BE} = {65504C76-7E32-4A12-A42E-BCDA4FE79BC1}
226252
{4B5A00D6-B9F1-449F-A9D2-80E860D6BD75} = {65504C76-7E32-4A12-A42E-BCDA4FE79BC1}
227253
{EFC7D088-EF45-464B-97CD-0BBA486B224A} = {BBB79D3E-5DF2-4FF6-B467-52D0EEB91C4B}
254+
{C75F2BBE-7C84-4B01-9836-7279DAE41499} = {8BAC2322-AD3C-484A-B51D-8263BC4E6646}
228255
EndGlobalSection
229256
GlobalSection(ExtensibilityGlobals) = postSolution
230257
SolutionGuid = {E48A5088-1BBB-4A8B-9AB2-CC5CE0482466}

dotnetv3/Bedrock-runtime/Models/Ai21LabsJurassic2/Converse/Converse.csx renamed to dotnetv3/Bedrock-runtime/Models/Ai21LabsJurassic2/Converse/Converse.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

44
// snippet-start:[BedrockRuntime.dotnetv3.Converse_Ai21LabsJurassic2]
55
// Use the Converse API to send a text message to AI21 Labs Jurassic-2.
66

7+
using System;
8+
using System.Collections.Generic;
79
using Amazon;
810
using Amazon.BedrockRuntime;
911
using Amazon.BedrockRuntime.Model;
10-
using System;
11-
using System.Collections.Generic;
1212

1313
// Create a Bedrock Runtime client in the AWS Region you want to use.
1414
var client = new AmazonBedrockRuntimeClient(RegionEndpoint.USEast1);
@@ -55,3 +55,6 @@
5555
}
5656

5757
// snippet-end:[BedrockRuntime.dotnetv3.Converse_Ai21LabsJurassic2]
58+
59+
// Create a partial class to make the top-level script testable.
60+
namespace Ai21LabsJurassic2 { public partial class Converse { } }

dotnetv3/Bedrock-runtime/Models/Ai21LabsJurassic2/Converse/Converse.csproj

+3-6
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<TargetFramework>net8.0</TargetFramework>
5+
<AssemblyName>Ai21LabsJurassic2.$(MSBuildProjectName)</AssemblyName>
56
</PropertyGroup>
67

78
<ItemGroup>
8-
<Compile Include="Converse.csx" />
9-
</ItemGroup>
10-
11-
<ItemGroup>
12-
<PackageReference Include="AWSSDK.BedrockRuntime" Version="3.7.303.1" />
13-
<PackageReference Include="AWSSDK.Core" Version="3.7.304.10" />
9+
<PackageReference Include="AWSSDK.BedrockRuntime" Version="3.7.303.3" />
10+
<PackageReference Include="AWSSDK.Core" Version="3.7.304.12" />
1411
</ItemGroup>
1512
</Project>

dotnetv3/Bedrock-runtime/Models/Ai21LabsJurassic2/InvokeModel/InvokeModel.csx renamed to dotnetv3/Bedrock-runtime/Models/Ai21LabsJurassic2/InvokeModel/InvokeModel.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
// snippet-start:[BedrockRuntime.dotnetv3.InvokeModel_Ai21LabsJurassic2]
55
// Use the native inference API to send a text message to AI21 Labs Jurassic-2.
66

7-
using Amazon;
8-
using Amazon.BedrockRuntime;
9-
using Amazon.BedrockRuntime.Model;
107
using System;
118
using System.IO;
129
using System.Text.Json;
1310
using System.Text.Json.Nodes;
11+
using Amazon;
12+
using Amazon.BedrockRuntime;
13+
using Amazon.BedrockRuntime.Model;
1414

1515
// Create a Bedrock Runtime client in the AWS Region you want to use.
1616
var client = new AmazonBedrockRuntimeClient(RegionEndpoint.USEast1);
@@ -56,3 +56,6 @@
5656
}
5757

5858
// snippet-end:[BedrockRuntime.dotnetv3.InvokeModel_Ai21LabsJurassic2]
59+
60+
// Create a partial class to make the top-level script testable.
61+
namespace Ai21LabsJurassic2 { public partial class InvokeModel { } }
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<OutputType>Exe</OutputType>
4-
<TargetFramework>net8.0</TargetFramework>
5-
</PropertyGroup>
6-
7-
<ItemGroup>
8-
<Compile Include="InvokeModel.csx" />
9-
</ItemGroup>
2+
<PropertyGroup>
3+
<OutputType>Exe</OutputType>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<AssemblyName>Ai21LabsJurassic2.$(MSBuildProjectName)</AssemblyName>
6+
</PropertyGroup>
107

118
<ItemGroup>
12-
<PackageReference Include="AWSSDK.BedrockRuntime" Version="3.7.303.1" />
13-
<PackageReference Include="AWSSDK.Core" Version="3.7.304.10" />
9+
<PackageReference Include="AWSSDK.BedrockRuntime" Version="3.7.303.3" />
10+
<PackageReference Include="AWSSDK.Core" Version="3.7.304.12" />
1411
</ItemGroup>
1512
</Project>

dotnetv3/Bedrock-runtime/Models/AmazonTitanText/Converse/Converse.csx renamed to dotnetv3/Bedrock-runtime/Models/AmazonTitanText/Converse/Converse.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
// snippet-start:[BedrockRuntime.dotnetv3.Converse_AmazonTitanText]
55
// Use the Converse API to send a text message to Amazon Titan Text.
66

7+
using System;
8+
using System.Collections.Generic;
79
using Amazon;
810
using Amazon.BedrockRuntime;
911
using Amazon.BedrockRuntime.Model;
10-
using System;
11-
using System.Collections.Generic;
1212

1313
// Create a Bedrock Runtime client in the AWS Region you want to use.
1414
var client = new AmazonBedrockRuntimeClient(RegionEndpoint.USEast1);
@@ -55,3 +55,6 @@
5555
}
5656

5757
// snippet-end:[BedrockRuntime.dotnetv3.Converse_AmazonTitanText]
58+
59+
// Create a partial class to make the top-level script testable.
60+
namespace AmazonTitanText { public partial class Converse { } }

dotnetv3/Bedrock-runtime/Models/AmazonTitanText/Converse/Converse.csproj

+3-6
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<TargetFramework>net8.0</TargetFramework>
5+
<AssemblyName>AmazonTitanText.$(MSBuildProjectName)</AssemblyName>
56
</PropertyGroup>
67

78
<ItemGroup>
8-
<Compile Include="Converse.csx" />
9-
</ItemGroup>
10-
11-
<ItemGroup>
12-
<PackageReference Include="AWSSDK.BedrockRuntime" Version="3.7.303.1" />
13-
<PackageReference Include="AWSSDK.Core" Version="3.7.304.10" />
9+
<PackageReference Include="AWSSDK.BedrockRuntime" Version="3.7.303.3" />
10+
<PackageReference Include="AWSSDK.Core" Version="3.7.304.12" />
1411
</ItemGroup>
1512
</Project>

dotnetv3/Bedrock-runtime/Models/AmazonTitanText/ConverseStream/ConverseStream.csx renamed to dotnetv3/Bedrock-runtime/Models/AmazonTitanText/ConverseStream/ConverseStream.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
// Use the Converse API to send a text message to Amazon Titan Text
66
// and print the response stream.
77

8-
using Amazon;
9-
using Amazon.BedrockRuntime;
10-
using Amazon.BedrockRuntime.Model;
118
using System;
129
using System.Collections.Generic;
1310
using System.Linq;
11+
using Amazon;
12+
using Amazon.BedrockRuntime;
13+
using Amazon.BedrockRuntime.Model;
1414

1515
// Create a Bedrock Runtime client in the AWS Region you want to use.
1616
var client = new AmazonBedrockRuntimeClient(RegionEndpoint.USEast1);
@@ -62,3 +62,6 @@
6262
}
6363

6464
// snippet-end:[BedrockRuntime.dotnetv3.ConverseStream_AmazonTitanText]
65+
66+
// Create a partial class to make the top-level script testable.
67+
namespace AmazonTitanText { public partial class ConverseStream { } }
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<OutputType>Exe</OutputType>
4-
<TargetFramework>net8.0</TargetFramework>
5-
</PropertyGroup>
6-
7-
<ItemGroup>
8-
<Compile Include="ConverseStream.csx" />
9-
</ItemGroup>
2+
<PropertyGroup>
3+
<OutputType>Exe</OutputType>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<AssemblyName>AmazonTitanText.$(MSBuildProjectName)</AssemblyName>
6+
</PropertyGroup>
107

118
<ItemGroup>
12-
<PackageReference Include="AWSSDK.BedrockRuntime" Version="3.7.303.1" />
13-
<PackageReference Include="AWSSDK.Core" Version="3.7.304.10" />
9+
<PackageReference Include="AWSSDK.BedrockRuntime" Version="3.7.303.3" />
10+
<PackageReference Include="AWSSDK.Core" Version="3.7.304.12" />
1411
</ItemGroup>
15-
</Project>
12+
</Project>

dotnetv3/Bedrock-runtime/Models/AmazonTitanText/InvokeModel/InvokeModel.csx renamed to dotnetv3/Bedrock-runtime/Models/AmazonTitanText/InvokeModel/InvokeModel.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
// snippet-start:[BedrockRuntime.dotnetv3.InvokeModel_AmazonTitanText]
55
// Use the native inference API to send a text message to Amazon Titan Text.
66

7-
using Amazon;
8-
using Amazon.BedrockRuntime;
9-
using Amazon.BedrockRuntime.Model;
107
using System;
118
using System.IO;
129
using System.Text.Json;
1310
using System.Text.Json.Nodes;
11+
using Amazon;
12+
using Amazon.BedrockRuntime;
13+
using Amazon.BedrockRuntime.Model;
1414

1515
// Create a Bedrock Runtime client in the AWS Region you want to use.
1616
var client = new AmazonBedrockRuntimeClient(RegionEndpoint.USEast1);
@@ -59,3 +59,6 @@
5959
}
6060

6161
// snippet-end:[BedrockRuntime.dotnetv3.InvokeModel_AmazonTitanText]
62+
63+
// Create a partial class to make the top-level script testable.
64+
namespace AmazonTitanText { public partial class InvokeModel { } }

dotnetv3/Bedrock-runtime/Models/AmazonTitanText/InvokeModel/InvokeModel.csproj

+4-7
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<TargetFramework>net8.0</TargetFramework>
5+
<AssemblyName>AmazonTitanText.$(MSBuildProjectName)</AssemblyName>
56
</PropertyGroup>
67

78
<ItemGroup>
8-
<Compile Include="InvokeModel.csx" />
9+
<PackageReference Include="AWSSDK.BedrockRuntime" Version="3.7.303.3" />
10+
<PackageReference Include="AWSSDK.Core" Version="3.7.304.12" />
911
</ItemGroup>
10-
11-
<ItemGroup>
12-
<PackageReference Include="AWSSDK.BedrockRuntime" Version="3.7.303.1" />
13-
<PackageReference Include="AWSSDK.Core" Version="3.7.304.10" />
14-
</ItemGroup>
15-
</Project>
12+
</Project>
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
// Use the native inference API to send a text message to Amazon Titan Text
66
// and print the response stream.
77

8-
using Amazon;
9-
using Amazon.BedrockRuntime;
10-
using Amazon.BedrockRuntime.Model;
118
using System;
129
using System.IO;
1310
using System.Text.Json;
1411
using System.Text.Json.Nodes;
12+
using Amazon;
13+
using Amazon.BedrockRuntime;
14+
using Amazon.BedrockRuntime.Model;
1515

1616
// Create a Bedrock Runtime client in the AWS Region you want to use.
1717
var client = new AmazonBedrockRuntimeClient(RegionEndpoint.USEast1);
@@ -61,3 +61,6 @@
6161
}
6262

6363
// snippet-end:[BedrockRuntime.dotnetv3.InvokeModelWithResponseStream_AmazonTitanText]
64+
65+
// Create a partial class to make the top-level script testable.
66+
namespace AmazonTitanText { public partial class InvokeModelWithResponseStream { } }

dotnetv3/Bedrock-runtime/Models/AmazonTitanText/InvokeModelWithResponseStream/InvokeModelWithResponseStream.csproj

+4-7
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<TargetFramework>net8.0</TargetFramework>
5+
<AssemblyName>AmazonTitanText.$(MSBuildProjectName)</AssemblyName>
56
</PropertyGroup>
67

78
<ItemGroup>
8-
<Compile Include="InvokeModelWithResponseStream.csx" />
9+
<PackageReference Include="AWSSDK.BedrockRuntime" Version="3.7.303.3" />
10+
<PackageReference Include="AWSSDK.Core" Version="3.7.304.12" />
911
</ItemGroup>
10-
11-
<ItemGroup>
12-
<PackageReference Include="AWSSDK.BedrockRuntime" Version="3.7.303.1" />
13-
<PackageReference Include="AWSSDK.Core" Version="3.7.304.10" />
14-
</ItemGroup>
15-
</Project>
12+
</Project>

0 commit comments

Comments
 (0)