Skip to content

Commit 2f726c2

Browse files
authored
Merge branch 'main' into update-modelid
2 parents 5bdbbd6 + 59508ca commit 2f726c2

55 files changed

Lines changed: 745 additions & 456 deletions

File tree

Some content is hidden

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

‎docs/decisions/0032-agents.md‎

Lines changed: 276 additions & 0 deletions
Large diffs are not rendered by default.
374 KB
Loading

‎dotnet/Directory.Packages.props‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageVersion Include="Azure.AI.OpenAI" Version="1.0.0-beta.12" />
8+
<PackageVersion Include="Azure.AI.OpenAI" Version="1.0.0-beta.13" />
99
<PackageVersion Include="Azure.Identity" Version="1.10.4" />
10-
<PackageVersion Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.1.0" />
10+
<PackageVersion Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.2.0" />
1111
<PackageVersion Include="Azure.Search.Documents" Version="11.5.1" />
1212
<PackageVersion Include="Handlebars.Net.Helpers" Version="2.4.1.3" />
1313
<PackageVersion Include="Markdig" Version="0.34.0" />
@@ -30,7 +30,7 @@
3030
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
3131
<!-- Tokenizers -->
3232
<PackageVersion Include="Microsoft.ML.Tokenizers" Version="0.21.0" />
33-
<PackageVersion Include="Microsoft.DeepDev.TokenizerLib" Version="1.3.2" />
33+
<PackageVersion Include="Microsoft.DeepDev.TokenizerLib" Version="1.3.3" />
3434
<PackageVersion Include="SharpToken" Version="1.2.14" />
3535
<!-- Microsoft.Extensions.* -->
3636
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
@@ -94,7 +94,7 @@
9494
<PrivateAssets>all</PrivateAssets>
9595
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
9696
</PackageReference>
97-
<PackageVersion Include="xunit.analyzers" Version="1.8.0" />
97+
<PackageVersion Include="xunit.analyzers" Version="1.10.0" />
9898
<PackageReference Include="xunit.analyzers">
9999
<PrivateAssets>all</PrivateAssets>
100100
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -109,7 +109,7 @@
109109
<PrivateAssets>all</PrivateAssets>
110110
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
111111
</PackageReference>
112-
<PackageVersion Include="Roslynator.CodeAnalysis.Analyzers" Version="[4.3.0]" />
112+
<PackageVersion Include="Roslynator.CodeAnalysis.Analyzers" Version="[4.10.0]" />
113113
<PackageReference Include="Roslynator.CodeAnalysis.Analyzers">
114114
<PrivateAssets>all</PrivateAssets>
115115
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

‎dotnet/samples/KernelSyntaxExamples/BaseTest.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public abstract class BaseTest
1616
protected BaseTest(ITestOutputHelper output)
1717
{
1818
this.Output = output;
19-
this.LoggerFactory = new XunitLogger<object>(output);
19+
this.LoggerFactory = new XunitLogger(output);
2020

2121
LoadUserSecrets();
2222
}

‎dotnet/samples/KernelSyntaxExamples/Getting_Started/Step1_Create_Kernel.cs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99

1010
namespace GettingStarted;
1111

12-
// This example shows how to create and use a <see cref="Kernel"/>.
13-
public class Step1_Create_Kernel : BaseTest
12+
/// <summary>
13+
/// This example shows how to create and use a <see cref="Kernel"/>.
14+
/// </summary>
15+
public sealed class Step1_Create_Kernel : BaseTest
1416
{
1517
/// <summary>
1618
/// Show how to create a <see cref="Kernel"/> and use it to execute prompts.
@@ -35,11 +37,9 @@ public async Task RunAsync()
3537
WriteLine();
3638

3739
// Example 3. Invoke the kernel with a templated prompt and stream the results to the display
38-
3940
await foreach (var update in kernel.InvokePromptStreamingAsync("What color is the {{$topic}}? Provide a detailed explanation.", arguments))
4041
{
4142
Write(update);
42-
// Console.Write(update);
4343
}
4444

4545
WriteLine(string.Empty);

‎dotnet/samples/KernelSyntaxExamples/Getting_Started/Step2_Add_Plugins.cs‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111

1212
namespace GettingStarted;
1313

14-
// This example shows how to load a <see cref="KernelPlugin"/> instances.
15-
public class Step2_Add_Plugins : BaseTest
14+
/// <summary>
15+
/// This example shows how to load a <see cref="KernelPlugin"/> instances.
16+
/// </summary>
17+
public sealed class Step2_Add_Plugins : BaseTest
1618
{
1719
/// <summary>
1820
/// Shows different ways to load a <see cref="KernelPlugin"/> instances.
@@ -28,7 +30,7 @@ public async Task RunAsync()
2830
kernelBuilder.Plugins.AddFromType<TimeInformation>();
2931
Kernel kernel = kernelBuilder.Build();
3032

31-
// Example 1. Invoke the kernel with a prompt that asks the AI for inromation it cannot provide and may hallucinate
33+
// Example 1. Invoke the kernel with a prompt that asks the AI for information it cannot provide and may hallucinate
3234
WriteLine(await kernel.InvokePromptAsync("How many days until Christmas?"));
3335

3436
// Example 2. Invoke the kernel with a templated prompt that invokes a plugin and display the result

‎dotnet/samples/KernelSyntaxExamples/Getting_Started/Step3_Yaml_Prompt.cs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010

1111
namespace GettingStarted;
1212

13-
// This example shows how to create a prompt <see cref="KernelFunction"/> from a YAML resource.
14-
public class Step3_Yaml_Prompt : BaseTest
13+
/// <summary>
14+
/// This example shows how to create a prompt <see cref="KernelFunction"/> from a YAML resource.
15+
/// </summary>
16+
public sealed class Step3_Yaml_Prompt : BaseTest
1517
{
1618
/// <summary>
1719
/// Show how to create a prompt <see cref="KernelFunction"/> from a YAML resource.

‎dotnet/samples/KernelSyntaxExamples/Getting_Started/Step4_Dependency_Injection.cs‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313

1414
namespace GettingStarted;
1515

16-
// This example shows how to using Dependency Injection with the Semantic Kernel
17-
public class Step4_Dependency_Injection : BaseTest
16+
/// <summary>
17+
/// This example shows how to using Dependency Injection with the Semantic Kernel
18+
/// </summary>
19+
public sealed class Step4_Dependency_Injection : BaseTest
1820
{
1921
/// <summary>
2022
/// Show how to create a <see cref="Kernel"/> that participates in Dependency Injection.
@@ -29,19 +31,20 @@ public async Task RunAsync()
2931

3032
// Invoke the kernel with a templated prompt and stream the results to the display
3133
KernelArguments arguments = new() { { "topic", "earth when viewed from space" } };
32-
await foreach (var update in kernel.InvokePromptStreamingAsync("What color is the {{$topic}}? Provide a detailed explanation.", arguments))
34+
await foreach (var update in
35+
kernel.InvokePromptStreamingAsync("What color is the {{$topic}}? Provide a detailed explanation.", arguments))
3336
{
3437
Write(update);
3538
}
3639
}
3740

3841
/// <summary>
39-
/// Build a ServiceProvdier that can be used to resolve services.
42+
/// Build a ServiceProvider that can be used to resolve services.
4043
/// </summary>
41-
private static ServiceProvider BuildServiceProvider()
44+
private ServiceProvider BuildServiceProvider()
4245
{
4346
var collection = new ServiceCollection();
44-
collection.AddSingleton(ConsoleLogger.LoggerFactory);
47+
collection.AddSingleton<ILoggerFactory>(new XunitLogger(this.Output));
4548

4649
var kernelBuilder = collection.AddKernel();
4750
kernelBuilder.Services.AddOpenAITextGeneration(TestConfiguration.OpenAI.ModelId, TestConfiguration.OpenAI.ApiKey);

‎dotnet/samples/KernelSyntaxExamples/Getting_Started/Step5_Chat_Prompt.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace GettingStarted;
1010

11-
public class Step5_Chat_Prompt : BaseTest
11+
public sealed class Step5_Chat_Prompt : BaseTest
1212
{
1313
/// <summary>
1414
/// Show how to construct a chat prompt and invoke it.

‎dotnet/samples/KernelSyntaxExamples/Getting_Started/Step6_Responsible_AI.cs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace GettingStarted;
1111

12-
public class Step6_Responsible_AI : BaseTest
12+
public sealed class Step6_Responsible_AI : BaseTest
1313
{
1414
/// <summary>
1515
/// Show how to use prompt filters to ensure that prompts are rendered in a responsible manner.
@@ -51,7 +51,7 @@ public PromptFilter(ITestOutputHelper output)
5151
}
5252

5353
/// <summary>
54-
/// Method which is called before a prompt is rendered.
54+
/// Method which is called after a prompt is rendered.
5555
/// </summary>
5656
public void OnPromptRendered(PromptRenderedContext context)
5757
{
@@ -61,7 +61,7 @@ public void OnPromptRendered(PromptRenderedContext context)
6161
}
6262

6363
/// <summary>
64-
/// Method which is called after a prompt is rendered.
64+
/// Method which is called before a prompt is rendered.
6565
/// </summary>
6666
public void OnPromptRendering(PromptRenderingContext context)
6767
{

0 commit comments

Comments
 (0)