Search Results for

    Show / Hide Table of Contents

    Class BaseModel

    Inheritance
    object
    BaseModel
    ChatGptModel
    OpenAIModel
    Implements
    ILargeLanguageModel
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: DotnetPrompt.Abstractions.LLM
    Assembly: DotnetPrompt.Abstractions.dll
    Syntax
    public abstract class BaseModel : ILargeLanguageModel

    Constructors

    | Improve this Doc View Source

    BaseModel(ILogger, IDistributedCache)

    Declaration
    protected BaseModel(ILogger logger, IDistributedCache cache)
    Parameters
    Type Name Description
    ILogger logger
    IDistributedCache cache

    Fields

    | Improve this Doc View Source

    Logger

    Declaration
    protected readonly ILogger Logger
    Field Value
    Type Description
    ILogger

    Properties

    | Improve this Doc View Source

    DefaultStop

    Declaration
    public IList<string> DefaultStop { get; set; }
    Property Value
    Type Description
    IList<string>
    | Improve this Doc View Source

    LLMType

    Declaration
    public abstract string LLMType { get; }
    Property Value
    Type Description
    string
    | Improve this Doc View Source

    MaxRequestTokens

    Declaration
    public abstract int MaxRequestTokens { get; }
    Property Value
    Type Description
    int
    | Improve this Doc View Source

    UseCache

    Declaration
    public bool UseCache { get; set; }
    Property Value
    Type Description
    bool

    Methods

    | Improve this Doc View Source

    AsUniqueString()

    Return current model as unique string for caching purposes

    Declaration
    protected abstract string AsUniqueString()
    Returns
    Type Description
    string
    | Improve this Doc View Source

    GenerateAsync(IList<string>, IList<string>)

    Run the LLM on the given prompt and input.

    Declaration
    public Task<ModelResult> GenerateAsync(IList<string> prompts, IList<string> stop = null)
    Parameters
    Type Name Description
    IList<string> prompts
    IList<string> stop
    Returns
    Type Description
    Task<ModelResult>
    Exceptions
    Type Condition
    System.InvalidOperationException

    When cache asked without

    | Improve this Doc View Source

    GenerateInternalAsync(IList<string>, IList<string>)

    Declaration
    protected abstract Task<ModelResult> GenerateInternalAsync(IList<string> prompts, IList<string> stop = null)
    Parameters
    Type Name Description
    IList<string> prompts
    IList<string> stop
    Returns
    Type Description
    Task<ModelResult>
    | Improve this Doc View Source

    GetNumTokens(string)

    Get the number of tokens present in the text.

    Declaration
    public virtual int GetNumTokens(string text)
    Parameters
    Type Name Description
    string text
    Returns
    Type Description
    int

    Number of characters divided by 4

    Implements

    ILargeLanguageModel

    Extension Methods

    ModelExtensions.PromptAsync(ILargeLanguageModel, string, List<string>)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright 2023 © Pavel «xakpc» Osadchuk for DotnetPrompt