Skip to content

Commit f9ece53

Browse files
authored
Merge branch 'main' into main
2 parents f3f4bba + 33d40e0 commit f9ece53

File tree

8 files changed

+63
-31
lines changed

8 files changed

+63
-31
lines changed

dotnet/Directory.Packages.props

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<PackageVersion Include="AWSSDK.SecurityToken" Version="4.0.1.6" />
2323
<PackageVersion Include="Azure.AI.Agents.Persistent" Version="1.0.0" />
2424
<PackageVersion Include="Azure.AI.ContentSafety" Version="1.0.0" />
25-
<PackageVersion Include="Azure.AI.OpenAI" Version="[2.3.0-beta.2]" />
25+
<PackageVersion Include="Azure.AI.OpenAI" Version="2.5.0-beta.1" />
2626
<PackageVersion Include="Azure.AI.Projects" Version="1.0.0-beta.9" />
2727
<PackageVersion Include="Azure.Identity" Version="1.14.2" />
2828
<PackageVersion Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.4.0" />
@@ -54,10 +54,8 @@
5454
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="8.0.14" />
5555
<PackageVersion Include="Microsoft.Azure.Functions.Worker" Version="2.0.0" />
5656
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.3.0" />
57-
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore"
58-
Version="2.0.0" />
59-
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues"
60-
Version="5.5.0" />
57+
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="2.0.0" />
58+
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues" Version="5.5.0" />
6159
<PackageVersion Include="Microsoft.Azure.Functions.Worker.SDK" Version="2.0.0" />
6260
<PackageVersion Include="Microsoft.Azure.Kusto.Data" Version="12.2.8" />
6361
<PackageVersion Include="Microsoft.Azure.WebJobs.Extensions.OpenApi" Version="1.5.1" />
@@ -85,7 +83,7 @@
8583
<PackageVersion Include="Npgsql" Version="8.0.7" />
8684
<PackageVersion Include="OData2Linq" Version="2.2.0" />
8785
<PackageVersion Include="OllamaSharp" Version="5.3.5" />
88-
<PackageVersion Include="OpenAI" Version="[2.4.0]" />
86+
<PackageVersion Include="OpenAI" Version="2.5.0" />
8987
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="1.12.0" />
9088
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.12.0" />
9189
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.12.0" />
@@ -106,21 +104,20 @@
106104
<PackageVersion Include="System.Text.Json" Version="8.0.6" />
107105
<PackageVersion Include="System.ValueTuple" Version="4.6.1" />
108106
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
109-
<PackageVersion Include="A2A" Version="0.1.0-preview.2" />
110-
<PackageVersion Include="A2A.AspNetCore" Version="0.1.0-preview.2" />
107+
<PackageVersion Include="A2A" Version="0.3.1-preview" />
108+
<PackageVersion Include="A2A.AspNetCore" Version="0.3.1-preview" />
111109
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
112110
<!-- Tokenizers -->
113111
<PackageVersion Include="Microsoft.ML.Tokenizers" Version="1.0.2" />
114112
<!-- Microsoft.Extensions.* -->
115-
<PackageVersion Include="Microsoft.Extensions.AI" Version="9.9.0" />
116-
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="9.9.0" />
117-
<PackageVersion Include="Microsoft.Extensions.AI.AzureAIInference" Version="9.9.0-preview.1.25458.4" />
118-
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="9.9.0-preview.1.25458.4" />
113+
<PackageVersion Include="Microsoft.Extensions.AI" Version="9.9.1" />
114+
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="9.9.1" />
115+
<PackageVersion Include="Microsoft.Extensions.AI.AzureAIInference" Version="9.9.1-preview.1.25474.6" />
116+
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="9.9.1-preview.1.25474.6" />
119117
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
120118
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
121119
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
122-
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables"
123-
Version="8.0.0" />
120+
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
124121
<PackageVersion Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
125122
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />
126123
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" />

dotnet/samples/Demos/A2AClientServer/A2AServer/A2AServer.http

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@hostLogistics = http://localhost:5002
55

66
### Query agent card for the invoice agent
7-
GET {{hostInvoice}}/.well-known/agent.json
7+
GET {{hostInvoice}}/.well-known/agent-card.json
88

99
### Send a message to the invoice agent
1010
POST {{hostInvoice}}
@@ -17,6 +17,7 @@ Content-Type: application/json
1717
"params": {
1818
"id": "12345",
1919
"message": {
20+
"kind": "message",
2021
"role": "user",
2122
"messageId": "msg_1",
2223
"parts": [
@@ -30,7 +31,7 @@ Content-Type: application/json
3031
}
3132

3233
### Query agent card for the policy agent
33-
GET {{hostPolicy}}/.well-known/agent.json
34+
GET {{hostPolicy}}/.well-known/agent-card.json
3435

3536
### Send a message to the policy agent
3637
POST {{hostPolicy}}
@@ -43,6 +44,7 @@ Content-Type: application/json
4344
"params": {
4445
"id": "12345",
4546
"message": {
47+
"kind": "message",
4648
"role": "user",
4749
"messageId": "msg_1",
4850
"parts": [
@@ -56,7 +58,7 @@ Content-Type: application/json
5658
}
5759

5860
### Query agent card for the logistics agent
59-
GET {{hostLogistics}}/.well-known/agent.json
61+
GET {{hostLogistics}}/.well-known/agent-card.json
6062

6163
### Send a message to the logistics agent
6264
POST {{hostLogistics}}
@@ -69,6 +71,7 @@ Content-Type: application/json
6971
"params": {
7072
"id": "12345",
7173
"message": {
74+
"kind": "message",
7275
"role": "user",
7376
"messageId": "msg_1",
7477
"parts": [

dotnet/samples/Demos/A2AClientServer/A2AServer/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,6 @@ You specialize in handling queries related to logistics.
9797
}
9898

9999
app.MapA2A(hostAgent!.TaskManager!, "/");
100+
app.MapWellKnownAgentCard(hostAgent!.TaskManager!, "/");
100101

101102
await app.RunAsync();

dotnet/src/Agents/A2A/A2AAgent.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ private async IAsyncEnumerable<AgentResponseItem<ChatMessageContent>> InvokeAgen
167167

168168
var messageSendParams = new MessageSendParams
169169
{
170-
Message = new Message
170+
Message = new AgentMessage
171171
{
172172
MessageId = Guid.NewGuid().ToString(),
173173
Role = MessageRole.User,
@@ -193,7 +193,7 @@ private async IAsyncEnumerable<AgentResponseItem<ChatMessageContent>> InvokeAgen
193193
Console.WriteLine();
194194
}
195195
}
196-
else if (response is Message messageResponse)
196+
else if (response is AgentMessage messageResponse)
197197
{
198198
foreach (var part in messageResponse.Parts)
199199
{

dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ private static ChatMessageContent GenerateMessageContent(string? assistantName,
624624
}
625625
}
626626
// Process image content
627-
else if (itemContent.ImageFileId != null)
627+
else if (!string.IsNullOrEmpty(itemContent.ImageFileId))
628628
{
629629
content.Items.Add(new FileReferenceContent(itemContent.ImageFileId));
630630
}
@@ -649,7 +649,7 @@ private static StreamingChatMessageContent GenerateStreamingMessageContent(strin
649649
content.Items.Add(new StreamingTextContent(update.Text));
650650
}
651651
// Process image content
652-
else if (update.ImageFileId != null)
652+
else if (!string.IsNullOrEmpty(update.ImageFileId))
653653
{
654654
content.Items.Add(new StreamingFileReferenceContent(update.ImageFileId));
655655
}
@@ -695,7 +695,7 @@ private static StreamingChatMessageContent GenerateStreamingMessageContent(strin
695695
{
696696
foreach (var output in update.CodeInterpreterOutputs!)
697697
{
698-
if (output.ImageFileId != null)
698+
if (!string.IsNullOrEmpty(output.ImageFileId))
699699
{
700700
content.Items.Add(new StreamingFileReferenceContent(output.ImageFileId));
701701
}

dotnet/src/Agents/UnitTests/A2A/A2AAgentTests.cs

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,43 @@ public async Task VerifyInvokeStreamingAsync()
8383
#region private
8484
private const string InvokeResponse =
8585
"""
86-
{"jsonrpc":"2.0","id":"ce7a5ef6-1078-4b6e-ad35-a8bfa6743c5d","result":{"kind":"task","id":"8d328159-ca63-4ce8-b416-4bcf69f9e119","contextId":"496a4a95-392b-4c04-a517-9a043b3f7565","status":{"state":"completed","timestamp":"2025-06-20T09:42:49.4013958Z"},"artifacts":[{"artifactId":"","parts":[{"kind":"text","text":"Here are the latest invoices for Contoso:\n\n1. Invoice ID: INV789, Date: 2025-06-18\n Products: T-Shirts (150 units at $10.00), Hats (200 units at $15.00), Glasses (300 units at $5.00)\n\n2. Invoice ID: INV666, Date: 2025-06-15\n Products: T-Shirts (2500 units at $8.00), Hats (1200 units at $10.00), Glasses (1000 units at $6.00)\n\n3. Invoice ID: INV999, Date: 2025-05-17\n Products: T-Shirts (1400 units at $10.50), Hats (1100 units at $9.00), Glasses (950 units at $12.00)\n\n4. Invoice ID: INV333, Date: 2025-05-13\n Products: T-Shirts (400 units at $11.00), Hats (600 units at $15.00), Glasses (700 units at $5.00)\n\nIf you need more details on any specific invoice, please let me know!"}]}],"history":[{"role":"user","parts":[{"kind":"text","text":"List the latest invoices for Contoso?"}],"messageId":"80a26c0f-2262-4d0f-8e7d-51ac4046173b"}]}}
86+
{
87+
"jsonrpc": "2.0",
88+
"id": "ce7a5ef6-1078-4b6e-ad35-a8bfa6743c5d",
89+
"result": {
90+
"kind": "task",
91+
"id": "8d328159-ca63-4ce8-b416-4bcf69f9e119",
92+
"contextId": "496a4a95-392b-4c04-a517-9a043b3f7565",
93+
"status": {
94+
"state": "completed",
95+
"timestamp": "2025-06-20T09:42:49.4013958Z"
96+
},
97+
"artifacts": [
98+
{
99+
"artifactId": "",
100+
"parts": [
101+
{
102+
"kind": "text",
103+
"text": "Here are the latest invoices for Contoso:\n\n1. Invoice ID: INV789, Date: 2025-06-18\n Products: T-Shirts (150 units at $10.00), Hats (200 units at $15.00), Glasses (300 units at $5.00)\n\n2. Invoice ID: INV666, Date: 2025-06-15\n Products: T-Shirts (2500 units at $8.00), Hats (1200 units at $10.00), Glasses (1000 units at $6.00)\n\n3. Invoice ID: INV999, Date: 2025-05-17\n Products: T-Shirts (1400 units at $10.50), Hats (1100 units at $9.00), Glasses (950 units at $12.00)\n\n4. Invoice ID: INV333, Date: 2025-05-13\n Products: T-Shirts (400 units at $11.00), Hats (600 units at $15.00), Glasses (700 units at $5.00)\n\nIf you need more details on any specific invoice, please let me know!"
104+
}
105+
]
106+
}
107+
],
108+
"history": [
109+
{
110+
"kind": "message",
111+
"role": "user",
112+
"parts": [
113+
{
114+
"kind": "text",
115+
"text": "List the latest invoices for Contoso?"
116+
}
117+
],
118+
"messageId": "80a26c0f-2262-4d0f-8e7d-51ac4046173b"
119+
}
120+
]
121+
}
122+
}
87123
""";
88124
#endregion
89125
}

dotnet/src/Agents/UnitTests/A2A/A2AHostAgentTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ public async Task VerifyExecuteAgentTaskAsync()
5454
}
5555

5656
#region private
57-
private List<Message> CreateUserMessages(string[] userMessages)
57+
private List<AgentMessage> CreateUserMessages(string[] userMessages)
5858
{
59-
var messages = new List<Message>();
59+
var messages = new List<AgentMessage>();
6060

6161
foreach (var userMessage in userMessages)
6262
{
63-
messages.Add(new Message()
63+
messages.Add(new AgentMessage()
6464
{
6565
Role = MessageRole.User,
6666
Parts = [new TextPart() { Text = userMessage }],

dotnet/src/Agents/Yaml/Extensions/YamlAgentDefinitionExtensions.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,6 @@ private static void NormalizeObject(object? obj, IConfiguration configuration)
6767
continue;
6868
}
6969

70-
if (property.Name.Equals("Options", StringComparison.OrdinalIgnoreCase))
71-
{
72-
Console.WriteLine("");
73-
}
74-
7570
var value = property.GetValue(obj);
7671
if (value is null)
7772
{

0 commit comments

Comments
 (0)