Search Results for

    Show / Hide Table of Contents

    Interface IGenerativeRequest

    Defines the common contract for all Unified API generative requests.

    Namespace: Glitch9.AIDevKit
    Assembly: Glitch9.AIDevKit.dll
    Syntax
    public interface IGenerativeRequest

    Properties

    | Edit this page View Source

    Api

    Gets the provider API for this request. Usually resolved from Model when not explicitly assigned.

    Declaration
    Api Api { get; }
    Property Value
    Type Description
    Api
    | Edit this page View Source

    ContentType

    Gets the request content MIME type.

    Declaration
    MimeType ContentType { get; }
    Property Value
    Type Description
    MimeType
    | Edit this page View Source

    DownloadOptions

    Gets download/save options for generated outputs.

    Declaration
    DownloadOptions DownloadOptions { get; }
    Property Value
    Type Description
    DownloadOptions
    | Edit this page View Source

    EndpointType

    Gets the legacy endpoint category.

    Declaration
    [Obsolete("EndpointType is deprecated. Use RequestType instead.")]
    RequestType EndpointType { get; }
    Property Value
    Type Description
    RequestType
    | Edit this page View Source

    LogOptions

    Gets logging behavior for the HTTP layer.

    Declaration
    CurlLogOptions LogOptions { get; }
    Property Value
    Type Description
    CurlLogOptions
    | Edit this page View Source

    MeasureLatency

    Gets whether latency should be measured for this request.

    Declaration
    bool MeasureLatency { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    Model

    Gets or sets the model identifier. It can be a provider model ID or deployment name.

    Declaration
    string Model { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    N

    Gets the number of outputs to generate.

    Declaration
    NCount N { get; }
    Property Value
    Type Description
    NCount
    | Edit this page View Source

    OnLatencyMeasured

    Gets callback invoked with measured latency (seconds).

    Declaration
    Action<double> OnLatencyMeasured { get; }
    Property Value
    Type Description
    Action<double>
    | Edit this page View Source

    RecordOptions

    Gets generation-record behavior and callbacks.

    Declaration
    GenerationRecordOptions RecordOptions { get; }
    Property Value
    Type Description
    GenerationRecordOptions
    | Edit this page View Source

    RecordedContext

    Gets recorded curl/request context for diagnostics.

    Declaration
    CurlContext RecordedContext { get; }
    Property Value
    Type Description
    CurlContext
    | Edit this page View Source

    RequestType

    Gets the request endpoint category.

    Declaration
    RequestType RequestType { get; }
    Property Value
    Type Description
    RequestType
    | Edit this page View Source

    RequestedAt

    Gets the request timestamp captured when dispatch starts.

    Declaration
    DateTime RequestedAt { get; }
    Property Value
    Type Description
    DateTime
    | Edit this page View Source

    ResponseType

    Gets the expected response MIME type.

    Declaration
    MimeType ResponseType { get; }
    Property Value
    Type Description
    MimeType
    | Edit this page View Source

    SafetyIdentifier

    Gets the safety identifier for provider-side policy routing.

    Declaration
    SafetyIdentifier SafetyIdentifier { get; }
    Property Value
    Type Description
    SafetyIdentifier
    | Edit this page View Source

    Sender

    Gets or sets the logical sender for routing/history context.

    Declaration
    string Sender { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    ServiceTier

    Gets the provider service tier, when supported.

    Declaration
    ServiceTier? ServiceTier { get; }
    Property Value
    Type Description
    ServiceTier?
    | Edit this page View Source

    Stream

    Gets or sets whether this request should run in streaming mode.

    Declaration
    bool Stream { get; set; }
    Property Value
    Type Description
    bool

    Methods

    | Edit this page View Source

    Cancel()

    Cancels this request if it is running.

    Declaration
    void Cancel()
    | Edit this page View Source

    ExecuteAsyncT<T>(CancellationToken)

    Executes the request and casts the generated asset to T.

    Declaration
    UniTask<Generated<T>> ExecuteAsyncT<T>(CancellationToken ct = default) where T : class
    Parameters
    Type Name Description
    CancellationToken ct

    Cancellation token.

    Returns
    Type Description
    UniTask<Generated<T>>
    Type Parameters
    Name Description
    T

    Target generated asset type.

    | Edit this page View Source

    GetPrompt()

    Gets the prompt payload used to build this request.

    Declaration
    IPrompt GetPrompt()
    Returns
    Type Description
    IPrompt
    | Edit this page View Source

    GetPromptStringToRecord()

    Gets a prompt string suitable for history/recording.

    Declaration
    string GetPromptStringToRecord()
    Returns
    Type Description
    string
    | Edit this page View Source

    ProcessPostRequestTasks(IResult)

    Processes post-request tasks for raw results.

    Declaration
    void ProcessPostRequestTasks(IResult result)
    Parameters
    Type Name Description
    IResult result

    Request result.

    | Edit this page View Source

    ProcessPostRequestTasks<T>(Generated<T>)

    Processes post-request tasks for generated outputs.

    Declaration
    void ProcessPostRequestTasks<T>(Generated<T> output) where T : class
    Parameters
    Type Name Description
    Generated<T> output

    Generated output.

    Type Parameters
    Name Description
    T

    Generated asset type.

    | Edit this page View Source

    SetPlaygroundSettings(string, string, string, bool, Action<double>, Action<GenerationRecord>)

    Applies editor playground settings used for generation history and diagnostics.

    Declaration
    void SetPlaygroundSettings(string sender, string fileName, string selectedPath, bool measureLatency, Action<double> onLatencyMeasured, Action<GenerationRecord> onRecordCreated)
    Parameters
    Type Name Description
    string sender

    Playground sender identifier.

    string fileName

    Requested output file name.

    string selectedPath

    Selected output directory path.

    bool measureLatency

    Whether to force latency measurement.

    Action<double> onLatencyMeasured

    Latency callback.

    Action<GenerationRecord> onRecordCreated

    Record-created callback.

    | Edit this page View Source

    ShouldMeasureLatency()

    Returns true when latency should be measured.

    Declaration
    bool ShouldMeasureLatency()
    Returns
    Type Description
    bool

    true if latency measurement is enabled.

    | Edit this page View Source

    ShouldWriteRecord()

    Returns true when a generation record should be written.

    Declaration
    bool ShouldWriteRecord()
    Returns
    Type Description
    bool

    true if prompt history should be saved.

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation