AI Dev Kit
Search Results for

    Show / Hide Table of Contents

    Class AIClient<TSelf>

    Inheritance
    object
    RESTClient
    CRUDClient<TSelf>
    AIClient<TSelf>
    ElevenLabs
    GenerativeAI
    Mubert
    Ollama
    OpenAI
    OpenRouter
    Namespace: Glitch9.AIDevKit.Client
    Assembly: .dll
    Syntax
    public abstract class AIClient<TSelf> : CRUDClient<TSelf> where TSelf : AIClient<TSelf>
    Type Parameters
    Name Description
    TSelf

    Constructors

    AIClient(AIClientSettingsFactory)

    Declaration
    protected AIClient(AIClientSettingsFactory settingsFactory)
    Parameters
    Type Name Description
    AIClientSettingsFactory settingsFactory

    Properties

    OnTokensConsumed

    Event invoked after a successful API request to handle token usage.

    Declaration
    public AIClient<TSelf>.UsageHandler OnTokensConsumed { get; set; }
    Property Value
    Type Description
    AIClient<TSelf>.UsageHandler

    Methods

    FormatErrorMessage(string)

    Parses the error res from the API. Override this method to customize the error message parsing logic.

    Declaration
    protected override string FormatErrorMessage(string errorMessage)
    Parameters
    Type Name Description
    string errorMessage
    Returns
    Type Description
    string

    The error message.

    Overrides
    Glitch9.IO.Networking.RESTApi.CRUDClient<TSelf>.FormatErrorMessage(string)

    HandleTokenUsage(Model, Usage)

    Declaration
    public virtual void HandleTokenUsage(Model model, Usage usage)
    Parameters
    Type Name Description
    Model model
    Usage usage

    IsDeletedPredicate(RESTResponse)

    Override this method to handle the status of a Glitch9.IO.Networking.RESTApi.CRUDMethod.Delete operation.

    Declaration
    protected override bool IsDeletedPredicate(RESTResponse res)
    Parameters
    Type Name Description
    RESTResponse res
    Returns
    Type Description
    bool
    Overrides
    Glitch9.IO.Networking.RESTApi.CRUDClient<TSelf>.IsDeletedPredicate(Glitch9.IO.Networking.RESTApi.RESTResponse)
    In this article
    Back to top Generated by DocFX