Skip to content
Merged
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
19 changes: 18 additions & 1 deletion shell/AIShell.Kernel/Shell.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Reflection;
using System.Text;
using AIShell.Abstraction;
using AIShell.Kernel.Commands;
using AIShell.Kernel.Mcp;
Expand Down Expand Up @@ -686,8 +687,24 @@ internal async Task RunREPLAsync()
continue;
}

StringBuilder sb = null;
string message = ex.Message;
string stackTrace = ex.StackTrace;

while (ex.InnerException is { })
{
sb ??= new(message, capacity: message.Length * 3);
sb.Append($"\n Inner -> {ex.InnerException.Message}");
ex = ex.InnerException;
}

if (sb is not null)
{
message = sb.ToString();
}

Host.WriteErrorLine()
.WriteErrorLine($"Agent failed to generate a response: {ex.Message}\n{ex.StackTrace}")
.WriteErrorLine($"Agent failed to generate a response: {message}\n\n{stackTrace}")
.WriteErrorLine();
}
}
Expand Down
2 changes: 1 addition & 1 deletion shell/ReadLine/Prediction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public PredictiveSuggestion(string suggestion, string toolTip)

public partial class PSConsoleReadLine
{
private const string DefaultName = "PSReadLine";
private const string DefaultName = "AIShell";
private readonly Prediction _prediction;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<ItemGroup>
<PackageReference Include="Azure.AI.OpenAI" Version="2.2.0-beta.4" />
<PackageReference Include="Azure.Identity" Version="1.14.0" />
<PackageReference Include="Azure.Identity" Version="1.15.0" />
<PackageReference Include="Microsoft.Extensions.AI" Version="9.6.0" />
<PackageReference Include="Microsoft.Extensions.AI.OpenAI" Version="9.6.0-preview.1.25310.2" />
</ItemGroup>
Expand Down
9 changes: 8 additions & 1 deletion shell/agents/AIShell.OpenAI.Agent/Service.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,14 @@ private void RefreshOpenAIClient()
}
else
{
var credential = new DefaultAzureCredential(includeInteractiveCredentials: true);
var credential = new DefaultAzureCredential(
new DefaultAzureCredentialOptions
{
ExcludeInteractiveBrowserCredential = false,
ExcludeEnvironmentCredential = true,
ExcludeManagedIdentityCredential = true,
}
);

var aiClient = new AzureOpenAIClient(
new Uri(_gptToUse.Endpoint),
Expand Down
Loading