Skip to content

Commit 6e081e6

Browse files
committed
Address PR feedback
1 parent 6dcb22c commit 6e081e6

File tree

7 files changed

+1
-131
lines changed

7 files changed

+1
-131
lines changed

src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AIAnnotation.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@ public AIAnnotation()
2929
/// </summary>
3030
public int? EndIndex { get; set; }
3131

32-
/// <summary>
33-
/// Gets or sets an optional placeholder or marker text that was present in the original content
34-
/// to indicate the citation (e.g., "〖4:0+source.json〗" or "[1]").
35-
/// </summary>
36-
/// <remarks>
37-
/// This is useful for UI rendering or when the original content contained inline citation markers
38-
/// that need to be preserved or reconstructed.
39-
/// </remarks>
40-
public string? Placeholder { get; set; }
41-
4232
/// <summary>Gets or sets the raw representation of the annotation from an underlying implementation.</summary>
4333
/// <remarks>
4434
/// If an <see cref="AIAnnotation"/> is created to represent some underlying object from another object

src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/CitationAnnotation.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ public CitationAnnotation()
1818
{
1919
}
2020

21-
/// <summary>
22-
/// Gets or sets the location within the source that contains the cited content.
23-
/// </summary>
24-
public CitationSourceLocation? Location { get; set; }
25-
2621
/// <summary>
2722
/// Gets or sets the title or name of the source.
2823
/// </summary>
@@ -51,9 +46,6 @@ public CitationAnnotation()
5146
/// </remarks>
5247
public string? ToolName { get; set; }
5348

54-
/// <summary>Gets or sets an associated ID of a tool call that produced the cited content.</summary>
55-
public string? ToolCallId { get; set; }
56-
5749
/// <summary>
5850
/// Gets or sets a snippet or excerpt from the source that was cited.
5951
/// </summary>

src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/CitationSourceLocation.cs

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/Libraries/Microsoft.Extensions.AI.Abstractions/Microsoft.Extensions.AI.Abstractions.json

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,6 @@
141141
"Member": "object? Microsoft.Extensions.AI.AIAnnotation.RawRepresentation { get; set; }",
142142
"Stage": "Stable"
143143
},
144-
{
145-
"Member": "string? Microsoft.Extensions.AI.AIAnnotation.Placeholder { get; set; }",
146-
"Stage": "Stable"
147-
},
148144
{
149145
"Member": "int? Microsoft.Extensions.AI.AIAnnotation.StartIndex { get; set; }",
150146
"Stage": "Stable"
@@ -1369,10 +1365,6 @@
13691365
"Member": "string? Microsoft.Extensions.AI.CitationAnnotation.ToolName { get; set; }",
13701366
"Stage": "Stable"
13711367
},
1372-
{
1373-
"Member": "string? Microsoft.Extensions.AI.CitationAnnotation.ToolCallId { get; set; }",
1374-
"Stage": "Stable"
1375-
},
13761368
{
13771369
"Member": "System.Uri? Microsoft.Extensions.AI.CitationAnnotation.Url { get; set; }",
13781370
"Stage": "Stable"
@@ -1381,52 +1373,12 @@
13811373
"Member": "string? Microsoft.Extensions.AI.CitationAnnotation.FileId { get; set; }",
13821374
"Stage": "Stable"
13831375
},
1384-
{
1385-
"Member": "Microsoft.Extensions.AI.CitationSourceLocation? Microsoft.Extensions.AI.CitationAnnotation.Location { get; set; }",
1386-
"Stage": "Stable"
1387-
},
13881376
{
13891377
"Member": "string? Microsoft.Extensions.AI.CitationAnnotation.Snippet { get; set; }",
13901378
"Stage": "Stable"
13911379
}
13921380
]
13931381
},
1394-
{
1395-
"Type": "class Microsoft.Extensions.AI.CitationSourceLocation",
1396-
"Stage": "Stable",
1397-
"Methods": [
1398-
{
1399-
"Member": "Microsoft.Extensions.AI.CitationSourceLocation.CitationSourceLocation();",
1400-
"Stage": "Stable"
1401-
}
1402-
],
1403-
"Properties": [
1404-
{
1405-
"Member": "int? Microsoft.Extensions.AI.CitationSourceLocation.PageStart { get; set; }",
1406-
"Stage": "Stable"
1407-
},
1408-
{
1409-
"Member": "int? Microsoft.Extensions.AI.CitationSourceLocation.PageEnd { get; set; }",
1410-
"Stage": "Stable"
1411-
},
1412-
{
1413-
"Member": "int? Microsoft.Extensions.AI.CitationSourceLocation.BlockStart { get; set; }",
1414-
"Stage": "Stable"
1415-
},
1416-
{
1417-
"Member": "int? Microsoft.Extensions.AI.CitationSourceLocation.BlockEnd { get; set; }",
1418-
"Stage": "Stable"
1419-
},
1420-
{
1421-
"Member": "int? Microsoft.Extensions.AI.CitationSourceLocation.CharacterStart { get; set; }",
1422-
"Stage": "Stable"
1423-
},
1424-
{
1425-
"Member": "int? Microsoft.Extensions.AI.CitationSourceLocation.CharacterEnd { get; set; }",
1426-
"Stage": "Stable"
1427-
}
1428-
]
1429-
},
14301382
{
14311383
"Type": "class Microsoft.Extensions.AI.DataContent : Microsoft.Extensions.AI.AIContent",
14321384
"Stage": "Stable",

src/Libraries/Microsoft.Extensions.AI.OpenAI/OpenAIAssistantChatClient.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ public async IAsyncEnumerable<ChatResponseUpdate> GetStreamingResponseAsync(
237237
RawRepresentation = tau,
238238
StartIndex = tau.StartIndex,
239239
EndIndex = tau.EndIndex,
240-
Placeholder = tau.TextToReplace,
241240

242241
FileId = fileId,
243242
ToolName = toolName,

test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/AIAnnotationTests.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public void Constructor_PropsDefault()
1515
AIAnnotation a = new();
1616
Assert.Null(a.AdditionalProperties);
1717
Assert.Null(a.EndIndex);
18-
Assert.Null(a.Placeholder);
1918
Assert.Null(a.RawRepresentation);
2019
Assert.Null(a.StartIndex);
2120
}
@@ -34,10 +33,6 @@ public void Constructor_PropsRoundtrip()
3433
a.EndIndex = 42;
3534
Assert.Equal(42, a.EndIndex);
3635

37-
Assert.Null(a.Placeholder);
38-
a.Placeholder = "placeholder";
39-
Assert.Equal("placeholder", a.Placeholder);
40-
4136
Assert.Null(a.RawRepresentation);
4237
object raw = new();
4338
a.RawRepresentation = raw;
@@ -55,7 +50,6 @@ public void Serialization_Roundtrips()
5550
{
5651
AdditionalProperties = new AdditionalPropertiesDictionary { { "key", "value" } },
5752
EndIndex = 42,
58-
Placeholder = "placeholder",
5953
RawRepresentation = new object(),
6054
StartIndex = 10,
6155
};
@@ -71,7 +65,6 @@ public void Serialization_Roundtrips()
7165
Assert.Equal(JsonSerializer.Deserialize<JsonElement>("\"value\"", AIJsonUtilities.DefaultOptions).ToString(), deserialized.AdditionalProperties["key"]!.ToString());
7266

7367
Assert.Equal(42, deserialized.EndIndex);
74-
Assert.Equal("placeholder", deserialized.Placeholder);
7568
Assert.Null(deserialized.RawRepresentation);
7669
Assert.Equal(10, deserialized.StartIndex);
7770
}

test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/CitationAnnotationTests.cs

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ public void Constructor_PropsDefault()
1515
CitationAnnotation a = new();
1616
Assert.Null(a.AdditionalProperties);
1717
Assert.Null(a.EndIndex);
18-
Assert.Null(a.Location);
19-
Assert.Null(a.Placeholder);
2018
Assert.Null(a.RawRepresentation);
2119
Assert.Null(a.Snippet);
2220
Assert.Null(a.StartIndex);
@@ -39,15 +37,6 @@ public void Constructor_PropsRoundtrip()
3937
a.EndIndex = 42;
4038
Assert.Equal(42, a.EndIndex);
4139

42-
Assert.Null(a.Location);
43-
CitationSourceLocation loc = new();
44-
a.Location = loc;
45-
Assert.Same(loc, a.Location);
46-
47-
Assert.Null(a.Placeholder);
48-
a.Placeholder = "placeholder";
49-
Assert.Equal("placeholder", a.Placeholder);
50-
5140
Assert.Null(a.RawRepresentation);
5241
object raw = new();
5342
a.RawRepresentation = raw;
@@ -82,16 +71,6 @@ public void Serialization_Roundtrips()
8271
{
8372
AdditionalProperties = new AdditionalPropertiesDictionary { { "key", "value" } },
8473
EndIndex = 42,
85-
Location = new()
86-
{
87-
PageStart = 1,
88-
PageEnd = 2,
89-
BlockStart = 3,
90-
BlockEnd = 4,
91-
CharacterStart = 5,
92-
CharacterEnd = 6
93-
},
94-
Placeholder = "placeholder",
9574
RawRepresentation = new object(),
9675
Snippet = "snippet",
9776
StartIndex = 10,
@@ -103,22 +82,14 @@ public void Serialization_Roundtrips()
10382
string json = JsonSerializer.Serialize(original, AIJsonUtilities.DefaultOptions.GetTypeInfo(typeof(CitationAnnotation)));
10483
Assert.NotNull(json);
10584

106-
CitationAnnotation? deserialized = (CitationAnnotation?)JsonSerializer.Deserialize(json, AIJsonUtilities.DefaultOptions.GetTypeInfo(typeof(CitationAnnotation)));
85+
var deserialized = (CitationAnnotation?)JsonSerializer.Deserialize(json, AIJsonUtilities.DefaultOptions.GetTypeInfo(typeof(CitationAnnotation)));
10786
Assert.NotNull(deserialized);
10887

10988
Assert.NotNull(deserialized.AdditionalProperties);
11089
Assert.Single(deserialized.AdditionalProperties);
11190
Assert.Equal(JsonSerializer.Deserialize<JsonElement>("\"value\"", AIJsonUtilities.DefaultOptions).ToString(), deserialized.AdditionalProperties["key"]!.ToString());
11291

11392
Assert.Equal(42, deserialized.EndIndex);
114-
Assert.NotNull(deserialized.Location);
115-
Assert.Equal(1, deserialized.Location.PageStart);
116-
Assert.Equal(2, deserialized.Location.PageEnd);
117-
Assert.Equal(3, deserialized.Location.BlockStart);
118-
Assert.Equal(4, deserialized.Location.BlockEnd);
119-
Assert.Equal(5, deserialized.Location.CharacterStart);
120-
Assert.Equal(6, deserialized.Location.CharacterEnd);
121-
Assert.Equal("placeholder", deserialized.Placeholder);
12293
Assert.Null(deserialized.RawRepresentation);
12394
Assert.Equal("snippet", deserialized.Snippet);
12495
Assert.Equal(10, deserialized.StartIndex);
@@ -127,6 +98,5 @@ public void Serialization_Roundtrips()
12798

12899
Assert.NotNull(deserialized.Url);
129100
Assert.Equal(original.Url, deserialized.Url);
130-
131101
}
132102
}

0 commit comments

Comments
 (0)