Search Results for

    Show / Hide Table of Contents

    Class Generated<T>

    Represents the complete result envelope for content generated by AI services through the Unified API. Encapsulates generated values, metadata, usage statistics, and optional error information.

    Inheritance
    object
    Generated<T>
    Implements
    IResult
    IEmptiable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Glitch9.AIDevKit
    Assembly: Glitch9.AIDevKit.dll
    Syntax
    public sealed class Generated<T> : IResult, IEmptiable where T : class
    Type Parameters
    Name Description
    T

    The type of generated content. Must be a reference type.

    Remarks

    This type serves as the standardized output format for both synchronous generation endpoints and as the final aggregated result from streaming generation endpoints.

    Properties

    | Edit this page View Source

    Count

    Gets the number of generated values.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    CreatedAt

    Gets the timestamp when this content was generated.

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

    Error

    Gets the exception that occurred during generation, if any.

    Declaration
    public Exception Error { get; }
    Property Value
    Type Description
    Exception
    | Edit this page View Source

    Id

    Gets the unique identifier for this generation result.

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

    IsEmpty

    Gets a value indicating whether this result contains no generated values.

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

    this[int]

    Gets the generated value at the specified index.

    Declaration
    public T this[int index] { get; }
    Parameters
    Type Name Description
    int index

    The zero-based index of the value to retrieve.

    Property Value
    Type Description
    T

    The generated value at the specified index.

    Exceptions
    Type Condition
    IndexOutOfRangeException

    Thrown when the index is outside the valid range.

    | Edit this page View Source

    Paths

    Gets the file path(s) where generated content is stored, if applicable.

    Declaration
    public string[] Paths { get; }
    Property Value
    Type Description
    string[]
    | Edit this page View Source

    Usage

    Gets the token usage statistics for this generation operation.

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

    Value

    Gets the generated content value(s).

    Declaration
    public T[] Value { get; }
    Property Value
    Type Description
    T[]

    Methods

    | Edit this page View Source

    EnumerateValuePathPairs()

    Declaration
    public IEnumerable<(T Value, string Path)> EnumerateValuePathPairs()
    Returns
    Type Description
    IEnumerable<(T Value, string Path)>
    | Edit this page View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()

    Operators

    | Edit this page View Source

    implicit operator string(Generated<T>)

    Declaration
    public static implicit operator string(Generated<T> g)
    Parameters
    Type Name Description
    Generated<T> g
    Returns
    Type Description
    string
    | Edit this page View Source

    implicit operator string[](Generated<T>)

    Declaration
    public static implicit operator string[](Generated<T> g)
    Parameters
    Type Name Description
    Generated<T> g
    Returns
    Type Description
    string[]
    | Edit this page View Source

    implicit operator AudioClip(Generated<T>)

    Declaration
    public static implicit operator AudioClip(Generated<T> g)
    Parameters
    Type Name Description
    Generated<T> g
    Returns
    Type Description
    AudioClip
    | Edit this page View Source

    implicit operator AudioClip[](Generated<T>)

    Declaration
    public static implicit operator AudioClip[](Generated<T> g)
    Parameters
    Type Name Description
    Generated<T> g
    Returns
    Type Description
    AudioClip[]
    | Edit this page View Source

    implicit operator Sprite(Generated<T>)

    Declaration
    public static implicit operator Sprite(Generated<T> g)
    Parameters
    Type Name Description
    Generated<T> g
    Returns
    Type Description
    Sprite
    | Edit this page View Source

    implicit operator Sprite[](Generated<T>)

    Declaration
    public static implicit operator Sprite[](Generated<T> g)
    Parameters
    Type Name Description
    Generated<T> g
    Returns
    Type Description
    Sprite[]
    | Edit this page View Source

    implicit operator Texture2D(Generated<T>)

    Declaration
    public static implicit operator Texture2D(Generated<T> g)
    Parameters
    Type Name Description
    Generated<T> g
    Returns
    Type Description
    Texture2D
    | Edit this page View Source

    implicit operator Texture2D[](Generated<T>)

    Declaration
    public static implicit operator Texture2D[](Generated<T> g)
    Parameters
    Type Name Description
    Generated<T> g
    Returns
    Type Description
    Texture2D[]
    | Edit this page View Source

    implicit operator T(Generated<T>)

    Declaration
    public static implicit operator T(Generated<T> g)
    Parameters
    Type Name Description
    Generated<T> g
    Returns
    Type Description
    T
    | Edit this page View Source

    implicit operator T[](Generated<T>)

    Declaration
    public static implicit operator T[](Generated<T> g)
    Parameters
    Type Name Description
    Generated<T> g
    Returns
    Type Description
    T[]

    Implements

    IResult
    IEmptiable

    Extension Methods

    CollectionExtensions.FirstOrDefault<T>(Generated<T>)
    CollectionExtensions.IsNotNullOrEmpty<T>(Generated<T>)
    CollectionExtensions.IsNullOrEmpty<T>(Generated<T>)
    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