using AIStudio.Provider;
namespace AIStudio.Tools.Web;
public sealed class WebPageRetrievalOptions
{
public required int TimeoutSeconds { get; init; }
///
/// Whether the user named this exact URL, as opposed to a model asking for it.
///
///
/// Lifts the restrictions on which targets may be reached — private networks, loopback, and
/// hosts named localhost — because those exist to keep a model from reaching into the user's
/// network, and the user is not a model. The network-level protections stay: the connection
/// is still bound to validated addresses, redirects are still checked, the response size is
/// still capped, and only HTML and text content are still accepted.
/// Never set this for a URL that reached AI Studio through a model, however plausible it
/// looks.
///
public bool TargetChosenByUser { get; init; }
public bool PublicTargetsOnly { get; init; }
public ConfidenceLevel ProviderConfidence { get; init; } = ConfidenceLevel.NONE;
public bool UseOsSso { get; init; }
public Func? IsPrivateHostAllowed { get; init; }
///
/// Decides for every URL, the first one as well as each redirect target, whether it may be
/// requested at all. It runs before anything is sent, so a refused target never sees the URL.
///
public Func? IsTargetAllowed { get; init; }
public Func? OnPrivateHostProviderBlockAsync { get; init; }
}