using AIStudio.Provider; using AIStudio.Settings.DataModel; namespace AIStudio.Tools.ToolCallingSystem; /// /// What one tool call leaves behind: the text for the model, the trace for the user, and what the /// chat has to keep from now on. /// /// /// A call which was invalid, blocked or failed brought nothing in. It demands nothing of the chat /// and contributes no sources, which is what the defaults say. /// /// What the model reads as the result of the call. /// What the user sees of the call. public sealed record ToolCallOutcome(string Content, ToolInvocationTrace Trace) { /// /// The confidence every provider which continues the chat has to meet, see ChatThread.RequireProviderConfidence. /// public ConfidenceLevel RequiredProviderConfidence { get; init; } = ConfidenceLevel.NONE; /// /// The data security the chat has to keep, see ChatThread.RequireDataSecurity. /// public DataSourceSecurity RequiredDataSecurity { get; init; } = DataSourceSecurity.NOT_SPECIFIED; /// /// Where the chat may still send data, see ChatThread.RequireOutboundDataRestriction. /// public OutboundDataRequirement RequiredOutboundDataRestriction { get; init; } = OutboundDataRequirement.NONE; /// /// The sources the result contributes to the answer. /// public IReadOnlyList Sources { get; init; } = []; /// /// The web addresses in the result, as request keys, except those the model wrote into the call. /// /// /// A chat restricted by a mailbox may read the web pages whose addresses a tool returned, see /// ChatThread.IsWebAddressGivenToTheModel. A tool which repeats its arguments would otherwise /// turn any address the model makes up into one a tool returned: Semantic Search, for one, /// returns its query. Found where the arguments are still at hand in full, because the trace /// hides the sensitive ones. /// public IReadOnlyCollection ReturnedWebAddresses { get; init; } = []; }