2023-08-28 03:50:10 +00:00
|
|
|
using System.Text.Json;
|
|
|
|
|
|
|
|
|
|
namespace BotSharp.Abstraction.Routing.Models;
|
|
|
|
|
|
|
|
|
|
public class RetrievalArgs : RoutingArgs
|
|
|
|
|
{
|
|
|
|
|
[JsonPropertyName("question")]
|
|
|
|
|
public string Question { get; set; }
|
|
|
|
|
|
2023-08-28 15:58:35 +00:00
|
|
|
[JsonPropertyName("answer")]
|
|
|
|
|
public string Answer { get; set; }
|
|
|
|
|
|
2023-08-28 03:50:10 +00:00
|
|
|
[JsonPropertyName("args")]
|
2023-09-21 13:08:27 +00:00
|
|
|
public JsonDocument Arguments { get; set; } = JsonDocument.Parse("{}");
|
2023-09-19 12:17:50 +00:00
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
2023-09-21 13:08:27 +00:00
|
|
|
if (string.IsNullOrEmpty(Answer))
|
|
|
|
|
{
|
|
|
|
|
return $"[{AgentName}]: ({JsonSerializer.Serialize(Arguments)}) {Question}";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return $"[{AgentName}]: ({JsonSerializer.Serialize(Arguments)}) {Question} => {Answer}";
|
|
|
|
|
}
|
2023-09-19 12:17:50 +00:00
|
|
|
}
|
2023-08-28 03:50:10 +00:00
|
|
|
}
|