mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-13 23:13:37 +00:00
24 lines
589 B
C#
24 lines
589 B
C#
|
|
using System.Text.Json.Nodes;
|
||
|
|
|
||
|
|
using AIStudio.Provider;
|
||
|
|
|
||
|
|
namespace AIStudio.Tools.ToolCallingSystem;
|
||
|
|
|
||
|
|
public sealed class ToolExecutionResult
|
||
|
|
{
|
||
|
|
public string? TextContent { get; init; }
|
||
|
|
|
||
|
|
public JsonNode? JsonContent { get; init; }
|
||
|
|
|
||
|
|
public IReadOnlyList<Source> Sources { get; init; } = [];
|
||
|
|
|
||
|
|
public ConfidenceLevel RequiredProviderConfidence { get; init; } = ConfidenceLevel.NONE;
|
||
|
|
|
||
|
|
public string ToModelContent()
|
||
|
|
{
|
||
|
|
if (this.JsonContent is not null)
|
||
|
|
return this.JsonContent.ToJsonString();
|
||
|
|
|
||
|
|
return this.TextContent ?? string.Empty;
|
||
|
|
}
|
||
|
|
}
|