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
1 change: 1 addition & 0 deletions Extensions.AI.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
</Configurations>
<Project Path="src/Extensions.CodeAnalysis/Extensions.CodeAnalysis.csproj" />
<Project Path="src/Extensions/Extensions.csproj" />
<Project Path="src/Extensions.Console/Extensions.Console.csproj" />
<Project Path="src/Tests/Tests.csproj" />
</Solution>
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public ChatClientBuilder UseJsonConsoleLogging(JsonConsoleOptions? consoleOption
{
consoleOptions ??= JsonConsoleOptions.Default;

if (consoleOptions.InteractiveConfirm && ConsoleExtensions.IsConsoleInteractive && !AnsiConsole.Confirm("Do you want to enable rich JSON console logging for HTTP pipeline messages?"))
if (consoleOptions.InteractiveConfirm && ConsoleExtensions.IsConsoleInteractive && !AnsiConsole.Confirm("Do you want to enable rich JSON console logging for chat messages and responses?"))
return builder;

if (consoleOptions.InteractiveOnly && !ConsoleExtensions.IsConsoleInteractive)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ sealed class WrappedJsonText(string json, int maxWidth) : Renderable
protected override Measurement Measure(RenderOptions options, int maxWidth)
{
// Clamp the measurement to the desired maxWidth
return new Measurement(Math.Min(maxWidth, maxWidth), Math.Min(maxWidth, maxWidth));
var width = Math.Min(this.maxWidth, maxWidth);
return new Measurement(width, width);
}

protected override IEnumerable<Segment> Render(RenderOptions options, int maxWidth)
Expand All @@ -170,7 +171,7 @@ protected override IEnumerable<Segment> Render(RenderOptions options, int maxWid
var idx = 0;
while (idx < text.Length)
{
var len = Math.Min(maxWidth, text.Length - idx);
var len = Math.Min(this.maxWidth, text.Length - idx);
wrapped.Add(new Segment(text.Substring(idx, len), style));
idx += len;
if (idx < text.Length)
Expand Down
34 changes: 34 additions & 0 deletions src/Extensions.Console/Extensions.Console.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
<LangVersion>Preview</LangVersion>
<AssemblyName>Devlooped.Extensions.AI.Console</AssemblyName>
<RootNamespace>Devlooped.Extensions.AI</RootNamespace>
<PackageId>Devlooped.Extensions.AI.Console</PackageId>
<Description>Console logging extensions for Devlooped.Extensions.AI</Description>
<PackageLicenseExpression></PackageLicenseExpression>
<PackageLicenseFile>OSMFEULA.txt</PackageLicenseFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NuGetizer" Version="1.4.7" PrivateAssets="all" />
<PackageReference Include="Spectre.Console" Version="0.54.0" />
<PackageReference Include="Spectre.Console.Json" Version="0.54.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Extensions\Extensions.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\osmfeula.txt" Link="osmfeula.txt" PackagePath="OSMFEULA.txt" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="Devlooped.Agents.AI" />
<InternalsVisibleTo Include="Tests" />
</ItemGroup>

</Project>
5 changes: 2 additions & 3 deletions src/Extensions/Extensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
<PackageReference Include="NuGetizer" Version="1.4.7" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.AI" Version="10.2.0" />
<PackageReference Include="Microsoft.Extensions.AI.OpenAI" Version="10.0.1-preview.1.25571.5" />
<PackageReference Include="Spectre.Console" Version="0.54.0" />
<PackageReference Include="Spectre.Console.Json" Version="0.54.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.2" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="10.0.2" />
Expand All @@ -40,8 +38,9 @@
<ItemGroup>
<None Update="Devlooped.Extensions.AI.props" PackFolder="build" />
<None Include="..\..\osmfeula.txt" Link="osmfeula.txt" PackagePath="OSMFEULA.txt" />
<InternalsVisibleTo Include="Devlooped.Extensions.AI.Console" />
<InternalsVisibleTo Include="Devlooped.Agents.AI" />
<InternalsVisibleTo Include="Tests" />
</ItemGroup>

</Project>
</Project>
1 change: 1 addition & 0 deletions src/Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<ItemGroup>
<ProjectReference Include="..\Extensions.CodeAnalysis\Extensions.CodeAnalysis.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\Extensions\Extensions.csproj" />
<ProjectReference Include="..\Extensions.Console\Extensions.Console.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading