Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use connector nuget package #40

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/dotnet-01-echo-bot/MyAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public override async Task ReceiveCommandAsync(
if (!this.Config.ReplyToAgents && command.Sender.Role == "assistant") { return; }

// Support only the "say" command
if (command.CommandName.ToLowerInvariant() != "say") { return; }
if (!command.CommandName.Equals("say", StringComparison.OrdinalIgnoreCase)) { return; }

// Update the chat history to include the message received
await base.AddMessageToHistoryAsync(conversationId, command, cancellationToken).ConfigureAwait(false);
Expand Down Expand Up @@ -107,7 +107,7 @@ public override async Task ReceiveMessageAsync(
if (string.IsNullOrWhiteSpace(message.Content)) { return; }

// Create the answer content
var answer = Message.CreateChatMessage(this.Id, "echo: "+ message.Content);
var answer = Message.CreateChatMessage(this.Id, "echo: " + message.Content);

// Update the chat history to include the outgoing message
await this.AddMessageToHistoryAsync(conversationId, answer, cancellationToken).ConfigureAwait(false);
Expand Down
25 changes: 23 additions & 2 deletions examples/dotnet-01-echo-bot/dotnet-01-echo-bot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,36 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\assistant-connector\dotnet\WorkbenchConnector\WorkbenchConnector.csproj" />
<PackageReference Include="Microsoft.SemanticWorkbench.Connector" Version="0.1.240910.6" />
</ItemGroup>

<PropertyGroup>
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>All</AnalysisMode>
<AnalysisLevel>latest</AnalysisLevel>
<!-- Used by IDE0005 -->
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="4.11.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Roslynator.Analyzers" Version="4.12.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
3 changes: 1 addition & 2 deletions examples/dotnet-02-message-types-demo/MyAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public MyAgentConfig Config
/// <param name="workbenchConnector">Service containing the agent, used to communicate with Workbench backend</param>
/// <param name="storage">Agent data storage</param>
/// <param name="contentSafety">Azure content safety</param>
/// <param name="kernel">Semantic Kernel</param>
/// <param name="loggerFactory">App logger factory</param>
public MyAgent(
string agentId,
Expand Down Expand Up @@ -75,7 +74,7 @@ public override async Task ReceiveCommandAsync(
if (!this.Config.CommandsEnabled) { return; }

// Support only the "say" command
if (command.CommandName.ToLowerInvariant() != "say") { return; }
if (!command.CommandName.Equals("say", StringComparison.OrdinalIgnoreCase)) { return; }

// Update the chat history to include the message received
await base.ReceiveMessageAsync(conversationId, command, cancellationToken).ConfigureAwait(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,43 @@
<Nullable>enable</Nullable>
<RootNamespace>AgentExample</RootNamespace>
<PackageId>AgentExample</PackageId>
<NoWarn>$(NoWarn);CA1308;CA1861;</NoWarn>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\assistant-connector\dotnet\WorkbenchConnector\WorkbenchConnector.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.AI.ContentSafety" Version="1.0.0" />
<PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.15.1" />
<PackageReference Include="Microsoft.SemanticWorkbench.Connector" Version="0.1.240910.6" />
</ItemGroup>

<PropertyGroup>
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>All</AnalysisMode>
<AnalysisLevel>latest</AnalysisLevel>
<!-- Used by IDE0005 -->
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="4.11.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Roslynator.Analyzers" Version="4.12.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
<NoWarn>$(NoWarn);SKEXP0010;CA1861;</NoWarn>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\assistant-connector\dotnet\WorkbenchConnector\WorkbenchConnector.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Azure.AI.ContentSafety" Version="1.0.0" />
<PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.15.1" />
<PackageReference Include="Microsoft.SemanticWorkbench.Connector" Version="0.1.240910.6" />
</ItemGroup>

<PropertyGroup>
Expand Down