Search Results for

    Show / Hide Table of Contents

    Class ModelChain

    LLM chain

    Inheritance
    object
    ModelChain
    ConversationChain
    QuestionAnsweringChain
    SummarizeChain
    Implements
    IChain
    IChain<ChainMessage, ChainMessage>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: DotnetPrompt.Chains
    Assembly: DotnetPrompt.dll
    Syntax
    public class ModelChain : IChain, IChain<ChainMessage, ChainMessage>

    Constructors

    | Improve this Doc View Source

    ModelChain(IPromptTemplate, ILargeLanguageModel, string, ILogger?)

    Declaration
    public ModelChain(IPromptTemplate prompt, ILargeLanguageModel llm, string defaultOutputKey = "text", ILogger? logger = null)
    Parameters
    Type Name Description
    IPromptTemplate prompt

    Prompt template for chain to use in LLM

    ILargeLanguageModel llm

    LLM to use

    string defaultOutputKey

    Default key for chain result

    ILogger logger

    Default logger

    Properties

    | Improve this Doc View Source

    DefaultOutputKey

    Output chain produces

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

    InputBlock

    Declaration
    public ITargetBlock<ChainMessage> InputBlock { get; }
    Property Value
    Type Description
    ITargetBlock<ChainMessage>
    | Improve this Doc View Source

    InputVariables

    List of inputs chain require to run

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

    ModelMaxRequestTokens

    Maximum number of tokens

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

    OutputBlock

    Declaration
    public ISourceBlock<ChainMessage> OutputBlock { get; }
    Property Value
    Type Description
    ISourceBlock<ChainMessage>

    Methods

    | Improve this Doc View Source

    Cancel()

    Cancel Chain execution

    Declaration
    public void Cancel()

    Implements

    IChain
    IChain<TInput, TOutput>

    Extension Methods

    ChainExecutorExtensions.GetExecutor(IChain, bool)
    ChainExtensions.LinkTo(IChain, IChain)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright 2023 © Pavel «xakpc» Osadchuk for DotnetPrompt