Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</Choose>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.9.0" />
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.9.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</Choose>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.9.0" />
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.9.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
<group targetFramework="net472">
<dependency id="AWSSDK.Core" version="4.0.1.3" />
<dependency id="AWSSDK.BedrockRuntime" version="4.0.7.7" />
<dependency id="Microsoft.Extensions.AI.Abstractions" version="9.9.0" />
<dependency id="Microsoft.Extensions.AI.Abstractions" version="9.9.1" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="AWSSDK.Core" version="4.0.1.3" />
<dependency id="AWSSDK.BedrockRuntime" version="4.0.7.7" />
<dependency id="Microsoft.Extensions.AI.Abstractions" version="9.9.0" />
<dependency id="Microsoft.Extensions.AI.Abstractions" version="9.9.1" />
</group>
<group targetFramework="net8.0">
<dependency id="AWSSDK.Core" version="4.0.1.3" />
<dependency id="AWSSDK.BedrockRuntime" version="4.0.7.7" />
<dependency id="Microsoft.Extensions.AI.Abstractions" version="9.9.0" />
<dependency id="Microsoft.Extensions.AI.Abstractions" version="9.9.1" />
</group>
</dependencies>
</metadata>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public async Task<ChatResponse> GetResponseAsync(

if (reasoningContent.ReasoningText.Signature is string signature)
{
(trc.AdditionalProperties ??= [])[nameof(reasoningContent.ReasoningText.Signature)] = signature;
trc.ProtectedData = signature;
}

if (reasoningContent.RedactedContent is { } redactedContent)
Expand Down Expand Up @@ -249,13 +249,13 @@ public async IAsyncEnumerable<ChatResponseUpdate> GetStreamingResponseAsync(
yield return textUpdate;
}

if (contentBlockDelta.Delta.ReasoningContent is { Text: not null } reasoningContent)
if (contentBlockDelta.Delta.ReasoningContent is { } reasoningContent)
{
TextReasoningContent trc = new(reasoningContent.Text);

if (reasoningContent.Signature is not null)
{
(trc.AdditionalProperties ??= [])[nameof(reasoningContent.Signature)] = reasoningContent.Signature;
trc.ProtectedData = reasoningContent.Signature;
}

if (reasoningContent.RedactedContent is { } redactedContent)
Expand Down Expand Up @@ -516,16 +516,18 @@ private static List<ContentBlock> CreateContents(ChatMessage message)
break;

case TextReasoningContent trc:
object? redactedContent = null;
trc.AdditionalProperties?.TryGetValue(nameof(ReasoningContentBlock.RedactedContent), out redactedContent);
contents.Add(new()
{
ReasoningContent = new()
{
ReasoningText = new()
{
Text = trc.Text,
Signature = trc.AdditionalProperties?[nameof(ReasoningContentBlock.ReasoningText.Signature)] as string,
Signature = trc.ProtectedData,
},
RedactedContent = trc.AdditionalProperties?[nameof(ReasoningContentBlock.RedactedContent)] is byte[] array ? new(array) : null,
RedactedContent = redactedContent is byte[] array ? new(array) : null,
}
});
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.9.0" />
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.9.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>
Expand Down
11 changes: 11 additions & 0 deletions generator/.DevConfigs/6c035145-4fe4-42cd-9339-4f10256de2e7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extensions": [
{
"extensionName": "Extensions.Bedrock.MEAI",
"type": "patch",
"changeLogMessages": [
"Fix reading/writing ReasoningContent for tool use."
]
}
]
}