ResponseDoneStatusDetail

This commit is contained in:
Haiping Chen 2025-04-18 16:34:46 -05:00
parent 485e170967
commit 7b5c889068
4 changed files with 29 additions and 3 deletions

View file

@ -71,7 +71,7 @@ public class RouteToAgentRoutingHandler : RoutingHandlerBase, IRoutingHandler
// Update next action agent's name
var agentService = _services.GetRequiredService<IAgentService>();
var agent = await agentService.LoadAgent(agentId);
var agent = await agentService.GetAgent(agentId);
inst.AgentName = agent.Name;
if (inst.ExecutingDirectly)

View file

@ -38,7 +38,7 @@ public class VerboseLogHook : IContentGeneratingHook
if (!_convSettings.ShowVerboseLog || string.IsNullOrEmpty(tokenStats.Prompt)) return;
var agentService = _services.GetRequiredService<IAgentService>();
var agent = await agentService.LoadAgent(message.CurrentAgentId);
var agent = await agentService.GetAgent(message.CurrentAgentId);
var log = message.Role == AgentRole.Function ?
$"[{agent?.Name}]: {message.Indication} {message.FunctionName}({message.FunctionArgs})" :

View file

@ -89,7 +89,32 @@ public class ResponseDoneStatusDetail
public string Type { get; set; } = null!;
[JsonPropertyName("reason")]
public string Reason { get; set; } = null!;
public string? Reason { get; set; } = null!;
[JsonPropertyName("error")]
public ResponseDoneErrorStatus? Error { get; set; } = null!;
public override string ToString()
{
return $"{Type}: {Reason} ({Error})";
}
}
public class ResponseDoneErrorStatus
{
[JsonPropertyName("type")]
public string Type { get; set; } = null!;
[JsonPropertyName("message")]
public string? Message { get; set; } = null!;
[JsonPropertyName("code")]
public string? Code { get; set; } = null!;
public override string ToString()
{
return $"{Type}: {Message} ({Code})";
}
}
public class ResponseDoneOutputContent

View file

@ -560,6 +560,7 @@ public class RealTimeCompletionProvider : IRealTimeCompletion
var data = JsonSerializer.Deserialize<ResponseDone>(response).Body;
if (data.Status != "completed")
{
_logger.LogError(data.StatusDetails.ToString());
return [];
}