diff --git a/LM-Kit-Maestro/Services/LMKitService.cs b/LM-Kit-Maestro/Services/LMKitService.cs index 9279a83..7ef1291 100644 --- a/LM-Kit-Maestro/Services/LMKitService.cs +++ b/LM-Kit-Maestro/Services/LMKitService.cs @@ -423,7 +423,7 @@ private void BeforeSubmittingPrompt(Conversation conversation) { ChatHistory? chatHistory = shouldUseCurrentChatHistory ? conversation.ChatHistory : ChatHistory.Deserialize(conversation.LatestChatHistoryData, _model); - _multiTurnConversation = new MultiTurnConversation(_model, chatHistory) + _multiTurnConversation = new MultiTurnConversation(_model, chatHistory, LMKitConfig.ContextSize) { SamplingMode = GetTokenSampling(LMKitConfig), MaximumCompletionTokens = LMKitConfig.MaximumCompletionTokens, @@ -443,6 +443,17 @@ private void BeforeSubmittingPrompt(Conversation conversation) conversation.LastUsedModelUri = LMKitConfig.LoadedModelUri; _lastConversationUsed = conversation; } + else //updating sampling options, if any. + { + //todo: Implement a mechanism to determine whether SamplingMode and MaximumCompletionTokens need to be updated. + _multiTurnConversation.SamplingMode = GetTokenSampling(LMKitConfig); + _multiTurnConversation.MaximumCompletionTokens = LMKitConfig.MaximumCompletionTokens; + + if (LMKitConfig.ContextSize != _multiTurnConversation.ContextSize) + { + //todo: implement context size update. + } + } if (_singleTurnConversation == null) {