Search Results for

    Show / Hide Table of Contents

    Class ChatGptModel

    OpenAI model to use with gpt-3.5-turbo model

    Inheritance
    object
    BaseModel
    ChatGptModel
    Implements
    ILargeLanguageModel
    Inherited Members
    BaseModel.Logger
    BaseModel.DefaultStop
    BaseModel.UseCache
    BaseModel.GenerateAsync(IList<string>, IList<string>)
    BaseModel.GetNumTokens(string)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: DotnetPrompt.LLM.OpenAI
    Assembly: DotnetPrompt.LLM.OpenAI.dll
    Syntax
    public class ChatGptModel : BaseModel, ILargeLanguageModel

    Constructors

    | Improve this Doc View Source

    ChatGptModel(string, ChatGptModelConfiguration, ILogger, IDistributedCache)

    Default constructor without logging

    Declaration
    public ChatGptModel(string openAIApiKey, ChatGptModelConfiguration defaultModelConfiguration, ILogger logger = null, IDistributedCache cache = null)
    Parameters
    Type Name Description
    string openAIApiKey
    ChatGptModelConfiguration defaultModelConfiguration
    ILogger logger
    IDistributedCache cache

    Fields

    | Improve this Doc View Source

    Model

    Declaration
    public const string Model = "gpt-3.5-turbo"
    Field Value
    Type Description
    string

    Properties

    | Improve this Doc View Source

    DefaultModelConfiguration

    Declaration
    public ChatGptModelConfiguration DefaultModelConfiguration { get; set; }
    Property Value
    Type Description
    ChatGptModelConfiguration
    | Improve this Doc View Source

    LLMType

    Declaration
    public override string LLMType { get; }
    Property Value
    Type Description
    string
    Overrides
    BaseModel.LLMType
    | Improve this Doc View Source

    MaxRequestTokens

    Declaration
    public override int MaxRequestTokens { get; }
    Property Value
    Type Description
    int
    Overrides
    BaseModel.MaxRequestTokens
    | Improve this Doc View Source

    OpenAiApiKey

    Declaration
    public string OpenAiApiKey { get; set; }
    Property Value
    Type Description
    string

    Methods

    | Improve this Doc View Source

    AsUniqueString()

    Declaration
    protected override string AsUniqueString()
    Returns
    Type Description
    string
    Overrides
    BaseModel.AsUniqueString()
    | Improve this Doc View Source

    CompletionsResponseValue(ChatGptModelConfiguration)

    Declaration
    protected Task<Completions> CompletionsResponseValue(ChatGptModelConfiguration options)
    Parameters
    Type Name Description
    ChatGptModelConfiguration options
    Returns
    Type Description
    Task<Completions>
    | Improve this Doc View Source

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

    Declaration
    protected override 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>
    Overrides
    BaseModel.GenerateInternalAsync(IList<string>, IList<string>)
    | Improve this Doc View Source

    ValidateJSON(string)

    Declaration
    public static bool ValidateJSON(string jsonString)
    Parameters
    Type Name Description
    string jsonString
    Returns
    Type Description
    bool

    Implements

    ILargeLanguageModel
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright 2023 © Pavel «xakpc» Osadchuk for DotnetPrompt