mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Enable more analyzers and various code tweaks/cleanup (#738)
This commit is contained in:
@@ -13,10 +13,10 @@ var userInput = "Tell me a joke about a pirate.";
|
||||
|
||||
Console.WriteLine($"User Input: {userInput}");
|
||||
|
||||
await SKAgent();
|
||||
await AFAgent();
|
||||
await SKAgentAsync();
|
||||
await AFAgentAsync();
|
||||
|
||||
async Task SKAgent()
|
||||
async Task SKAgentAsync()
|
||||
{
|
||||
Console.WriteLine("\n=== SK Agent ===\n");
|
||||
|
||||
@@ -43,7 +43,7 @@ async Task SKAgent()
|
||||
}
|
||||
}
|
||||
|
||||
async Task AFAgent()
|
||||
async Task AFAgentAsync()
|
||||
{
|
||||
Console.WriteLine("\n=== AF Agent ===\n");
|
||||
|
||||
|
||||
+4
-4
@@ -40,10 +40,10 @@ var userInput =
|
||||
|
||||
Console.WriteLine($"User Input: {userInput}");
|
||||
|
||||
await SKAgent();
|
||||
await AFAgent();
|
||||
await SKAgentAsync();
|
||||
await AFAgentAsync();
|
||||
|
||||
async Task SKAgent()
|
||||
async Task SKAgentAsync()
|
||||
{
|
||||
Console.WriteLine("\n=== SK Agent ===\n");
|
||||
|
||||
@@ -108,7 +108,7 @@ async Task SKAgent()
|
||||
}
|
||||
}
|
||||
|
||||
async Task AFAgent()
|
||||
async Task AFAgentAsync()
|
||||
{
|
||||
Console.WriteLine("\n=== AF Agent ===\n");
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@ Console.WriteLine($"User Input: {userInput}");
|
||||
static string GetWeather([Description("The location to get the weather for.")] string location)
|
||||
=> $"The weather in {location} is cloudy with a high of 15°C.";
|
||||
|
||||
await SKAgent();
|
||||
await AFAgent();
|
||||
await SKAgentAsync();
|
||||
await AFAgentAsync();
|
||||
|
||||
async Task SKAgent()
|
||||
async Task SKAgentAsync()
|
||||
{
|
||||
var builder = Kernel.CreateBuilder().AddOpenAIChatClient(modelId, apiKey);
|
||||
|
||||
@@ -42,7 +42,7 @@ async Task SKAgent()
|
||||
}
|
||||
}
|
||||
|
||||
async Task AFAgent()
|
||||
async Task AFAgentAsync()
|
||||
{
|
||||
var agent = new OpenAIClient(apiKey).GetOpenAIResponseClient(modelId).CreateAIAgent(
|
||||
instructions: "You are a helpful assistant",
|
||||
|
||||
+4
-4
@@ -14,10 +14,10 @@ var userInput = "Tell me a joke about a pirate.";
|
||||
|
||||
Console.WriteLine($"User Input: {userInput}");
|
||||
|
||||
await SKAgent();
|
||||
await AFAgent();
|
||||
await SKAgentAsync();
|
||||
await AFAgentAsync();
|
||||
|
||||
async Task SKAgent()
|
||||
async Task SKAgentAsync()
|
||||
{
|
||||
Console.WriteLine("\n=== SK Agent ===\n");
|
||||
|
||||
@@ -36,7 +36,7 @@ async Task SKAgent()
|
||||
Console.WriteLine(result.Message);
|
||||
}
|
||||
|
||||
async Task AFAgent()
|
||||
async Task AFAgentAsync()
|
||||
{
|
||||
Console.WriteLine("\n=== AF Agent ===\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user