|
|
|
@@ -47,6 +47,12 @@ namespace LLama |
|
|
|
_isInstructMode = isInstructMode; |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
|
public IHistoryTransform Clone() |
|
|
|
{ |
|
|
|
return new DefaultHistoryTransform(_userName, _assistantName, _systemName, _unknownName, _isInstructMode); |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
|
public virtual string HistoryToText(ChatHistory history) |
|
|
|
{ |
|
|
|
@@ -116,6 +122,12 @@ namespace LLama |
|
|
|
{ |
|
|
|
return text.Trim(); |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
|
public ITextTransform Clone() |
|
|
|
{ |
|
|
|
return new NaiveTextInputTransform(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
@@ -129,6 +141,12 @@ namespace LLama |
|
|
|
{ |
|
|
|
return tokens; |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
|
public ITextStreamTransform Clone() |
|
|
|
{ |
|
|
|
return new EmptyTextOutputStreamTransform(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
@@ -157,6 +175,12 @@ namespace LLama |
|
|
|
_removeAllMatchedTokens = removeAllMatchedTokens; |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
|
public ITextStreamTransform Clone() |
|
|
|
{ |
|
|
|
return new KeywordTextOutputStreamTransform(_keywords, _maxKeywordLength, _removeAllMatchedTokens); |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
|
public async IAsyncEnumerable<string> TransformAsync(IAsyncEnumerable<string> tokens) |
|
|
|
{ |
|
|
|
|