ResponseDoneStatusDetail
This commit is contained in:
parent
485e170967
commit
7b5c889068
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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})" :
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 [];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue