From b68bc3548da052b5797ef0767cd67381328b585b Mon Sep 17 00:00:00 2001 From: Martin Evans Date: Sat, 6 Jan 2024 17:49:20 +0000 Subject: [PATCH] Fixed example code in readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1d011b4a..424ad8a9 100644 --- a/README.md +++ b/README.md @@ -116,11 +116,11 @@ Console.Write(prompt); // run the inference in a loop to chat with LLM while (prompt != "stop") { - await foreach (var text in session.ChatAsync(prompt, new InferenceParams() { Temperature = 0.6f, AntiPrompts = new List { "User:" } })) + await foreach (var text in session.ChatAsync(new ChatHistory.Message(AuthorRole.User, prompt), new InferenceParams { Temperature = 0.6f, AntiPrompts = [ "User:" ] })) { Console.Write(text); } - prompt = Console.ReadLine(); + prompt = Console.ReadLine() ?? ""; } // save the session