Added speaker hinting
This commit is contained in:
@@ -96,16 +96,16 @@ async Task AnswerChat(long chatId, string input) {
|
||||
if (!oaiChats.ContainsKey(chatId))
|
||||
AddChatToDictionary(chatId);
|
||||
|
||||
string text = input;
|
||||
//Limit the message to 1024 characters to avoid out of context jump
|
||||
string text = input;
|
||||
if (input.Length > 1024) text = input.Substring(0, 1024);
|
||||
|
||||
//Add the current message to the chat
|
||||
//oaiChats[chatId].Add(new UserChatMessage(text));
|
||||
ChatMessageRotate(chatId, new UserChatMessage(text));
|
||||
|
||||
//fetch existing messages history
|
||||
//fetch existing messages history, append hint of the speaker to the message:
|
||||
var messages = oaiChats[chatId];
|
||||
messages.Add(new AssistantChatMessage("Nemesis: "));
|
||||
|
||||
//Fetch the response from the model
|
||||
var result = chatClient.CompleteChat(messages).Value.Content[0].Text;
|
||||
|
||||
Reference in New Issue
Block a user