Class ModelChain
LLM chain
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 SourceModelChain(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 SourceDefaultOutputKey
Output chain produces
Declaration
public string DefaultOutputKey { get; set; }
Property Value
Type | Description |
---|---|
string |
InputBlock
Declaration
public ITargetBlock<ChainMessage> InputBlock { get; }
Property Value
Type | Description |
---|---|
ITargetBlock<ChainMessage> |
InputVariables
List of inputs chain require to run
Declaration
public IList<string> InputVariables { get; }
Property Value
Type | Description |
---|---|
IList<string> |
ModelMaxRequestTokens
Maximum number of tokens
Declaration
public int ModelMaxRequestTokens { get; }
Property Value
Type | Description |
---|---|
int |
OutputBlock
Declaration
public ISourceBlock<ChainMessage> OutputBlock { get; }
Property Value
Type | Description |
---|---|
ISourceBlock<ChainMessage> |
Methods
| Improve this Doc View SourceCancel()
Cancel Chain execution
Declaration
public void Cancel()