Skip to content

Commit

Permalink
Merge branch 'staging' into rename_references
Browse files Browse the repository at this point in the history
  • Loading branch information
jackgerrits authored Oct 8, 2024
2 parents b7ae47b + e400567 commit 121d0b6
Show file tree
Hide file tree
Showing 35 changed files with 856 additions and 653 deletions.
8 changes: 1 addition & 7 deletions dotnet/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<<<<<<< HEAD
# EditorConfig is awesome:http://EditorConfig.org
# EditorConfig is awesome:http://EditorConfig.org

# top-most EditorConfig file
root = true
Expand Down Expand Up @@ -93,7 +92,6 @@ csharp_style_inlined_variable_declaration = true:error
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
=======
; EditorConfig to support per-solution formatting.
; Use the EditorConfig VS add-in to make this work.
; http://editorconfig.org/
Expand Down Expand Up @@ -137,7 +135,6 @@ csharp_style_var_elsewhere = true:suggestion

# Disallow throw expressions.
csharp_style_throw_expression = false:suggestion
>>>>>>> agnext_main

# Newline settings
csharp_new_line_before_open_brace = all
Expand All @@ -146,7 +143,6 @@ csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
<<<<<<< HEAD
csharp_new_line_between_query_expression_clauses = true

# Identation options
Expand Down Expand Up @@ -236,7 +232,6 @@ dotnet_diagnostic.CA2016.severity = suggestion
# disable check for generated code
[*.generated.cs]
generated_code = true
=======

# Namespace settings
csharp_style_namespace_declarations = file_scoped:silent
Expand Down Expand Up @@ -708,4 +703,3 @@ generated_code = true

# IDE1591 Missing XML comment for publicly visible type or member
dotnet_diagnostic.CS1591.severity = none
>>>>>>> agnext_main
6 changes: 0 additions & 6 deletions dotnet/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<<<<<<< HEAD
# gitignore file for C#/VS
=======
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
Expand All @@ -20,7 +18,6 @@
mono_crash.*

output
>>>>>>> agnext_main

# Build results
[Dd]ebug/
Expand All @@ -29,7 +26,6 @@ output
[Rr]eleases/
x64/
x86/
<<<<<<< HEAD
build/
bld/
[Bb]in/
Expand All @@ -51,7 +47,6 @@ output/

# JetBrains Rider
.idea/
=======
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
Expand Down Expand Up @@ -525,4 +520,3 @@ sk-azfunc-server/local.settings.json
temp
.mono/**
**/values.xml
>>>>>>> agnext_main
10 changes: 7 additions & 3 deletions dotnet/AutoGen.sln
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AgentChat", "AgentChat", "{C7A2D42D-9277-47AC-862B-D86DF9D6AD48}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dev-team", "dev-team", "{616F30DF-1F41-4047-BAA4-64BA03BF5AEA}"
ProjectSection(SolutionItems) = preProject
samples\dev-team\DevTeam.ServiceDefaults\DevTeam.ServiceDefaults.csproj = samples\dev-team\DevTeam.ServiceDefaults\DevTeam.ServiceDefaults.csproj
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevTeam.AgentHost", "samples\dev-team\DevTeam.AgentHost\DevTeam.AgentHost.csproj", "{7228A701-C79D-4E15-BF45-48D11F721A84}"
EndProject
Expand Down Expand Up @@ -127,6 +124,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloAgents.Web", "samples\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hello", "samples\Hello\Hello.csproj", "{6C9135E6-9D15-4D86-B3F4-9666DB87060A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AutoGen.ServiceDefaults", "src\Microsoft.AutoGen.ServiceDefaults\Microsoft.AutoGen.ServiceDefaults.csproj", "{F70C6FD7-9615-4EDD-8D55-5460FCC5A46D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -337,6 +336,10 @@ Global
{6C9135E6-9D15-4D86-B3F4-9666DB87060A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6C9135E6-9D15-4D86-B3F4-9666DB87060A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6C9135E6-9D15-4D86-B3F4-9666DB87060A}.Release|Any CPU.Build.0 = Release|Any CPU
{F70C6FD7-9615-4EDD-8D55-5460FCC5A46D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F70C6FD7-9615-4EDD-8D55-5460FCC5A46D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F70C6FD7-9615-4EDD-8D55-5460FCC5A46D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F70C6FD7-9615-4EDD-8D55-5460FCC5A46D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -397,6 +400,7 @@ Global
{6B88F4B3-26AB-4034-B0AC-5BA6EEDEB8E5} = {F7AC0FF1-8500-49C6-8CB3-97C6D52C8BEF}
{8B56BE22-5CF4-44BB-AFA5-732FEA2AFF0B} = {F7AC0FF1-8500-49C6-8CB3-97C6D52C8BEF}
{6C9135E6-9D15-4D86-B3F4-9666DB87060A} = {FBFEAD1F-29EB-4D99-A672-0CD8473E10B9}
{F70C6FD7-9615-4EDD-8D55-5460FCC5A46D} = {18BF8DD7-0585-48BF-8F97-AD333080CE06}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {93384647-528D-46C8-922C-8DB36A382F0B}
Expand Down
38 changes: 18 additions & 20 deletions dotnet/samples/Hello/Program.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
using Microsoft.AutoGen.Agents.Abstractions;
using Microsoft.AutoGen.Agents.Client;
using Microsoft.AutoGen.Agents.Runtime;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

var builder = Host.CreateApplicationBuilder(args);
builder.AddAgentService();
builder.UseOrleans(siloBuilder =>
{
siloBuilder.UseLocalhostClustering(); ;
});
builder.AddAgentWorker("https://localhost:5000");
var app = builder.Build();
await app.StartAsync();
app.Services.GetRequiredService<AgentWorkerRuntime>();
var evt = new NewMessageReceived
// send a message to the agent
var app = await App.PublishMessageAsync("HelloAgents", new NewMessageReceived
{
Message = "World"
}.ToCloudEvent("HelloAgents");
}, local: true);

await App.RuntimeApp!.WaitForShutdownAsync();
await app.WaitForShutdownAsync();

[TopicSubscription("HelloAgents")]
Expand All @@ -32,27 +24,33 @@ public class HelloAgent(
{
public async Task Handle(NewMessageReceived item)
{
var response = await SayHello(item.Message);
var response = await SayHello(item.Message).ConfigureAwait(false);
var evt = new Output
{
Message = response
}.ToCloudEvent(this.AgentId.Key);
await PublishEvent(evt);
await PublishEvent(evt).ConfigureAwait(false);
var goodbye = new ConversationClosed
{
UserId = this.AgentId.Key,
UserMessage = "Goodbye"
}.ToCloudEvent(this.AgentId.Key);
await PublishEvent(goodbye).ConfigureAwait(false);
}

public async Task Handle(ConversationClosed item)
{
var goodbye = "Goodbye!";
var goodbye = $"********************* {item.UserId} said {item.UserMessage} ************************";
var evt = new Output
{
Message = goodbye
}.ToCloudEvent(this.AgentId.Key);
await PublishEvent(evt);
await PublishEvent(evt).ConfigureAwait(false);
await Task.Delay(60000);
await App.ShutdownAsync();
}

public async Task<string> SayHello(string ask)
{
var response = $"Hello {ask}";
var response = $"\n\n\n\n***************Hello {ask}**********************\n\n\n\n";
return response;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ItemGroup>
<ProjectReference Include="../../../src/Microsoft.AutoGen.Agents.Runtime/Microsoft.AutoGen.Agents.Runtime.csproj" />
<ProjectReference Include="..\DevTeam.ServiceDefaults\DevTeam.ServiceDefaults.csproj" />
<ProjectReference Include="../../../src/Microsoft.AutoGen.ServiceDefaults/Microsoft.AutoGen.ServiceDefaults.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ProjectReference Include="../../../src/Microsoft.AutoGen.Agents.Client/Microsoft.AutoGen.Agents.Client.csproj" />

<ProjectReference Include="..\DevTeam.ServiceDefaults\DevTeam.ServiceDefaults.csproj" />
<ProjectReference Include="../../../src/Microsoft.AutoGen.ServiceDefaults/Microsoft.AutoGen.ServiceDefaults.csproj" />
<ProjectReference Include="..\DevTeam.Shared\DevTeam.Shared.csproj" />
<ProjectReference Include="..\..\..\src\Microsoft.AutoGen.Agents.Extensions\SemanticKernel\Microsoft.AutoGen.Agents.Extensions.SemanticKernel.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DevTeam.ServiceDefaults\DevTeam.ServiceDefaults.csproj" />
<ProjectReference Include="../../../src/Microsoft.AutoGen.ServiceDefaults/Microsoft.AutoGen.ServiceDefaults.csproj" />
<ProjectReference Include="..\DevTeam.Shared\DevTeam.Shared.csproj" />
<ProjectReference Include="..\..\..\src\Microsoft.AutoGen.Agents.Extensions\SemanticKernel\Microsoft.AutoGen.Agents.Extensions.SemanticKernel.csproj" />
</ItemGroup>
Expand Down
53 changes: 26 additions & 27 deletions dotnet/src/AutoGen.Mistral/DTOs/Error.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,36 @@

using System.Text.Json.Serialization;

namespace AutoGen.Mistral
namespace AutoGen.Mistral;

public class Error
{
public class Error
public Error(string type, string message, string? param = default(string), string? code = default(string))
{
public Error(string type, string message, string? param = default(string), string? code = default(string))
{
Type = type;
Message = message;
Param = param;
Code = code;
}
Type = type;
Message = message;
Param = param;
Code = code;
}

[JsonPropertyName("type")]
public string Type { get; set; }
[JsonPropertyName("type")]
public string Type { get; set; }

/// <summary>
/// Gets or Sets Message
/// </summary>
[JsonPropertyName("message")]
public string Message { get; set; }
/// <summary>
/// Gets or Sets Message
/// </summary>
[JsonPropertyName("message")]
public string Message { get; set; }

/// <summary>
/// Gets or Sets Param
/// </summary>
[JsonPropertyName("param")]
public string? Param { get; set; }
/// <summary>
/// Gets or Sets Param
/// </summary>
[JsonPropertyName("param")]
public string? Param { get; set; }

/// <summary>
/// Gets or Sets Code
/// </summary>
[JsonPropertyName("code")]
public string? Code { get; set; }
}
/// <summary>
/// Gets or Sets Code
/// </summary>
[JsonPropertyName("code")]
public string? Code { get; set; }
}
Loading

0 comments on commit 121d0b6

Please sign in to comment.