Search Results for

    Show / Hide Table of Contents

    Class Prompt

    Represents a text prompt used in LLM (Large Language Model) AI interactions. Probably the most common type of prompt in AIDevKit.

    Inheritance
    object
    PromptBase
    PromptBase<string>
    Prompt
    Implements
    IPrompt
    IValidatable
    IEquatable<PromptBase>
    IModeratable
    Inherited Members
    PromptBase<string>.Value
    PromptBase<string>.GetHashCode()
    PromptBase<string>.Equals(object)
    PromptBase<string>.Equals(PromptBase)
    PromptBase.Validate()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Glitch9.AIDevKit
    Assembly: Glitch9.AIDevKit.dll
    Syntax
    public sealed class Prompt : PromptBase<string>, IPrompt, IValidatable, IEquatable<PromptBase>, IModeratable
    Remarks

    LLMs don't use weights for prompts, but this class is also used in other generative AI models that do support weighted inputs, such as image/video/speech/music generation models, which often support weighted prompts.

    Constructors

    | Edit this page View Source

    Prompt()

    Declaration
    public Prompt()
    | Edit this page View Source

    Prompt(string)

    Declaration
    public Prompt(string text)
    Parameters
    Type Name Description
    string text

    Properties

    | Edit this page View Source

    Length

    Declaration
    [JsonIgnore]
    public int Length { get; }
    Property Value
    Type Description
    int

    Methods

    | Edit this page View Source

    GetPromptText()

    Declaration
    public override string GetPromptText()
    Returns
    Type Description
    string
    Overrides
    PromptBase.GetPromptText()
    | Edit this page View Source

    IsValid()

    Declaration
    public override bool IsValid()
    Returns
    Type Description
    bool
    Overrides
    PromptBase.IsValid()
    | Edit this page View Source

    ToModerationPrompt()

    Declaration
    public ModerationPrompt ToModerationPrompt()
    Returns
    Type Description
    ModerationPrompt
    | 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(Prompt)

    Declaration
    public static implicit operator string(Prompt prompt)
    Parameters
    Type Name Description
    Prompt prompt
    Returns
    Type Description
    string
    | Edit this page View Source

    implicit operator Prompt(string)

    Declaration
    public static implicit operator Prompt(string prompt)
    Parameters
    Type Name Description
    string prompt
    Returns
    Type Description
    Prompt

    Implements

    IPrompt
    IValidatable
    IEquatable<T>
    IModeratable

    Extension Methods

    UnifiedApiCallerExtensions.GENModeration(IModeratable, IEnumerable<SafetySetting>)
    UnifiedApiCallerExtensions.GENCode(Prompt)
    UnifiedApiCallerExtensions.GENCompletion(Prompt)
    UnifiedApiCallerExtensions.GENMusic(Prompt)
    UnifiedApiCallerExtensions.GENResponse(Prompt)
    UnifiedApiCallerExtensions.GENSpeech(Prompt)
    UnifiedApiCallerExtensions.GENStruct<T>(Prompt)
    UnifiedApiCallerExtensions.TextToMusic(Prompt)
    UnifiedApiCallerExtensions.TextToSpeech(Prompt)
    UnifiedApiCallerExtensions.Tokenize(Prompt)
    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