Skip to content

Commit

Permalink
Some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MackinnonBuck committed Jan 28, 2025
1 parent 7b01ed9 commit 0f6f67f
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 10 deletions.
5 changes: 0 additions & 5 deletions eng/MSBuild/Shared.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<ItemGroup Condition="'$(InjectSharedRentedSpan)' == 'true'">
<Compile Include="$(MSBuildThisFileDirectory)\..\..\src\Shared\RentedSpan\*.cs" LinkBase="Shared\RentedSpan" />
</ItemGroup>

<ItemGroup Condition="'$(InjectSharedServerSentEvents)' == 'true'">
<Compile Include="$(MSBuildThisFileDirectory)\..\..\src\Shared\ServerSentEvents\*.cs" LinkBase="Shared\ServerSentEvents" />
</ItemGroup>
Expand Down Expand Up @@ -46,8 +45,4 @@
<ItemGroup Condition="'$(InjectStringSplitExtensions)' == 'true'">
<Compile Include="$(MSBuildThisFileDirectory)\..\..\src\Shared\StringSplit\*.cs" LinkBase="Shared\StringSplit" />
</ItemGroup>

<ItemGroup Condition="'$(InjectSharedAIExtensions)' == 'true'">
<Compile Include="$(MSBuildThisFileDirectory)\..\..\src\Shared\AIExtensions\*.cs" LinkBase="Shared\AIExtensions" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<InjectSharedDiagnosticIds>true</InjectSharedDiagnosticIds>
<InjectSharedEmptyCollections>true</InjectSharedEmptyCollections>
<InjectStringHashOnLegacy>true</InjectStringHashOnLegacy>
<InjectSharedAIExtensions>true</InjectSharedAIExtensions>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<InjectSharedServerSentEvents>true</InjectSharedServerSentEvents>
<InjectRequiredMemberOnLegacy>true</InjectRequiredMemberOnLegacy>
<InjectCompilerFeatureRequiredOnLegacy>true</InjectCompilerFeatureRequiredOnLegacy>
<InjectSharedAIExtensions>true</InjectSharedAIExtensions>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ private static List<ChatMessageContentPart> ToOpenAIChatContent(IList<AIContent>
break;

case DataContent dataContent when dataContent.HasMediaTypePrefix("image/"):
if (dataContent.Data is { IsEmpty: false } data)
if (dataContent.ContainsData)
{
parts.Add(ChatMessageContentPart.CreateImagePart(BinaryData.FromBytes(data), dataContent.MediaType));
parts.Add(ChatMessageContentPart.CreateImagePart(BinaryData.FromBytes(dataContent.Data!.Value), dataContent.MediaType));
}
else if (dataContent.Uri is string uri)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public async Task FailureUsage_NullJson()
[Fact]
public async Task FailureUsage_NoJsonInResponse()
{
var expectedCompletion = new ChatCompletion([new ChatMessage(ChatRole.Assistant, [new DataContent("https://example.com", "image/png")])]);
var expectedCompletion = new ChatCompletion([new ChatMessage(ChatRole.Assistant, [new DataContent("https://example.com")])]);
using var client = new TestChatClient
{
CompleteAsyncCallback = (messages, options, cancellationToken) => Task.FromResult(expectedCompletion),
Expand Down

0 comments on commit 0f6f67f

Please sign in to comment.