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

[.Net] Set up Name field in OpenAIMessageConnector #2662

Merged
merged 10 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
9 changes: 8 additions & 1 deletion dotnet/AutoGen.sln
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.Mistral", "src\Auto
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.Mistral.Tests", "test\AutoGen.Mistral.Tests\AutoGen.Mistral.Tests.csproj", "{15441693-3659-4868-B6C1-B106F52FF3BA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoGen.SemanticKernel.Tests", "test\AutoGen.SemanticKernel.Tests\AutoGen.SemanticKernel.Tests.csproj", "{1DFABC4A-8458-4875-8DCB-59F3802DAC65}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.SemanticKernel.Tests", "test\AutoGen.SemanticKernel.Tests\AutoGen.SemanticKernel.Tests.csproj", "{1DFABC4A-8458-4875-8DCB-59F3802DAC65}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoGen.OpenAI.Tests", "test\AutoGen.OpenAI.Tests\AutoGen.OpenAI.Tests.csproj", "{D36A85F9-C172-487D-8192-6BFE5D05B4A7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -93,6 +95,10 @@ Global
{1DFABC4A-8458-4875-8DCB-59F3802DAC65}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1DFABC4A-8458-4875-8DCB-59F3802DAC65}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1DFABC4A-8458-4875-8DCB-59F3802DAC65}.Release|Any CPU.Build.0 = Release|Any CPU
{D36A85F9-C172-487D-8192-6BFE5D05B4A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D36A85F9-C172-487D-8192-6BFE5D05B4A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D36A85F9-C172-487D-8192-6BFE5D05B4A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D36A85F9-C172-487D-8192-6BFE5D05B4A7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -111,6 +117,7 @@ Global
{6585D1A4-3D97-4D76-A688-1933B61AEB19} = {18BF8DD7-0585-48BF-8F97-AD333080CE06}
{15441693-3659-4868-B6C1-B106F52FF3BA} = {F823671B-3ECA-4AE6-86DA-25E920D3FE64}
{1DFABC4A-8458-4875-8DCB-59F3802DAC65} = {F823671B-3ECA-4AE6-86DA-25E920D3FE64}
{D36A85F9-C172-487D-8192-6BFE5D05B4A7} = {F823671B-3ECA-4AE6-86DA-25E920D3FE64}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {93384647-528D-46C8-922C-8DB36A382F0B}
Expand Down
366 changes: 148 additions & 218 deletions dotnet/src/AutoGen.OpenAI/Middleware/OpenAIChatRequestMessageConnector.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"OriginalMessage": "TextMessage(system, You are a helpful AI assistant, )",
"ConvertedMessages": [
{
"Name": null,
"Role": "system",
"Content": "You are a helpful AI assistant"
}
Expand All @@ -14,6 +15,7 @@
{
"Role": "user",
"Content": "Hello",
"Name": "user",
"MultiModaItem": null
}
]
Expand All @@ -24,6 +26,7 @@
{
"Role": "assistant",
"Content": "How can I help you?",
"Name": "assistant",
"TooCall": [],
"FunctionCallName": null,
"FunctionCallArguments": null
Expand All @@ -34,6 +37,7 @@
"OriginalMessage": "Message(system, You are a helpful AI assistant, , , )",
"ConvertedMessages": [
{
"Name": null,
"Role": "system",
"Content": "You are a helpful AI assistant"
}
Expand All @@ -45,6 +49,7 @@
{
"Role": "user",
"Content": "Hello",
"Name": "user",
"MultiModaItem": null
}
]
Expand All @@ -55,6 +60,7 @@
{
"Role": "assistant",
"Content": "How can I help you?",
"Name": null,
"TooCall": [],
"FunctionCallName": null,
"FunctionCallArguments": null
Expand All @@ -67,6 +73,7 @@
{
"Role": "user",
"Content": "result",
"Name": "user",
"MultiModaItem": null
}
]
Expand All @@ -77,6 +84,7 @@
{
"Role": "assistant",
"Content": null,
"Name": null,
"TooCall": [],
"FunctionCallName": "functionName",
"FunctionCallArguments": "functionArguments"
Expand All @@ -89,6 +97,7 @@
{
"Role": "user",
"Content": null,
"Name": "user",
"MultiModaItem": [
{
"Type": "Image",
Expand All @@ -107,6 +116,7 @@
{
"Role": "user",
"Content": null,
"Name": "user",
"MultiModaItem": [
{
"Type": "Text",
Expand All @@ -129,6 +139,7 @@
{
"Role": "assistant",
"Content": "",
"Name": "assistant",
"TooCall": [
{
"Type": "Function",
Expand Down Expand Up @@ -173,6 +184,7 @@
{
"Role": "assistant",
"Content": "",
"Name": "assistant",
"TooCall": [
{
"Type": "Function",
Expand All @@ -198,6 +210,7 @@
{
"Role": "assistant",
"Content": "",
"Name": "assistant",
"TooCall": [
{
"Type": "Function",
Expand Down
33 changes: 33 additions & 0 deletions dotnet/test/AutoGen.OpenAI.Tests/AutoGen.OpenAI.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>$(TestTargetFramework)</TargetFramework>
<IsPackable>false</IsPackable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ApprovalTests" Version="$(ApprovalTestVersion)" />
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageReference Include="xunit" Version="$(XUnitVersion)" />
<PackageReference Include="xunit.runner.console" Version="$(XUnitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XUnitVersion)" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\AutoGen.Mistral\AutoGen.Mistral.csproj" />
LittleLittleCloud marked this conversation as resolved.
Show resolved Hide resolved
<ProjectReference Include="..\..\src\AutoGen.SourceGenerator\AutoGen.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\src\AutoGen\AutoGen.csproj" />
<ProjectReference Include="..\AutoGen.Tests\AutoGen.Tests.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="ApprovalTests\OpenAIMessageTests.BasicMessageTest.approved.txt">
<ParentFile>$([System.String]::Copy('%(FileName)').Split('.')[0])</ParentFile>
<ParentExtension>$(ProjectExt.Replace('proj', ''))</ParentExtension>
<DependentUpon>%(ParentFile)%(ParentExtension)</DependentUpon>
</None>
</ItemGroup>

</Project>
4 changes: 4 additions & 0 deletions dotnet/test/AutoGen.OpenAI.Tests/GlobalUsing.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// GlobalUsing.cs

global using AutoGen.Core;
Loading
Loading