forked from MicrosoftDocs/semantic-kernel-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request MicrosoftDocs#191 from MicrosoftDocs/matthew-v1-up…
…dates Update docs for v1.0.0
- Loading branch information
Showing
405 changed files
with
5,038 additions
and
7,833 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.5.002.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "00-Getting-Started", "00-Getting-Started.csproj", "{C6C0B288-CBC9-4C4A-AE46-25022EA75352}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{C6C0B288-CBC9-4C4A-AE46-25022EA75352}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{C6C0B288-CBC9-4C4A-AE46-25022EA75352}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{C6C0B288-CBC9-4C4A-AE46-25022EA75352}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{C6C0B288-CBC9-4C4A-AE46-25022EA75352}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {5AE54649-58C0-4538-A347-9F2D46AD297E} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
|
||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Logging; | ||
using Microsoft.SemanticKernel; | ||
using Microsoft.SemanticKernel.ChatCompletion; | ||
using Microsoft.SemanticKernel.Connectors.OpenAI; | ||
using Plugins; | ||
|
||
// Create kernel | ||
var builder = Kernel.CreateBuilder(); | ||
// Add a text or chat completion service using either: | ||
// builder.Services.AddAzureOpenAIChatCompletion() | ||
// builder.Services.AddAzureOpenAITextGeneration() | ||
// builder.Services.AddOpenAIChatCompletion() | ||
// builder.Services.AddOpenAITextGeneration() | ||
builder.WithCompletionService(); | ||
builder.Services.AddLogging(c => c.AddDebug().SetMinimumLevel(LogLevel.Trace)); | ||
builder.Plugins.AddFromType<LightPlugin>(); | ||
var kernel = builder.Build(); | ||
|
||
// Create chat history | ||
ChatHistory history = []; | ||
|
||
// Get chat completion service | ||
var chatCompletionService = kernel.GetRequiredService<IChatCompletionService>(); | ||
|
||
// Start the conversation | ||
while (true) | ||
{ | ||
// Get user input | ||
Console.Write("User > "); | ||
history.AddUserMessage(Console.ReadLine()!); | ||
|
||
// Enable auto function calling | ||
OpenAIPromptExecutionSettings openAIPromptExecutionSettings = new() | ||
{ | ||
ToolCallBehavior = ToolCallBehavior.AutoInvokeKernelFunctions | ||
}; | ||
|
||
// Get the response from the AI | ||
var result = await chatCompletionService.GetChatMessageContentAsync( | ||
history, | ||
executionSettings: openAIPromptExecutionSettings, | ||
kernel: kernel); | ||
|
||
// Print the results | ||
Console.WriteLine("Assistant > " + result); | ||
|
||
// Add the message from the agent to the chat history | ||
history.AddMessage(result); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.