From 6514175cd4033a5d5e4502597011ad0b0b0fb35e Mon Sep 17 00:00:00 2001 From: tharun571 Date: Mon, 29 Jul 2024 23:44:17 +0530 Subject: [PATCH] Update documentation --- docs/source/magics.rst | 6 ++++++ src/xmagics/xassist.cpp | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/source/magics.rst b/docs/source/magics.rst index 24bf89a4..d8e64274 100644 --- a/docs/source/magics.rst +++ b/docs/source/magics.rst @@ -28,6 +28,12 @@ Leverage the large language models to assist in your development process. Curren %%xassist model prompt +- Reset model and clear chat history + +.. code:: + + %%xassist model --refresh + - Example .. image:: gemini.png diff --git a/src/xmagics/xassist.cpp b/src/xmagics/xassist.cpp index 166227d3..434f3114 100644 --- a/src/xmagics/xassist.cpp +++ b/src/xmagics/xassist.cpp @@ -100,11 +100,11 @@ namespace xcpp if(model == "gemini") { - out << "{ \"role\": \"" << user << "\", \"parts\": [ { \"text\": " << serializedCell << "}]}\n"; + out << "{ \"role\": \"" << user << R"(", "parts": [ { "text": )" << serializedCell << "}]}\n"; } else { - out << "{ \"role\": \"" << user << "\", \"content\": " << serializedCell << "}\n"; + out << "{ \"role\": \"" << user << R"(", "content": )" << serializedCell << "}\n"; } out.close(); @@ -275,7 +275,8 @@ namespace xcpp xcpp::APIKeyManager::saveApiKey(model, cell); return; } - else if (tokens[2] == "--refresh") + + if (tokens[2] == "--refresh") { xcpp::ChatHistory::refresh(model); return;