Class BaseModel
Inheritance
object
BaseModel
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
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
|
Improve this Doc
View Source
MaxRequestTokens
Declaration
public abstract int MaxRequestTokens { get; }
Property Value
|
Improve this Doc
View Source
UseCache
Declaration
public bool UseCache { get; set; }
Property Value
Methods
|
Improve this Doc
View Source
AsUniqueString()
Return current model as unique string for caching purposes
Declaration
protected abstract string AsUniqueString()
Returns
|
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
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
|
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
Extension Methods